diff --git a/pkg/gui/controllers/helpers/confirmation_helper.go b/pkg/gui/controllers/helpers/confirmation_helper.go index 47e3e89d4..fa2b502a9 100644 --- a/pkg/gui/controllers/helpers/confirmation_helper.go +++ b/pkg/gui/controllers/helpers/confirmation_helper.go @@ -325,7 +325,7 @@ func (self *ConfirmationHelper) getSelectedSuggestionValue() string { func (self *ConfirmationHelper) ResizeCurrentPopupPanels() { var parentPopupContext types.Context - for _, c := range self.c.CurrentPopupContexts() { + for _, c := range self.c.Context().CurrentPopup() { switch c { case self.c.Contexts().Menu: self.resizeMenu(parentPopupContext) diff --git a/pkg/gui/gui_common.go b/pkg/gui/gui_common.go index 332684845..d7813a3b0 100644 --- a/pkg/gui/gui_common.go +++ b/pkg/gui/gui_common.go @@ -45,10 +45,6 @@ func (self *guiCommon) RunSubprocess(cmdObj oscommands.ICmdObj) (bool, error) { return self.gui.runSubprocessWithSuspense(cmdObj) } -func (self *guiCommon) CurrentPopupContexts() []types.Context { - return self.gui.State.ContextMgr.CurrentPopup() -} - func (self *guiCommon) IsCurrentContext(c types.Context) bool { return self.gui.State.ContextMgr.IsCurrent(c) } diff --git a/pkg/gui/types/common.go b/pkg/gui/types/common.go index dd3a237f2..09613a220 100644 --- a/pkg/gui/types/common.go +++ b/pkg/gui/types/common.go @@ -57,7 +57,6 @@ type IGuiCommon interface { RunSubprocess(cmdObj oscommands.ICmdObj) (bool, error) RunSubprocessAndRefresh(oscommands.ICmdObj) error - CurrentPopupContexts() []Context IsCurrentContext(Context) bool // TODO: replace the above context-based methods with just using Context() e.g. replace PushContext() with Context().Push() Context() IContextMgr diff --git a/pkg/gui/types/context.go b/pkg/gui/types/context.go index 70458c16f..4c5f1a7d1 100644 --- a/pkg/gui/types/context.go +++ b/pkg/gui/types/context.go @@ -282,6 +282,7 @@ type IContextMgr interface { Current() Context CurrentStatic() Context CurrentSide() Context + CurrentPopup() []Context IsCurrent(c Context) bool ForEach(func(Context)) AllList() []IListContext