summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhanindra kumar Paladi <phanindrakumar.paladi@gmail.com>2023-01-11 16:51:46 +0530
committerPhanindra kumar Paladi <phanindrakumar.paladi@gmail.com>2023-01-11 16:51:46 +0530
commitf4ccb684642516f1e9a96ed511a746cde50d0dfb (patch)
tree06af51a7d1c6d4c4fd57781de30c9575c20b529d
parentc769a78db5f5cf7a126dfbeceeb6bd7e846f6682 (diff)
Added screenMode configuration to gui configuration
-rw-r--r--docs/Config.md1
-rw-r--r--pkg/config/user_config.go1
-rw-r--r--pkg/gui/gui.go15
3 files changed, 14 insertions, 3 deletions
diff --git a/docs/Config.md b/docs/Config.md
index d3b3aeb3a..cac8a4923 100644
--- a/docs/Config.md
+++ b/docs/Config.md
@@ -21,6 +21,7 @@ If you want to change the config directory:
```yaml
gui:
# stuff relating to the UI
+ screenMode: 'normal' # one of 'normal' | 'half' | 'full' default is 'normal'
scrollHeight: 2 # how many lines you scroll by
scrollPastBottom: true # enable scrolling past the bottom
sidePanelWidth: 0.3333 # number from 0 to 1
diff --git a/pkg/config/user_config.go b/pkg/config/user_config.go
index 06dcf085b..b1719ec10 100644
--- a/pkg/config/user_config.go
+++ b/pkg/config/user_config.go
@@ -50,6 +50,7 @@ type GuiConfig struct {
ShowIcons bool `yaml:"showIcons"`
CommandLogSize int `yaml:"commandLogSize"`
SplitDiff string `yaml:"splitDiff"`
+ ScreenMode string `yaml:"screenMode"`
}
type ThemeConfig struct {
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 4e15af94e..ddcc30ea8 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -277,7 +277,7 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) {
contextTree := gui.contextTree()
initialContext := initialContext(contextTree, startArgs)
- initialScreenMode := initialScreenMode(startArgs)
+ initialScreenMode := initialScreenMode(startArgs, gui.Config)
initialWindowViewNameMap := gui.initialWindowViewNameMap(contextTree)
@@ -307,11 +307,20 @@ func (gui *Gui) resetState(startArgs appTypes.StartArgs, reuseState bool) {
gui.RepoStateMap[Repo(currentDir)] = gui.State
}
-func initialScreenMode(startArgs appTypes.StartArgs) WindowMaximisation {
+func initialScreenMode(startArgs appTypes.StartArgs, config config.AppConfigurer) WindowMaximisation {
if startArgs.FilterPath != "" || startArgs.GitArg != appTypes.GitArgNone {
return SCREEN_HALF
} else {
- return SCREEN_NORMAL
+ defaultScreenMode := config.GetUserConfig().Gui.ScreenMode
+
+ switch defaultScreenMode {
+ case "half":
+ return SCREEN_HALF
+ case "full":
+ return SCREEN_FULL
+ default:
+ return SCREEN_NORMAL
+ }
}
}