2019-12-30 23:12:17 +00:00
|
|
|
package cview
|
2018-01-10 08:43:32 +00:00
|
|
|
|
2020-08-30 15:36:03 +00:00
|
|
|
import "github.com/gdamore/tcell/v2"
|
2018-01-10 08:43:32 +00:00
|
|
|
|
2019-03-09 13:04:59 +00:00
|
|
|
// Theme defines the colors used when primitives are initialized.
|
2018-12-05 17:17:01 +00:00
|
|
|
type Theme struct {
|
2020-04-19 03:00:36 +00:00
|
|
|
// Title, border and other lines
|
|
|
|
TitleColor tcell.Color // Box titles.
|
|
|
|
BorderColor tcell.Color // Box borders.
|
|
|
|
GraphicsColor tcell.Color // Graphics.
|
|
|
|
|
|
|
|
// Text
|
|
|
|
PrimaryTextColor tcell.Color // Primary text.
|
|
|
|
SecondaryTextColor tcell.Color // Secondary text (e.g. labels).
|
|
|
|
TertiaryTextColor tcell.Color // Tertiary text (e.g. subtitles, notes).
|
|
|
|
InverseTextColor tcell.Color // Text on primary-colored backgrounds.
|
2020-09-16 18:33:02 +00:00
|
|
|
ContrastPrimaryTextColor tcell.Color // Primary text for contrasting elements.
|
2020-04-19 03:00:36 +00:00
|
|
|
ContrastSecondaryTextColor tcell.Color // Secondary text on ContrastBackgroundColor-colored backgrounds.
|
|
|
|
|
|
|
|
// Background
|
2018-01-10 08:43:32 +00:00
|
|
|
PrimitiveBackgroundColor tcell.Color // Main background color for primitives.
|
|
|
|
ContrastBackgroundColor tcell.Color // Background color for contrasting elements.
|
|
|
|
MoreContrastBackgroundColor tcell.Color // Background color for even more contrasting elements.
|
2020-04-19 03:00:36 +00:00
|
|
|
|
2021-06-05 17:24:43 +00:00
|
|
|
// Button
|
|
|
|
ButtonCursorRune rune // The symbol to draw at the end of button labels when focused.
|
|
|
|
|
2020-09-16 12:48:36 +00:00
|
|
|
// Check box
|
|
|
|
CheckBoxCheckedRune rune
|
2021-06-05 17:24:43 +00:00
|
|
|
CheckBoxCursorRune rune // The symbol to draw within the checkbox when focused.
|
2020-09-17 10:00:05 +00:00
|
|
|
|
2020-09-24 15:09:55 +00:00
|
|
|
// Context menu
|
|
|
|
ContextMenuPaddingTop int
|
|
|
|
ContextMenuPaddingBottom int
|
|
|
|
ContextMenuPaddingLeft int
|
|
|
|
ContextMenuPaddingRight int
|
|
|
|
|
2020-09-17 10:00:05 +00:00
|
|
|
// Drop down
|
|
|
|
DropDownAbbreviationChars string // The chars to show when the option's text gets shortened.
|
2021-06-05 03:35:34 +00:00
|
|
|
DropDownSymbol rune // The symbol to draw at the end of the field when closed.
|
|
|
|
DropDownOpenSymbol rune // The symbol to draw at the end of the field when opened.
|
2020-09-24 15:09:55 +00:00
|
|
|
|
|
|
|
// Scroll bar
|
|
|
|
ScrollBarColor tcell.Color
|
|
|
|
|
|
|
|
// Window
|
|
|
|
WindowMinWidth int
|
|
|
|
WindowMinHeight int
|
2018-12-05 17:17:01 +00:00
|
|
|
}
|
|
|
|
|
2020-05-15 23:17:41 +00:00
|
|
|
// Styles defines the appearance of an application. The default is for a black
|
2019-03-09 13:04:59 +00:00
|
|
|
// background and some basic colors: black, white, yellow, green, cyan, and
|
|
|
|
// blue.
|
2018-12-05 17:17:01 +00:00
|
|
|
var Styles = Theme{
|
2020-08-30 15:36:03 +00:00
|
|
|
TitleColor: tcell.ColorWhite.TrueColor(),
|
|
|
|
BorderColor: tcell.ColorWhite.TrueColor(),
|
|
|
|
GraphicsColor: tcell.ColorWhite.TrueColor(),
|
2020-04-19 03:00:36 +00:00
|
|
|
|
2020-08-30 15:36:03 +00:00
|
|
|
PrimaryTextColor: tcell.ColorWhite.TrueColor(),
|
|
|
|
SecondaryTextColor: tcell.ColorYellow.TrueColor(),
|
2021-06-04 03:40:23 +00:00
|
|
|
TertiaryTextColor: tcell.ColorLimeGreen.TrueColor(),
|
2021-05-31 01:17:17 +00:00
|
|
|
InverseTextColor: tcell.ColorBlack.TrueColor(),
|
2020-09-16 18:33:02 +00:00
|
|
|
ContrastPrimaryTextColor: tcell.ColorBlack.TrueColor(),
|
2021-05-31 04:05:31 +00:00
|
|
|
ContrastSecondaryTextColor: tcell.ColorLightSlateGray.TrueColor(),
|
2020-04-19 03:00:36 +00:00
|
|
|
|
2020-08-30 15:36:03 +00:00
|
|
|
PrimitiveBackgroundColor: tcell.ColorBlack.TrueColor(),
|
2021-06-05 03:35:34 +00:00
|
|
|
ContrastBackgroundColor: tcell.ColorGreen.TrueColor(),
|
|
|
|
MoreContrastBackgroundColor: tcell.ColorDarkGreen.TrueColor(),
|
2020-08-30 15:36:03 +00:00
|
|
|
|
2021-06-05 17:24:43 +00:00
|
|
|
ButtonCursorRune: '◀',
|
|
|
|
|
2020-09-24 15:09:55 +00:00
|
|
|
CheckBoxCheckedRune: 'X',
|
2021-06-05 17:24:43 +00:00
|
|
|
CheckBoxCursorRune: '◀',
|
2020-04-19 03:00:36 +00:00
|
|
|
|
|
|
|
ContextMenuPaddingTop: 0,
|
|
|
|
ContextMenuPaddingBottom: 0,
|
|
|
|
ContextMenuPaddingLeft: 1,
|
|
|
|
ContextMenuPaddingRight: 1,
|
2020-09-16 12:48:36 +00:00
|
|
|
|
2020-09-17 10:00:05 +00:00
|
|
|
DropDownAbbreviationChars: "...",
|
2021-06-05 03:35:34 +00:00
|
|
|
DropDownSymbol: '◀',
|
|
|
|
DropDownOpenSymbol: '▼',
|
2020-09-24 15:09:55 +00:00
|
|
|
|
|
|
|
ScrollBarColor: tcell.ColorWhite.TrueColor(),
|
|
|
|
|
|
|
|
WindowMinWidth: 4,
|
|
|
|
WindowMinHeight: 3,
|
2018-01-10 08:43:32 +00:00
|
|
|
}
|