aboutsummaryrefslogtreecommitdiff
path: root/gui/internal/model/prefs.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-17 00:40:46 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-17 00:40:46 +0200
commitca0b703526151149d060d6d38f307e9e38c3dcd2 (patch)
tree5d1ccc124e1ffe95ae8fbaf18fcbe44f5b897d57 /gui/internal/model/prefs.go
parent4744ffac60b9bde27616f34a934f9404bc314efc (diff)
downloadkrino-ca0b703526151149d060d6d38f307e9e38c3dcd2.tar.gz
krino-ca0b703526151149d060d6d38f307e9e38c3dcd2.zip
gui: the preview is as big as you drag it, and PDFs render to suit
Diffstat (limited to 'gui/internal/model/prefs.go')
-rw-r--r--gui/internal/model/prefs.go13
1 files changed, 12 insertions, 1 deletions
diff --git a/gui/internal/model/prefs.go b/gui/internal/model/prefs.go
index ce9ee42..52ed012 100644
--- a/gui/internal/model/prefs.go
+++ b/gui/internal/model/prefs.go
@@ -22,11 +22,19 @@ type Prefs struct {
Preview bool `json:"preview"`
// SelectAll starts a plan's rows checked, as the terminal review does.
SelectAll bool `json:"select_all"`
+ // 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"`
}
+// DefaultPreviewHeight is the preview's height until one is chosen, and the
+// floor a smaller one is raised to.
+const DefaultPreviewHeight = 280
+
// DefaultPrefs is what a window does before anything is chosen.
func DefaultPrefs() Prefs {
- return Prefs{FontSize: 0, Colours: true, Preview: true, SelectAll: true}
+ return Prefs{FontSize: 0, Colours: true, Preview: true, SelectAll: true,
+ PreviewHeight: DefaultPreviewHeight}
}
// PrefsFile is where they are kept.
@@ -45,6 +53,9 @@ func LoadPrefs() Prefs {
if err := json.Unmarshal(data, &p); err != nil {
return DefaultPrefs()
}
+ if p.PreviewHeight < 80 {
+ p.PreviewHeight = DefaultPreviewHeight
+ }
return p
}