...

Source file src/code.rocketnine.space/tslocum/cview/styles.go

Documentation: code.rocketnine.space/tslocum/cview

     1  package cview
     2  
     3  import "github.com/gdamore/tcell/v2"
     4  
     5  // Theme defines the colors used when primitives are initialized.
     6  type Theme struct {
     7  	// Title, border and other lines
     8  	TitleColor    tcell.Color // Box titles.
     9  	BorderColor   tcell.Color // Box borders.
    10  	GraphicsColor tcell.Color // Graphics.
    11  
    12  	// Text
    13  	PrimaryTextColor           tcell.Color // Primary text.
    14  	SecondaryTextColor         tcell.Color // Secondary text (e.g. labels).
    15  	TertiaryTextColor          tcell.Color // Tertiary text (e.g. subtitles, notes).
    16  	InverseTextColor           tcell.Color // Text on primary-colored backgrounds.
    17  	ContrastPrimaryTextColor   tcell.Color // Primary text for contrasting elements.
    18  	ContrastSecondaryTextColor tcell.Color // Secondary text on ContrastBackgroundColor-colored backgrounds.
    19  
    20  	// Background
    21  	PrimitiveBackgroundColor    tcell.Color // Main background color for primitives.
    22  	ContrastBackgroundColor     tcell.Color // Background color for contrasting elements.
    23  	MoreContrastBackgroundColor tcell.Color // Background color for even more contrasting elements.
    24  
    25  	// Button
    26  	ButtonCursorRune rune // The symbol to draw at the end of button labels when focused.
    27  
    28  	// Check box
    29  	CheckBoxCheckedRune rune
    30  	CheckBoxCursorRune  rune // The symbol to draw within the checkbox when focused.
    31  
    32  	// Context menu
    33  	ContextMenuPaddingTop    int
    34  	ContextMenuPaddingBottom int
    35  	ContextMenuPaddingLeft   int
    36  	ContextMenuPaddingRight  int
    37  
    38  	// Drop down
    39  	DropDownAbbreviationChars string // The chars to show when the option's text gets shortened.
    40  	DropDownSymbol            rune   // The symbol to draw at the end of the field when closed.
    41  	DropDownOpenSymbol        rune   // The symbol to draw at the end of the field when opened.
    42  	DropDownSelectedSymbol    rune   // The symbol to draw to indicate the selected list item.
    43  
    44  	// Scroll bar
    45  	ScrollBarColor tcell.Color
    46  
    47  	// Window
    48  	WindowMinWidth  int
    49  	WindowMinHeight int
    50  }
    51  
    52  // Styles defines the appearance of an application. The default is for a black
    53  // background and some basic colors: black, white, yellow, green, cyan, and
    54  // blue.
    55  var Styles = Theme{
    56  	TitleColor:    tcell.ColorWhite.TrueColor(),
    57  	BorderColor:   tcell.ColorWhite.TrueColor(),
    58  	GraphicsColor: tcell.ColorWhite.TrueColor(),
    59  
    60  	PrimaryTextColor:           tcell.ColorWhite.TrueColor(),
    61  	SecondaryTextColor:         tcell.ColorYellow.TrueColor(),
    62  	TertiaryTextColor:          tcell.ColorLimeGreen.TrueColor(),
    63  	InverseTextColor:           tcell.ColorBlack.TrueColor(),
    64  	ContrastPrimaryTextColor:   tcell.ColorBlack.TrueColor(),
    65  	ContrastSecondaryTextColor: tcell.ColorLightSlateGray.TrueColor(),
    66  
    67  	PrimitiveBackgroundColor:    tcell.ColorBlack.TrueColor(),
    68  	ContrastBackgroundColor:     tcell.ColorGreen.TrueColor(),
    69  	MoreContrastBackgroundColor: tcell.ColorDarkGreen.TrueColor(),
    70  
    71  	ButtonCursorRune: '◀',
    72  
    73  	CheckBoxCheckedRune: 'X',
    74  	CheckBoxCursorRune:  '◀',
    75  
    76  	ContextMenuPaddingTop:    0,
    77  	ContextMenuPaddingBottom: 0,
    78  	ContextMenuPaddingLeft:   1,
    79  	ContextMenuPaddingRight:  1,
    80  
    81  	DropDownAbbreviationChars: "...",
    82  	DropDownSymbol:            '◀',
    83  	DropDownOpenSymbol:        '▼',
    84  	DropDownSelectedSymbol:    '▶',
    85  
    86  	ScrollBarColor: tcell.ColorWhite.TrueColor(),
    87  
    88  	WindowMinWidth:  4,
    89  	WindowMinHeight: 3,
    90  }
    91  

View as plain text