diff options
Diffstat (limited to 'gui/internal/ui')
| -rw-r--r-- | gui/internal/ui/settings.go | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/gui/internal/ui/settings.go b/gui/internal/ui/settings.go index 32a6066..361f415 100644 --- a/gui/internal/ui/settings.go +++ b/gui/internal/ui/settings.go @@ -137,6 +137,9 @@ func (w *Window) showSettings() { box.Append(l) } + // Everything this window can change, applied over the preferences as + // they are: the divider positions belong to the panes, not here, and + // composing a whole Prefs from these controls wrote them back as zeros. apply := func() { which := model.LayoutSide if layout.Selected() == 1 { @@ -146,8 +149,9 @@ func (w *Window) showSettings() { if i := int(sortOrder.Selected()); i >= 0 && i < len(model.SortOrders) { order = model.SortOrders[i] } - p := model.Prefs{ + p := w.prefs.WithDisplay(model.Display{ Sort: order, + Layout: which, ShowSize: showSize.Active(), ShowAge: showAge.Active(), ShowRule: showRule.Active(), @@ -155,17 +159,24 @@ func (w *Window) showSettings() { Preview: preview.Active(), SelectAll: selectAll.Selected() == 0, PreviewHeight: int(previewHeight.Value()), - Layout: which, - } + }) w.applyPrefs(p) if err := p.Save(); err != nil { w.setStatus("settings: %v", err) } } + // Every control, not four of them: sort, the three column toggles and + // the preview height were read by apply but never connected to it, so + // changing them did nothing until some other control happened to fire. colours.ConnectToggled(apply) preview.ConnectToggled(apply) + showSize.ConnectToggled(apply) + showAge.ConnectToggled(apply) + showRule.ConnectToggled(apply) selectAll.Connect("notify::selected", func() { apply() }) layout.Connect("notify::selected", func() { apply() }) + sortOrder.Connect("notify::selected", func() { apply() }) + previewHeight.ConnectValueChanged(apply) s.save = gtk.NewButtonWithLabel("Save krino.conf") s.save.AddCSSClass("suggested-action") |
