mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-24 16:11:04 +00:00
feat: support for different border styles
This commit is contained in:
parent
80af149b02
commit
dbf2bced5e
2 changed files with 15 additions and 0 deletions
|
|
@ -138,6 +138,10 @@ type GuiConfig struct {
|
||||||
// containers panel. "long": full words (default), "short": one or two characters,
|
// containers panel. "long": full words (default), "short": one or two characters,
|
||||||
// "icon": unicode emoji.
|
// "icon": unicode emoji.
|
||||||
ContainerStatusHealthStyle string `yaml:"containerStatusHealthStyle"`
|
ContainerStatusHealthStyle string `yaml:"containerStatusHealthStyle"`
|
||||||
|
|
||||||
|
// Window border style.
|
||||||
|
// One of 'single' (default) | 'rounded' | 'double' | 'hidden'
|
||||||
|
Border string `yaml:"border"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// CommandTemplatesConfig determines what commands actually get called when we
|
// CommandTemplatesConfig determines what commands actually get called when we
|
||||||
|
|
|
||||||
|
|
@ -92,12 +92,23 @@ func (gui *Gui) orderedViewNameMappings() []viewNameMapping {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (gui *Gui) createAllViews() error {
|
func (gui *Gui) createAllViews() error {
|
||||||
|
frameRunes := []rune{'─', '│', '┌', '┐', '└', '┘'}
|
||||||
|
switch gui.Config.UserConfig.Gui.Border {
|
||||||
|
case "double":
|
||||||
|
frameRunes = []rune{'═', '║', '╔', '╗', '╚', '╝'}
|
||||||
|
case "rounded":
|
||||||
|
frameRunes = []rune{'─', '│', '╭', '╮', '╰', '╯'}
|
||||||
|
case "hidden":
|
||||||
|
frameRunes = []rune{' ', ' ', ' ', ' ', ' ', ' '}
|
||||||
|
}
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
for _, mapping := range gui.orderedViewNameMappings() {
|
for _, mapping := range gui.orderedViewNameMappings() {
|
||||||
*mapping.viewPtr, err = gui.prepareView(mapping.name)
|
*mapping.viewPtr, err = gui.prepareView(mapping.name)
|
||||||
if err != nil && err.Error() != UNKNOWN_VIEW_ERROR_MSG {
|
if err != nil && err.Error() != UNKNOWN_VIEW_ERROR_MSG {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
(*mapping.viewPtr).FrameRunes = frameRunes
|
||||||
(*mapping.viewPtr).FgColor = gocui.ColorDefault
|
(*mapping.viewPtr).FgColor = gocui.ColorDefault
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue