aboutsummaryrefslogtreecommitdiff
path: root/gui/internal/model/prefs.go
diff options
context:
space:
mode:
authorLukasz Kasprzak <lukas@labunix.xyz>2026-09-17 09:12:32 +0200
committerLukasz Kasprzak <lukas@labunix.xyz>2026-09-17 09:12:32 +0200
commit4d6386960c981678a8e8123a4db5463df7ee60bb (patch)
tree403877da13c244b68ef335f25ba1337cd72a6527 /gui/internal/model/prefs.go
parent80dde7b2cae7b9844c244e03395145370a819412 (diff)
downloadkrino-4d6386960c981678a8e8123a4db5463df7ee60bb.tar.gz
krino-4d6386960c981678a8e8123a4db5463df7ee60bb.zip
gui: keep every divider where it is put, and let the columns shrink
Diffstat (limited to 'gui/internal/model/prefs.go')
-rw-r--r--gui/internal/model/prefs.go26
1 files changed, 22 insertions, 4 deletions
diff --git a/gui/internal/model/prefs.go b/gui/internal/model/prefs.go
index 3c249a3..77aa784 100644
--- a/gui/internal/model/prefs.go
+++ b/gui/internal/model/prefs.go
@@ -23,6 +23,14 @@ 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"`
+ // PreviewWidth is the same measurement in the stacked layout, where
+ // the preview sits beside the explanation rather than under it.
+ PreviewWidth int `json:"preview_width"`
+ // ListWidth and ListHeight are where the divider between the file list
+ // and the explanation was left, in each layout. Every divider a hand
+ // moves is kept (his request, 2026-09-17).
+ ListWidth int `json:"list_width"`
+ ListHeight int `json:"list_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.
@@ -35,14 +43,21 @@ const (
LayoutStacked = "stacked"
)
-// DefaultPreviewHeight is the preview's height until one is chosen, and the
-// floor a smaller one is raised to.
-const DefaultPreviewHeight = 280
+// The sizes a window opens with until a divider is moved, and the floor a
+// smaller one is raised to.
+const (
+ DefaultPreviewHeight = 280
+ DefaultPreviewWidth = 360
+ DefaultListWidth = 780
+ DefaultListHeight = 420
+)
// DefaultPrefs is what a window does before anything is chosen.
func DefaultPrefs() Prefs {
return Prefs{Colours: true, Preview: true, SelectAll: true,
- PreviewHeight: DefaultPreviewHeight, Layout: LayoutSide}
+ PreviewHeight: DefaultPreviewHeight, PreviewWidth: DefaultPreviewWidth,
+ ListWidth: DefaultListWidth, ListHeight: DefaultListHeight,
+ Layout: LayoutSide}
}
// PrefsFile is where they are kept.
@@ -64,6 +79,9 @@ func LoadPrefs() Prefs {
if p.PreviewHeight < 80 {
p.PreviewHeight = DefaultPreviewHeight
}
+ if p.PreviewWidth < 80 {
+ p.PreviewWidth = DefaultPreviewWidth
+ }
if p.Layout != LayoutSide && p.Layout != LayoutStacked {
p.Layout = LayoutSide
}