summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui_common.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-23 18:47:29 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commitdb12853bbe825d69686ea71161497d1bbb120b8e (patch)
treeebfb066dfef8eb75acdc1ea2bd5f15ff4f4a6507 /pkg/gui/gui_common.go
parent711674f6cd68ed3a35e5b0329ff0cf3289fbc7d1 (diff)
lots of changes
Diffstat (limited to 'pkg/gui/gui_common.go')
-rw-r--r--pkg/gui/gui_common.go22
1 files changed, 15 insertions, 7 deletions
diff --git a/pkg/gui/gui_common.go b/pkg/gui/gui_common.go
index e4b8b3981..7c26c655d 100644
--- a/pkg/gui/gui_common.go
+++ b/pkg/gui/gui_common.go
@@ -41,31 +41,35 @@ func (self *guiCommon) RunSubprocess(cmdObj oscommands.ICmdObj) (bool, error) {
}
func (self *guiCommon) PushContext(context types.Context, opts ...types.OnFocusOpts) error {
- return self.gui.pushContext(context, opts...)
+ return self.gui.State.ContextMgr.Push(context, opts...)
}
func (self *guiCommon) PopContext() error {
- return self.gui.popContext()
+ return self.gui.State.ContextMgr.Pop()
}
func (self *guiCommon) ReplaceContext(context types.Context) error {
- return self.gui.replaceContext(context)
+ return self.gui.State.ContextMgr.Replace(context)
}
func (self *guiCommon) CurrentContext() types.Context {
- return self.gui.currentContext()
+ return self.gui.State.ContextMgr.Current()
}
func (self *guiCommon) CurrentStaticContext() types.Context {
- return self.gui.currentStaticContext()
+ return self.gui.State.ContextMgr.CurrentStatic()
}
func (self *guiCommon) CurrentSideContext() types.Context {
- return self.gui.currentSideContext()
+ return self.gui.State.ContextMgr.CurrentSide()
}
func (self *guiCommon) IsCurrentContext(c types.Context) bool {
- return self.CurrentContext().GetKey() == c.GetKey()
+ return self.gui.State.ContextMgr.IsCurrent(c)
+}
+
+func (self *guiCommon) Context() types.IContextMgr {
+ return self.gui.State.ContextMgr
}
func (self *guiCommon) GetAppState() *config.AppState {
@@ -148,3 +152,7 @@ func (self *guiCommon) State() types.IStateAccessor {
func (self *guiCommon) KeybindingsOpts() types.KeybindingsOpts {
return self.gui.keybindingOpts()
}
+
+func (self *guiCommon) IsAnyModeActive() bool {
+ return self.IsAnyModeActive()
+}