diff options
Diffstat (limited to 'gui/internal/model/prefs.go')
| -rw-r--r-- | gui/internal/model/prefs.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gui/internal/model/prefs.go b/gui/internal/model/prefs.go index 6b3a6cb..2d2dc04 100644 --- a/gui/internal/model/prefs.go +++ b/gui/internal/model/prefs.go @@ -36,6 +36,9 @@ type Prefs struct { ShowSize bool `json:"show_size"` ShowAge bool `json:"show_age"` ShowRule bool `json:"show_rule"` + // Sort is the order a freshly scanned plan is read in; the picker in + // the toolbar changes it for the window in front of you. + Sort string `json:"sort"` // 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. @@ -60,7 +63,7 @@ const ( // DefaultPrefs is what a window does before anything is chosen. func DefaultPrefs() Prefs { return Prefs{Colours: true, Preview: true, SelectAll: true, - ShowSize: true, ShowAge: true, ShowRule: true, + ShowSize: true, ShowAge: true, ShowRule: true, Sort: SortDefault, PreviewHeight: DefaultPreviewHeight, PreviewWidth: DefaultPreviewWidth, ListWidth: DefaultListWidth, ListHeight: DefaultListHeight, Layout: LayoutSide} @@ -91,6 +94,9 @@ func LoadPrefs() Prefs { if p.Layout != LayoutSide && p.Layout != LayoutStacked { p.Layout = LayoutSide } + if !IsSortOrder(p.Sort) { + p.Sort = SortDefault + } return p } |
