summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-23 12:35:07 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commit43251e727596cca2538548976769e47a1bfc5593 (patch)
tree280e4f0609ca58bbbaeb80446fa0d14a7e58a993 /pkg/gui/gui.go
parentf08135894344583394240f240377015ea874b03b (diff)
split context common from helper common
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go14
1 files changed, 11 insertions, 3 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 1b2918759..0ab45b526 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -127,8 +127,9 @@ type Gui struct {
Updating bool
- c *types.HelperCommon
- helpers *helpers.Helpers
+ c *helpers.HelperCommon
+ contextCommon *context.ContextCommon
+ helpers *helpers.Helpers
}
type StateAccessor struct {
@@ -385,6 +386,10 @@ func initialContext(contextTree *context.ContextTree, startArgs appTypes.StartAr
return initialContext
}
+func (gui *Gui) Contexts() *context.ContextTree {
+ return gui.State.Contexts
+}
+
// for now the split view will always be on
// NewGui builds a new gui handler
func NewGui(
@@ -442,7 +447,8 @@ func NewGui(
)
guiCommon := &guiCommon{gui: gui, IPopupHandler: gui.PopupHandler}
- helperCommon := &types.HelperCommon{IGuiCommon: guiCommon, Common: cmn}
+ helperCommon := &helpers.HelperCommon{IGuiCommon: guiCommon, Common: cmn, IGetContexts: gui}
+ contextCommon := &context.ContextCommon{IGuiCommon: guiCommon, Common: cmn}
credentialsHelper := helpers.NewCredentialsHelper(helperCommon)
@@ -461,6 +467,8 @@ func NewGui(
// TODO: reset these controllers upon changing repos due to state changing
gui.c = helperCommon
+ gui.contextCommon = contextCommon
+
authors.SetCustomAuthors(gui.UserConfig.Gui.AuthorColors)
icons.SetIconEnabled(gui.UserConfig.Gui.ShowIcons)
presentation.SetCustomBranches(gui.UserConfig.Gui.BranchColors)