summaryrefslogtreecommitdiffstats
path: root/pkg/gui/layout.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-05-17 21:29:14 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-13 21:50:23 +1000
commit13f567ff4c3b093f96cb885eea68dd851c776dc1 (patch)
treefdda97219a9da754a477bb9a42c5bc81704245c4 /pkg/gui/layout.go
parent771d4b5811d03baaca7349621c8ce36ef08523a3 (diff)
add portrait mode for when the window is really tall
Diffstat (limited to 'pkg/gui/layout.go')
-rw-r--r--pkg/gui/layout.go11
1 files changed, 9 insertions, 2 deletions
diff --git a/pkg/gui/layout.go b/pkg/gui/layout.go
index e51eee4d2..d964fcdc4 100644
--- a/pkg/gui/layout.go
+++ b/pkg/gui/layout.go
@@ -112,6 +112,8 @@ func (gui *Gui) getViewDimensions() map[string]dimensions {
width, height := gui.g.Size()
+ portraitMode := width <= 84 && height > 50
+
main := "main"
secondary := "secondary"
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("stash"),
}
- } else if height >= 28 {
+ } else if height >= 28 && !portraitMode {
sideSectionChildren = []*box{
{
viewName: "status",
@@ -231,11 +233,16 @@ func (gui *Gui) getViewDimensions() map[string]dimensions {
}
}
+ sidePanelsDirection := COLUMN
+ if portraitMode {
+ sidePanelsDirection = ROW
+ }
+
root := &box{
direction: ROW,
children: []*box{
{
- direction: COLUMN,
+ direction: sidePanelsDirection,
weight: 1,
children: []*box{
{