mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-09 09:22:48 +03:00
add portrait mode for when the window is really tall
This commit is contained in:
@@ -112,6 +112,8 @@ func (gui *Gui) getViewDimensions() map[string]dimensions {
|
|||||||
|
|
||||||
width, height := gui.g.Size()
|
width, height := gui.g.Size()
|
||||||
|
|
||||||
|
portraitMode := width <= 84 && height > 50
|
||||||
|
|
||||||
main := "main"
|
main := "main"
|
||||||
secondary := "secondary"
|
secondary := "secondary"
|
||||||
if gui.State.Panels.LineByLine != nil && gui.State.Panels.LineByLine.SecondaryFocused {
|
if gui.State.Panels.LineByLine != nil && gui.State.Panels.LineByLine.SecondaryFocused {
|
||||||
@@ -157,7 +159,7 @@ func (gui *Gui) getViewDimensions() map[string]dimensions {
|
|||||||
fullHeightBox("commits"),
|
fullHeightBox("commits"),
|
||||||
fullHeightBox("stash"),
|
fullHeightBox("stash"),
|
||||||
}
|
}
|
||||||
} else if height >= 28 {
|
} else if height >= 28 && !portraitMode {
|
||||||
sideSectionChildren = []*box{
|
sideSectionChildren = []*box{
|
||||||
{
|
{
|
||||||
viewName: "status",
|
viewName: "status",
|
||||||
@@ -231,11 +233,16 @@ func (gui *Gui) getViewDimensions() map[string]dimensions {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sidePanelsDirection := COLUMN
|
||||||
|
if portraitMode {
|
||||||
|
sidePanelsDirection = ROW
|
||||||
|
}
|
||||||
|
|
||||||
root := &box{
|
root := &box{
|
||||||
direction: ROW,
|
direction: ROW,
|
||||||
children: []*box{
|
children: []*box{
|
||||||
{
|
{
|
||||||
direction: COLUMN,
|
direction: sidePanelsDirection,
|
||||||
weight: 1,
|
weight: 1,
|
||||||
children: []*box{
|
children: []*box{
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user