Skip to content

Commit

Permalink
[Fix] Fix bad log search bar
Browse files Browse the repository at this point in the history
  • Loading branch information
sonder-joker committed Dec 30, 2021
1 parent 26a0647 commit 2168c33
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions app/src/main/kotlin/ui/log/ConsoleLog.kt
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,14 @@ fun ConsoleLog(consoleLog: ConsoleLog = viewModel { ConsoleLogViewModel() }) {
}
}

@OptIn(ExperimentalComposeUiApi::class)
internal fun Modifier.onPreviewCtrlFDown(action: () -> Unit): Modifier = onPreviewKeyEvent {
if (it.isCtrlFDown) {
if (it.isCtrlPressed && it.key == Key.F && it.type == KeyEventType.KeyDown) {
action()
true
} else false
}

@OptIn(ExperimentalComposeUiApi::class)
internal val KeyEvent.isCtrlFDown
get() = (key == Key.CtrlLeft || key == Key.CtrlRight) && type == KeyEventType.KeyDown && type == KeyEventType.KeyDown

@Composable
internal fun LogBox(
modifier: Modifier = Modifier,
Expand Down

0 comments on commit 2168c33

Please sign in to comment.