Extract building the window arrangement args into a method

The drag handle for resizing the side panels needs to know the current
layout, too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Stefan HallerandClaude Opus 5.5 committed 2026-11-15 19:40:26 +01:00
1 parent 7883453114
commit 8aba9b7086
1 file changed
+5 -3
@@ -86,6 +86,10 @@ type WindowArrangementArgs struct {
}
func (self *WindowArrangementHelper) GetWindowDimensions(informationStr string, appStatus string) map[string]boxlayout.Dimensions {
return GetWindowDimensions(self.windowArrangementArgs(informationStr, appStatus))
}
func (self *WindowArrangementHelper) windowArrangementArgs(informationStr string, appStatus string) WindowArrangementArgs {
width, height := self.c.GocuiGui().Size()
repoState := self.c.State().GetRepoState()
@@ -96,7 +100,7 @@ func (self *WindowArrangementHelper) GetWindowDimensions(informationStr string,
searchPrefix = self.c.Tr.SearchPrefix
}
args := WindowArrangementArgs{
return WindowArrangementArgs{
Width: width,
Height: height,
UserConfig: self.c.UserConfig(),
@@ -117,8 +121,6 @@ func (self *WindowArrangementHelper) GetWindowDimensions(informationStr string,
SearchPrefix: searchPrefix,
SidePanelSizes: self.c.State().GetSidePanelSizes(),
}
return GetWindowDimensions(args)
}
func shouldUsePortraitMode(args WindowArrangementArgs) bool {