Merge pull request #529 from scottmckendry/master

feat: add 'border' option in config
This commit is contained in:
Jesse Duffield 2024-05-26 13:50:55 +10:00 committed by GitHub
commit ce780b8f6d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 16 additions and 0 deletions

View file

@ -33,6 +33,7 @@ to the top of your config file or via [Visual Studio Code settings.json config][
gui:
scrollHeight: 2
language: 'auto' # one of 'auto' | 'en' | 'pl' | 'nl' | 'de' | 'tr'
border: 'single' # one of 'single' | 'rounded' | 'double' | 'hidden'
theme:
activeBorderColor:
- green

View file

@ -138,6 +138,10 @@ type GuiConfig struct {
// containers panel. "long": full words (default), "short": one or two characters,
// "icon": unicode emoji.
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

View file

@ -92,12 +92,23 @@ func (gui *Gui) orderedViewNameMappings() []viewNameMapping {
}
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
for _, mapping := range gui.orderedViewNameMappings() {
*mapping.viewPtr, err = gui.prepareView(mapping.name)
if err != nil && err.Error() != UNKNOWN_VIEW_ERROR_MSG {
return err
}
(*mapping.viewPtr).FrameRunes = frameRunes
(*mapping.viewPtr).FgColor = gocui.ColorDefault
}