summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-03-21 21:38:37 +1100
committerJesse Duffield <jessedduffield@gmail.com>2023-04-30 13:19:53 +1000
commit1b2fb34ffdee3be0f914380875f9cd89f8d51588 (patch)
tree050386148ff232c62301fea45052474282ccfa5d /pkg/gui/gui.go
parent0e5a4c7a3629b3fcbb029f7398ebb2666ffe4a54 (diff)
start moving getDisplayStrings funcs into contexts
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go28
1 files changed, 10 insertions, 18 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 4b6a0fb8a..1b2918759 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -42,18 +42,6 @@ import (
"gopkg.in/ozeidan/fuzzy-patricia.v3/patricia"
)
-// screen sizing determines how much space your selected window takes up (window
-// as in panel, not your terminal's window). Sometimes you want a bit more space
-// to see the contents of a panel, and this keeps track of how much maximisation
-// you've set
-type WindowMaximisation int
-
-const (
- SCREEN_NORMAL WindowMaximisation = iota
- SCREEN_HALF
- SCREEN_FULL
-)
-
const StartupPopupVersion = 5
// OverlappingEdges determines if panel edges overlap
@@ -216,7 +204,7 @@ type GuiRepoState struct {
// panel without committing or if our commit failed
savedCommitMessage string
- ScreenMode WindowMaximisation
+ ScreenMode types.WindowMaximisation
CurrentPopupOpts *types.CreatePopupPanelOpts
}
@@ -247,6 +235,10 @@ func (self *GuiRepoState) SetCurrentPopupOpts(value *types.CreatePopupPanelOpts)
self.CurrentPopupOpts = value
}
+func (self *GuiRepoState) GetScreenMode() types.WindowMaximisation {
+ return self.ScreenMode
+}
+
type searchingState struct {
view *gocui.View
isSearching bool
@@ -353,19 +345,19 @@ func initialWindowViewNameMap(contextTree *context.ContextTree) *utils.ThreadSaf
return result
}
-func initialScreenMode(startArgs appTypes.StartArgs, config config.AppConfigurer) WindowMaximisation {
+func initialScreenMode(startArgs appTypes.StartArgs, config config.AppConfigurer) types.WindowMaximisation {
if startArgs.FilterPath != "" || startArgs.GitArg != appTypes.GitArgNone {
- return SCREEN_HALF
+ return types.SCREEN_HALF
} else {
defaultWindowSize := config.GetUserConfig().Gui.WindowSize
switch defaultWindowSize {
case "half":
- return SCREEN_HALF
+ return types.SCREEN_HALF
case "full":
- return SCREEN_FULL
+ return types.SCREEN_FULL
default:
- return SCREEN_NORMAL
+ return types.SCREEN_NORMAL
}
}
}