Open repository keybinding can also be used in welcome page to open file explorer
This commit is contained in:
parent
fb542c9677
commit
aab0e01a30
@ -69,9 +69,9 @@ enum class KeybindingOption {
|
||||
STASH_POP,
|
||||
|
||||
/**
|
||||
* Used to pop stash changes to workspace
|
||||
* Used to open a repository
|
||||
*/
|
||||
OPEN_ANOTHER_REPOSITORY,
|
||||
OPEN_REPOSITORY,
|
||||
|
||||
/**
|
||||
* Used to open a new tab
|
||||
@ -131,7 +131,7 @@ private fun baseKeybindings() = mapOf(
|
||||
KeybindingOption.STASH_POP to listOf(
|
||||
Keybinding(key = Key.S, control = true, shift = true),
|
||||
),
|
||||
KeybindingOption.OPEN_ANOTHER_REPOSITORY to listOf(
|
||||
KeybindingOption.OPEN_REPOSITORY to listOf(
|
||||
Keybinding(key = Key.O, control = true),
|
||||
),
|
||||
KeybindingOption.OPEN_NEW_TAB to listOf(
|
||||
|
@ -22,7 +22,6 @@ import com.jetpackduba.gitnuro.keybindings.KeybindingOption
|
||||
import com.jetpackduba.gitnuro.keybindings.matchesBinding
|
||||
import com.jetpackduba.gitnuro.models.AuthorInfoSimple
|
||||
import com.jetpackduba.gitnuro.ui.components.SecondaryButton
|
||||
import com.jetpackduba.gitnuro.ui.components.TabInformation
|
||||
import com.jetpackduba.gitnuro.ui.components.TripleVerticalSplitPanel
|
||||
import com.jetpackduba.gitnuro.ui.dialogs.*
|
||||
import com.jetpackduba.gitnuro.ui.diff.Diff
|
||||
@ -154,7 +153,7 @@ fun RepositoryOpenPage(
|
||||
true
|
||||
}
|
||||
|
||||
it.matchesBinding(KeybindingOption.OPEN_ANOTHER_REPOSITORY) -> {
|
||||
it.matchesBinding(KeybindingOption.OPEN_REPOSITORY) -> {
|
||||
showOpenPopup = true
|
||||
true
|
||||
}
|
||||
|
@ -130,6 +130,15 @@ fun WelcomeView(
|
||||
.focusable(true)
|
||||
.focusRequester(welcomeViewFocusRequester)
|
||||
.background(MaterialTheme.colors.surface)
|
||||
.onPreviewKeyEvent {
|
||||
when {
|
||||
it.matchesBinding(KeybindingOption.OPEN_REPOSITORY) -> {
|
||||
onOpenRepository()
|
||||
true
|
||||
}
|
||||
else -> false
|
||||
}
|
||||
},
|
||||
) {
|
||||
|
||||
Column(
|
||||
|
Loading…
Reference in New Issue
Block a user