mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
Allow setting default screenMode (#421)
This commit is contained in:
parent
66f5d176d3
commit
07f26c1e91
3 changed files with 20 additions and 0 deletions
|
|
@ -36,6 +36,8 @@ gui:
|
||||||
# When true, increases vertical space used by focused side panel,
|
# When true, increases vertical space used by focused side panel,
|
||||||
# creating an accordion effect
|
# creating an accordion effect
|
||||||
expandFocusedSidePanel: false
|
expandFocusedSidePanel: false
|
||||||
|
# Determines which screen mode will be used on startup
|
||||||
|
screenMode: "normal" # one of 'normal' | 'half' | 'fullscreen'
|
||||||
logs:
|
logs:
|
||||||
timestamps: false
|
timestamps: false
|
||||||
since: '60m' # set to '' to show all logs
|
since: '60m' # set to '' to show all logs
|
||||||
|
|
|
||||||
|
|
@ -130,6 +130,9 @@ type GuiConfig struct {
|
||||||
// When true, increases vertical space used by focused side panel,
|
// When true, increases vertical space used by focused side panel,
|
||||||
// creating an accordion effect
|
// creating an accordion effect
|
||||||
ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"`
|
ExpandFocusedSidePanel bool `yaml:"expandFocusedSidePanel"`
|
||||||
|
|
||||||
|
// ScreenMode allow user to specify which screen mode will be used on startup
|
||||||
|
ScreenMode string `yaml:"screenMode,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommandTemplatesConfig determines what commands actually get called when we
|
// CommandTemplatesConfig determines what commands actually get called when we
|
||||||
|
|
@ -362,6 +365,7 @@ func GetDefaultConfig() UserConfig {
|
||||||
SidePanelWidth: 0.3333,
|
SidePanelWidth: 0.3333,
|
||||||
ShowBottomLine: true,
|
ShowBottomLine: true,
|
||||||
ExpandFocusedSidePanel: false,
|
ExpandFocusedSidePanel: false,
|
||||||
|
ScreenMode: "normal",
|
||||||
},
|
},
|
||||||
ConfirmOnQuit: false,
|
ConfirmOnQuit: false,
|
||||||
Logs: LogsConfig{
|
Logs: LogsConfig{
|
||||||
|
|
|
||||||
|
|
@ -114,6 +114,19 @@ const (
|
||||||
SCREEN_FULL
|
SCREEN_FULL
|
||||||
)
|
)
|
||||||
|
|
||||||
|
func getScreenMode(config *config.AppConfig) WindowMaximisation {
|
||||||
|
switch config.UserConfig.Gui.ScreenMode {
|
||||||
|
case "normal":
|
||||||
|
return SCREEN_NORMAL
|
||||||
|
case "half":
|
||||||
|
return SCREEN_HALF
|
||||||
|
case "fullscreen":
|
||||||
|
return SCREEN_FULL
|
||||||
|
default:
|
||||||
|
return SCREEN_NORMAL
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// NewGui builds a new gui handler
|
// NewGui builds a new gui handler
|
||||||
func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand *commands.OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*Gui, error) {
|
func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand *commands.OSCommand, tr *i18n.TranslationSet, config *config.AppConfig, errorChan chan error) (*Gui, error) {
|
||||||
initialState := guiState{
|
initialState := guiState{
|
||||||
|
|
@ -126,6 +139,7 @@ func NewGui(log *logrus.Entry, dockerCommand *commands.DockerCommand, oSCommand
|
||||||
ViewStack: []string{},
|
ViewStack: []string{},
|
||||||
|
|
||||||
ShowExitedContainers: true,
|
ShowExitedContainers: true,
|
||||||
|
ScreenMode: getScreenMode(config),
|
||||||
}
|
}
|
||||||
|
|
||||||
gui := &Gui{
|
gui := &Gui{
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue