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/ui/settings.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/ui/settings.go')
| -rw-r--r-- | gui/internal/ui/settings.go | 30 |
1 files changed, 24 insertions, 6 deletions
diff --git a/gui/internal/ui/settings.go b/gui/internal/ui/settings.go index 732caf9..e90c691 100644 --- a/gui/internal/ui/settings.go +++ b/gui/internal/ui/settings.go @@ -74,23 +74,40 @@ func (w *Window) showSettings() { preview := gtk.NewCheckButtonWithLabel("show the file behind the selected row") preview.SetActive(prefs.Preview) preview.SetTooltipText("show the selected file under its explanation: a picture, a PDF's first page, or the first lines of text") - selectAll := gtk.NewCheckButtonWithLabel("a scanned plan starts with every file checked") - selectAll.SetActive(prefs.SelectAll) - selectAll.SetTooltipText("a freshly scanned plan starts with every file that can be acted on checked, as the terminal review does") + selectAll := gtk.NewDropDownFromStrings([]string{"every file checked", "nothing checked"}) + if !prefs.SelectAll { + selectAll.SetSelected(1) + } + selectAll.SetTooltipText("what a freshly scanned plan starts as: every file that can be acted on checked, as the terminal review does, or nothing checked so you pick") + + layout := gtk.NewDropDownFromStrings([]string{ + "file list beside the explanation", + "file list on top, preview beside the explanation", + }) + if prefs.Layout == model.LayoutStacked { + layout.SetSelected(1) + } + layout.SetTooltipText("how the Plan tab is arranged") previewHeight := gtk.NewSpinButtonWithRange(80, 2000, 20) previewHeight.SetValue(float64(prefs.PreviewHeight)) previewHeight.SetTooltipText("how tall the preview under an explanation is, in pixels; dragging the divider above it does the same") + box.Append(field("layout", layout)) box.Append(field("preview height", previewHeight)) + box.Append(field("after a scan", selectAll)) box.Append(colours) box.Append(preview) - box.Append(selectAll) apply := func() { + which := model.LayoutSide + if layout.Selected() == 1 { + which = model.LayoutStacked + } p := model.Prefs{ Colours: colours.Active(), Preview: preview.Active(), - SelectAll: selectAll.Active(), + SelectAll: selectAll.Selected() == 0, PreviewHeight: int(previewHeight.Value()), + Layout: which, } w.applyPrefs(p) if err := p.Save(); err != nil { @@ -99,7 +116,8 @@ func (w *Window) showSettings() { } colours.ConnectToggled(apply) preview.ConnectToggled(apply) - selectAll.ConnectToggled(apply) + selectAll.Connect("notify::selected", func() { apply() }) + layout.Connect("notify::selected", func() { apply() }) s.save = gtk.NewButtonWithLabel("Save krino.conf") s.save.AddCSSClass("suggested-action") |
