diff --git a/docs/keybindings/Keybindings_de.md b/docs/keybindings/Keybindings_de.md index f463e21bd..2d306a2d0 100644 --- a/docs/keybindings/Keybindings_de.md +++ b/docs/keybindings/Keybindings_de.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: next screen mode (normal/half/fullscreen) _: prev screen mode + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/docs/keybindings/Keybindings_en.md b/docs/keybindings/Keybindings_en.md index a5a8ff3f0..13470d1df 100644 --- a/docs/keybindings/Keybindings_en.md +++ b/docs/keybindings/Keybindings_en.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: next screen mode (normal/half/fullscreen) _: prev screen mode + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/docs/keybindings/Keybindings_es.md b/docs/keybindings/Keybindings_es.md index ff4eee148..145c7a229 100644 --- a/docs/keybindings/Keybindings_es.md +++ b/docs/keybindings/Keybindings_es.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: next screen mode (normal/half/fullscreen) _: prev screen mode + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/docs/keybindings/Keybindings_fr.md b/docs/keybindings/Keybindings_fr.md index 64fb4197d..260fe0bd2 100644 --- a/docs/keybindings/Keybindings_fr.md +++ b/docs/keybindings/Keybindings_fr.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: next screen mode (normal/half/fullscreen) _: prev screen mode + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/docs/keybindings/Keybindings_nl.md b/docs/keybindings/Keybindings_nl.md index 3de0c93e8..dca57f64a 100644 --- a/docs/keybindings/Keybindings_nl.md +++ b/docs/keybindings/Keybindings_nl.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: next screen mode (normal/half/fullscreen) _: prev screen mode + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/docs/keybindings/Keybindings_pl.md b/docs/keybindings/Keybindings_pl.md index 8d46b0efe..c290fdc20 100644 --- a/docs/keybindings/Keybindings_pl.md +++ b/docs/keybindings/Keybindings_pl.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: next screen mode (normal/half/fullscreen) _: prev screen mode + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/docs/keybindings/Keybindings_pt.md b/docs/keybindings/Keybindings_pt.md index 41604314c..73544cc92 100644 --- a/docs/keybindings/Keybindings_pt.md +++ b/docs/keybindings/Keybindings_pt.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: modo de tela seguinte (normal/meia/tela cheia) _: modo de tela anterior + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/docs/keybindings/Keybindings_tr.md b/docs/keybindings/Keybindings_tr.md index 018f68c28..787d7d157 100644 --- a/docs/keybindings/Keybindings_tr.md +++ b/docs/keybindings/Keybindings_tr.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: next screen mode (normal/half/fullscreen) _: prev screen mode + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/docs/keybindings/Keybindings_zh.md b/docs/keybindings/Keybindings_zh.md index 8b1607dde..0e47a44ee 100644 --- a/docs/keybindings/Keybindings_zh.md +++ b/docs/keybindings/Keybindings_zh.md @@ -104,4 +104,10 @@ _This file is auto-generated. To update, make the changes in the pkg/i18n direct
+: 下一个屏幕模式(正常/半屏/全屏) _: 上一个屏幕模式 + 1: focus projects panel + 2: focus services panel + 3: focus containers panel + 4: focus images panel + 5: focus volumes panel + 6: focus networks paneldiff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index e9e025ee5..fa28f27cb 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -541,6 +541,15 @@ func (gui *Gui) GetInitialKeybindings() []*Binding { }...) } + bindings = append(bindings, []*Binding{ + {Handler: gui.handleGoTo(gui.Panels.Projects.View), Key: '1', Description: gui.Tr.FocusProjects}, + {Handler: gui.handleGoTo(gui.Panels.Services.View), Key: '2', Description: gui.Tr.FocusServices}, + {Handler: gui.handleGoTo(gui.Panels.Containers.View), Key: '3', Description: gui.Tr.FocusContainers}, + {Handler: gui.handleGoTo(gui.Panels.Images.View), Key: '4', Description: gui.Tr.FocusImages}, + {Handler: gui.handleGoTo(gui.Panels.Volumes.View), Key: '5', Description: gui.Tr.FocusVolumes}, + {Handler: gui.handleGoTo(gui.Panels.Networks.View), Key: '6', Description: gui.Tr.FocusNetwork}, + }...) + for _, panel := range gui.allListPanels() { setUpDownClickBindings(panel.GetView().Name(), panel.HandlePrevLine, panel.HandleNextLine, panel.HandleClick) } diff --git a/pkg/gui/view_helpers.go b/pkg/gui/view_helpers.go index 5e2b72fb9..6acbb18c3 100644 --- a/pkg/gui/view_helpers.go +++ b/pkg/gui/view_helpers.go @@ -12,6 +12,13 @@ import ( "github.com/spkg/bom" ) +func (gui *Gui) handleGoTo(view *gocui.View) func(g *gocui.Gui, v *gocui.View) error { + return func(g *gocui.Gui, v *gocui.View) error { + gui.resetMainView() + return gui.switchFocus(view) + } +} + func (gui *Gui) nextView(g *gocui.Gui, v *gocui.View) error { sideViewNames := gui.sideViewNames() var focusedViewName string diff --git a/pkg/i18n/english.go b/pkg/i18n/english.go index f5a650da7..90c0eda1a 100644 --- a/pkg/i18n/english.go +++ b/pkg/i18n/english.go @@ -129,6 +129,13 @@ type TranslationSet struct { LcPrevScreenMode string ClearMain string FilterPrompt string + + FocusProjects string + FocusServices string + FocusContainers string + FocusImages string + FocusVolumes string + FocusNetwork string } func englishSet() TranslationSet { @@ -265,5 +272,12 @@ func englishSet() TranslationSet { LcPrevScreenMode: "prev screen mode", ClearMain: "clear main panel", FilterPrompt: "filter", + + FocusProjects: "focus projects panel", + FocusServices: "focus services panel", + FocusContainers: "focus containers panel", + FocusImages: "focus images panel", + FocusVolumes: "focus volumes panel", + FocusNetwork: "focus networks panel", } }