diff options
| author | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 08:39:48 +0200 |
|---|---|---|
| committer | Lukasz Kasprzak <lukas@labunix.xyz> | 2026-09-17 08:39:48 +0200 |
| commit | 1e3dd67868e1b6d3c12f0bca201d5e60a12c3723 (patch) | |
| tree | 3cea9254020a25bf69e1bb75096503db778bcff3 /gui/internal/model/prefs.go | |
| parent | 5418ba6bc5c653b6a99572c6ece6abbf57836c43 (diff) | |
| download | krino-1e3dd67868e1b6d3c12f0bca201d5e60a12c3723.tar.gz krino-1e3dd67868e1b6d3c12f0bca201d5e60a12c3723.zip | |
gui: aligned columns, theme colours, a second layout, and a scan-selection setting
Diffstat (limited to 'gui/internal/model/prefs.go')
| -rw-r--r-- | gui/internal/model/prefs.go | 15 |
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 } |
