diff options
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") |
