diff options
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/context.go | 4 | ||||
-rw-r--r-- | pkg/gui/context/view_trait.go | 1 | ||||
-rw-r--r-- | pkg/gui/views.go | 1 |
3 files changed, 6 insertions, 0 deletions
diff --git a/pkg/gui/context.go b/pkg/gui/context.go index be5a720e3..28ecf2405 100644 --- a/pkg/gui/context.go +++ b/pkg/gui/context.go @@ -230,6 +230,10 @@ func (self *ContextMgr) ActivateContext(c types.Context, opts types.OnFocusOpts) self.gui.helpers.Window.SetWindowContext(c) self.gui.helpers.Window.MoveToTopOfWindow(c) + oldView := self.gui.c.GocuiGui().CurrentView() + if oldView != nil && oldView.Name() != viewName { + oldView.HighlightInactive = true + } if _, err := self.gui.c.GocuiGui().SetCurrentView(viewName); err != nil { return err } diff --git a/pkg/gui/context/view_trait.go b/pkg/gui/context/view_trait.go index 191419897..5342071ef 100644 --- a/pkg/gui/context/view_trait.go +++ b/pkg/gui/context/view_trait.go @@ -49,6 +49,7 @@ func (self *ViewTrait) SetContent(content string) { func (self *ViewTrait) SetHighlight(highlight bool) { self.view.Highlight = highlight + self.view.HighlightInactive = false } func (self *ViewTrait) SetFooter(value string) { diff --git a/pkg/gui/views.go b/pkg/gui/views.go index 9fd775764..9a4fa0a47 100644 --- a/pkg/gui/views.go +++ b/pkg/gui/views.go @@ -92,6 +92,7 @@ func (gui *Gui) createAllViews() error { (*mapping.viewPtr).FrameRunes = frameRunes (*mapping.viewPtr).FgColor = theme.GocuiDefaultTextColor (*mapping.viewPtr).SelBgColor = theme.GocuiSelectedLineBgColor + (*mapping.viewPtr).InactiveViewSelBgColor = theme.GocuiInactiveViewSelectedLineBgColor } gui.Views.Options.Frame = false |