aboutsummaryrefslogtreecommitdiff
path: root/gui/internal/model
diff options
context:
space:
mode:
Diffstat (limited to 'gui/internal/model')
-rw-r--r--gui/internal/model/prefs.go15
1 files changed, 14 insertions, 1 deletions
diff --git a/gui/internal/model/prefs.go b/gui/internal/model/prefs.go
index 1a91194..3c249a3 100644
--- a/gui/internal/model/prefs.go
+++ b/gui/internal/model/prefs.go
@@ -23,8 +23,18 @@ type Prefs struct {
// PreviewHeight is how tall the preview under the explanation is, in
// pixels; the divider between them sets it, and so does Settings.
PreviewHeight int `json:"preview_height"`
+ // Layout is how the Plan tab is arranged: "side" puts the file list
+ // beside the explanation, "stacked" puts it above, with the preview
+ // beside the explanation underneath.
+ Layout string `json:"layout"`
}
+// The two arrangements of the Plan tab.
+const (
+ LayoutSide = "side"
+ LayoutStacked = "stacked"
+)
+
// DefaultPreviewHeight is the preview's height until one is chosen, and the
// floor a smaller one is raised to.
const DefaultPreviewHeight = 280
@@ -32,7 +42,7 @@ const DefaultPreviewHeight = 280
// DefaultPrefs is what a window does before anything is chosen.
func DefaultPrefs() Prefs {
return Prefs{Colours: true, Preview: true, SelectAll: true,
- PreviewHeight: DefaultPreviewHeight}
+ PreviewHeight: DefaultPreviewHeight, Layout: LayoutSide}
}
// PrefsFile is where they are kept.
@@ -54,6 +64,9 @@ func LoadPrefs() Prefs {
if p.PreviewHeight < 80 {
p.PreviewHeight = DefaultPreviewHeight
}
+ if p.Layout != LayoutSide && p.Layout != LayoutStacked {
+ p.Layout = LayoutSide
+ }
return p
}