mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-05-19 22:33:16 +02:00
smarter sizing of command log panel
This commit is contained in:
parent
98375dc902
commit
926a48a65b
@ -132,6 +132,24 @@ func (gui *Gui) splitMainPanelSideBySide() bool {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (gui *Gui) getExtrasWindowSize(screenHeight int) int {
|
||||||
|
if !gui.ShowExtrasWindow {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
var baseSize int
|
||||||
|
if gui.currentStaticContext().GetKey() == COMMAND_LOG_CONTEXT_KEY {
|
||||||
|
baseSize = 1000 // my way of saying 'fill the available space'
|
||||||
|
} else if screenHeight < 40 {
|
||||||
|
baseSize = 1
|
||||||
|
} else {
|
||||||
|
baseSize = gui.Config.GetUserConfig().Gui.CommandLogSize
|
||||||
|
}
|
||||||
|
|
||||||
|
frameSize := 2
|
||||||
|
return baseSize + frameSize
|
||||||
|
}
|
||||||
|
|
||||||
func (gui *Gui) getWindowDimensions(informationStr string, appStatus string) map[string]boxlayout.Dimensions {
|
func (gui *Gui) getWindowDimensions(informationStr string, appStatus string) map[string]boxlayout.Dimensions {
|
||||||
width, height := gui.g.Size()
|
width, height := gui.g.Size()
|
||||||
|
|
||||||
@ -148,14 +166,7 @@ func (gui *Gui) getWindowDimensions(informationStr string, appStatus string) map
|
|||||||
mainPanelsDirection = boxlayout.COLUMN
|
mainPanelsDirection = boxlayout.COLUMN
|
||||||
}
|
}
|
||||||
|
|
||||||
extrasWindowSize := 0
|
extrasWindowSize := gui.getExtrasWindowSize(height)
|
||||||
if gui.ShowExtrasWindow {
|
|
||||||
frameSize := 2
|
|
||||||
extrasWindowSize = gui.Config.GetUserConfig().Gui.CommandLogSize + frameSize
|
|
||||||
if gui.currentStaticContext().GetKey() == COMMAND_LOG_CONTEXT_KEY {
|
|
||||||
extrasWindowSize = 40
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
root := &boxlayout.Box{
|
root := &boxlayout.Box{
|
||||||
Direction: boxlayout.ROW,
|
Direction: boxlayout.ROW,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user