diff options
Diffstat (limited to 'gui/internal/model/prefs.go')
| -rw-r--r-- | gui/internal/model/prefs.go | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/gui/internal/model/prefs.go b/gui/internal/model/prefs.go index ce9ee42..52ed012 100644 --- a/gui/internal/model/prefs.go +++ b/gui/internal/model/prefs.go @@ -22,11 +22,19 @@ type Prefs struct { Preview bool `json:"preview"` // SelectAll starts a plan's rows checked, as the terminal review does. SelectAll bool `json:"select_all"` + // 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"` } +// DefaultPreviewHeight is the preview's height until one is chosen, and the +// floor a smaller one is raised to. +const DefaultPreviewHeight = 280 + // DefaultPrefs is what a window does before anything is chosen. func DefaultPrefs() Prefs { - return Prefs{FontSize: 0, Colours: true, Preview: true, SelectAll: true} + return Prefs{FontSize: 0, Colours: true, Preview: true, SelectAll: true, + PreviewHeight: DefaultPreviewHeight} } // PrefsFile is where they are kept. @@ -45,6 +53,9 @@ func LoadPrefs() Prefs { if err := json.Unmarshal(data, &p); err != nil { return DefaultPrefs() } + if p.PreviewHeight < 80 { + p.PreviewHeight = DefaultPreviewHeight + } return p } |
