From d5705522063123bafaf41243c732db3db1d71751 Mon Sep 17 00:00:00 2001 From: Stefan Haller Date: Thu, 8 Aug 2024 10:42:40 +0200 Subject: [PATCH] Replace ActivateContext() with Context().Activate() --- pkg/gui/gui_common.go | 4 ---- pkg/gui/layout.go | 2 +- pkg/gui/types/common.go | 2 -- pkg/gui/types/context.go | 1 + 4 files changed, 2 insertions(+), 7 deletions(-) diff --git a/pkg/gui/gui_common.go b/pkg/gui/gui_common.go index 0a4db061b..2b132c3d1 100644 --- a/pkg/gui/gui_common.go +++ b/pkg/gui/gui_common.go @@ -53,10 +53,6 @@ func (self *guiCommon) ContextForKey(key types.ContextKey) types.Context { return self.gui.State.ContextMgr.ContextForKey(key) } -func (self *guiCommon) ActivateContext(context types.Context) error { - return self.gui.State.ContextMgr.Activate(context, types.OnFocusOpts{}) -} - func (self *guiCommon) GetAppState() *config.AppState { return self.gui.Config.GetAppState() } diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go index 8c26fef80..ff7923117 100644 --- a/pkg/gui/layout.go +++ b/pkg/gui/layout.go @@ -212,7 +212,7 @@ func (gui *Gui) onInitialViewsCreationForRepo() error { } initialContext := gui.c.Context().Current() - if err := gui.c.ActivateContext(initialContext); err != nil { + if err := gui.c.Context().Activate(initialContext, types.OnFocusOpts{}); err != nil { return err } diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go index ff2c69a13..b4a731c59 100644 --- a/pkg/gui/types/common.go +++ b/pkg/gui/types/common.go @@ -60,8 +60,6 @@ type IGuiCommon interface { Context() IContextMgr ContextForKey(key ContextKey) Context - ActivateContext(context Context) error - GetConfig() config.AppConfigurer GetAppState() *config.AppState SaveAppState() error diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go index 4c5f1a7d1..27385bbbf 100644 --- a/pkg/gui/types/context.go +++ b/pkg/gui/types/context.go @@ -279,6 +279,7 @@ type IContextMgr interface { Push(context Context, opts ...OnFocusOpts) error Pop() error Replace(context Context) error + Activate(context Context, opts OnFocusOpts) error Current() Context CurrentStatic() Context CurrentSide() Context