Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/Config.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ If you want to change the config directory:
```yaml
gui:
# stuff relating to the UI
windowSize: '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
Expand Down
1 change: 1 addition & 0 deletions pkg/config/user_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ type GuiConfig struct {
CommandLogSize int `yaml:"commandLogSize"`
SplitDiff string `yaml:"splitDiff"`
SkipRewordInEditorWarning bool `yaml:"skipRewordInEditorWarning"`
WindowSize string `yaml:"windowSize"`
}

type ThemeConfig struct {
Expand Down
15 changes: 12 additions & 3 deletions pkg/gui/gui.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down Expand Up @@ -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
defaultWindowSize := config.GetUserConfig().Gui.WindowSize

switch defaultWindowSize {
case "half":
return SCREEN_HALF
case "full":
return SCREEN_FULL
default:
return SCREEN_NORMAL
}
}
}

Expand Down