diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-01-16 14:46:53 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-17 19:13:40 +1100 |
commit | 1dd7307fde033dae5fececac15810a99e26c3d91 (patch) | |
tree | 4e851c9e3229a6fe3b4191f6311d05d7a9142960 /pkg/gui/arrangement.go | |
parent | a90b6efded49abcfa2516db794d7875b0396f558 (diff) |
start moving commit panel handlers into controller
more
and more
move rebase commit refreshing into existing abstraction
and more
and more
WIP
and more
handling clicks
properly fix merge conflicts
update cheatsheet
lots more preparation to start moving things into controllers
WIP
better typing
expand on remotes controller
moving more code into controllers
Diffstat (limited to 'pkg/gui/arrangement.go')
-rw-r--r-- | pkg/gui/arrangement.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/pkg/gui/arrangement.go b/pkg/gui/arrangement.go index fa2e7f29d..944391d75 100644 --- a/pkg/gui/arrangement.go +++ b/pkg/gui/arrangement.go @@ -2,6 +2,7 @@ package gui import ( "github.com/jesseduffield/lazygit/pkg/gui/boxlayout" + "github.com/jesseduffield/lazygit/pkg/gui/types" "github.com/jesseduffield/lazygit/pkg/utils" ) @@ -44,7 +45,7 @@ func (gui *Gui) getMidSectionWeights() (int, int) { currentWindow := gui.currentWindow() // we originally specified this as a ratio i.e. .20 would correspond to a weight of 1 against 4 - sidePanelWidthRatio := gui.UserConfig.Gui.SidePanelWidth + sidePanelWidthRatio := gui.c.UserConfig.Gui.SidePanelWidth // we could make this better by creating ratios like 2:3 rather than always 1:something mainSectionWeight := int(1/sidePanelWidthRatio) - 1 sideSectionWeight := 1 @@ -115,7 +116,7 @@ func (gui *Gui) splitMainPanelSideBySide() bool { return false } - mainPanelSplitMode := gui.UserConfig.Gui.MainPanelSplitMode + mainPanelSplitMode := gui.c.UserConfig.Gui.MainPanelSplitMode width, height := gui.g.Size() switch mainPanelSplitMode { @@ -143,7 +144,7 @@ func (gui *Gui) getExtrasWindowSize(screenHeight int) int { } else if screenHeight < 40 { baseSize = 1 } else { - baseSize = gui.UserConfig.Gui.CommandLogSize + baseSize = gui.c.UserConfig.Gui.CommandLogSize } frameSize := 2 @@ -259,7 +260,7 @@ func (gui *Gui) sidePanelChildren(width int, height int) []*boxlayout.Box { fullHeightBox("stash"), } } else if height >= 28 { - accordionMode := gui.UserConfig.Gui.ExpandFocusedSidePanel + accordionMode := gui.c.UserConfig.Gui.ExpandFocusedSidePanel accordionBox := func(defaultBox *boxlayout.Box) *boxlayout.Box { if accordionMode && defaultBox.Window == currentWindow { return &boxlayout.Box{ @@ -320,7 +321,7 @@ func (gui *Gui) currentSideWindowName() string { reversedIdx := len(gui.State.ContextManager.ContextStack) - 1 - idx context := gui.State.ContextManager.ContextStack[reversedIdx] - if context.GetKind() == SIDE_CONTEXT { + if context.GetKind() == types.SIDE_CONTEXT { return context.GetWindowName() } } |