mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-11-21 04:46:29 +03:00
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:
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 {
|
||||
|
||||
Reference in new issue
Block a user