| 🛟 Updated. 28d5985 k33g 16h ago | 1 | // Package theme turns TOML colour files into the tcell styles the editor |
| 2 | // draws with. |
| 3 | // |
| 4 | // A theme is a flat map from a dotted style key, such as "syntax.keyword", to |
| 5 | // a foreground colour, a background colour and a few attributes. Lookups fall |
| 6 | // back along the dots, so a theme that only defines "syntax" still colours |
| 7 | // every token, and one that defines nothing still renders. |
| 8 | // |
| 9 | // Themes ship embedded in the binary and are also read from the user's |
| 10 | // configuration directory, where a file of the same name wins. |
| 11 | package theme |
| 12 | |
| 13 | // The style keys the editor asks for. A theme need not define them all: |
| 14 | // Style falls back along the dots and finally onto KeyDefault, so a partial |
| 15 | // theme is a usable theme. |
| 16 | // |
| 17 | // Keys are grouped by the widget that draws with them. Adding a widget means |
| 18 | // adding its keys here, so that this list stays the single description of what |
| 19 | // a theme file may contain. |
| 20 | const ( |
| 21 | // KeyDefault is the last resort of every lookup. |
| 22 | KeyDefault = "default" |
| 23 | |
| 24 | // The desktop is the patterned backdrop behind every window. |
| 25 | KeyDesktop = "desktop" |
| 26 | // KeyShadow is the dimmed cells a window casts to its bottom right. |
| 27 | KeyShadow = "shadow" |
| 28 | |
| 29 | KeyMenuBar = "menu.bar" |
| 30 | KeyMenuItem = "menu.item" |
| 31 | KeyMenuSelected = "menu.selected" |
| 32 | KeyMenuShortcut = "menu.shortcut" |
| 33 | KeyMenuDisabled = "menu.disabled" |
| 34 | |
| 35 | KeyWindowFrameActive = "window.frame.active" |
| 36 | KeyWindowFrameInactive = "window.frame.inactive" |
| 37 | KeyWindowTitleActive = "window.title.active" |
| 38 | KeyWindowTitleInactive = "window.title.inactive" |
| 39 | KeyWindowBody = "window.body" |
| 40 | |
| 41 | KeyStatusBar = "statusbar" |
| 42 | KeyStatusBarKey = "statusbar.key" |
| 43 | KeyStatusBarHint = "statusbar.hint" |
| 44 | KeyScrollBar = "scrollbar" |
| 45 | KeyScrollBarThumb = "scrollbar.thumb" |
| 46 | |
| 47 | KeyDialogFrame = "dialog.frame" |
| 48 | KeyDialogBody = "dialog.body" |
| 49 | KeyDialogTitle = "dialog.title" |
| 50 | KeyDialogLabel = "dialog.label" |
| 51 | |
| 52 | KeyButton = "button" |
| 53 | KeyButtonFocused = "button.focused" |
| 54 | KeyButtonShortcut = "button.shortcut" |
| 55 | KeyInput = "input" |
| 56 | KeyInputFocused = "input.focused" |
| 57 | KeyInputSelection = "input.selection" |
| 58 | KeyList = "list" |
| 59 | KeyListSelected = "list.selected" |
| 60 | KeyListUnfocused = "list.unfocused" |
| 61 | KeyCheckbox = "checkbox" |
| 62 | KeyCheckboxFocused = "checkbox.focused" |
| 63 | |
| 64 | KeyEditorText = "editor.text" |
| 65 | KeyEditorSelection = "editor.selection" |
| 66 | KeyEditorLineNumber = "editor.linenumber" |
| 67 | KeyEditorCurrent = "editor.currentline" |
| 68 | // KeyEditorCursor colours the cell the cursor is on. It must contrast with |
| 69 | // editor.currentline whichever way round the terminal draws its own cursor. |
| 70 | KeyEditorCursor = "editor.cursor" |
| 71 | |
| 72 | // KeyTerminalText is the default colour of a terminal window's contents, |
| 73 | // used wherever the program running in it has asked for none of its own. |
| 74 | KeyTerminalText = "terminal.text" |
| 75 | // KeyTerminalCursor colours the cell the shell's cursor is on. |
| 76 | KeyTerminalCursor = "terminal.cursor" |
| 77 | |
| 78 | // KeyTreeText is a file's name in a project tree, and the tree's own |
| 79 | // background. |
| 80 | KeyTreeText = "tree.text" |
| 81 | // KeyTreeDirectory is a directory's name, which wants to stand out from |
| 82 | // the files beside it. |
| 83 | KeyTreeDirectory = "tree.directory" |
| 84 | // KeyTreeSelected is the highlighted row of a focused tree. It cannot be |
| 85 | // borrowed from the list group: a dialog's list sits on a dialog, and |
| 86 | // list.selected is coloured to stand out against that rather than against |
| 87 | // a window's body. |
| 88 | KeyTreeSelected = "tree.selected" |
| 89 | // KeyTreeUnfocused is the highlighted row of a tree that does not have the |
| 90 | // keyboard, so a screenful of windows still says where typing would go. |
| 91 | KeyTreeUnfocused = "tree.unfocused" |
| 92 | |
| 93 | KeySyntaxKeyword = "syntax.keyword" |
| 94 | KeySyntaxType = "syntax.type" |
| 95 | KeySyntaxBuiltin = "syntax.builtin" |
| 96 | KeySyntaxConstant = "syntax.constant" |
| 97 | KeySyntaxFunction = "syntax.function" |
| 98 | KeySyntaxString = "syntax.string" |
| 99 | KeySyntaxChar = "syntax.char" |
| 100 | KeySyntaxNumber = "syntax.number" |
| 101 | KeySyntaxComment = "syntax.comment" |
| 102 | KeySyntaxOperator = "syntax.operator" |
| 103 | KeySyntaxPunctuation = "syntax.punctuation" |
| 104 | KeySyntaxIdentifier = "syntax.identifier" |
| 105 | |
| 106 | // The classes that only the markup languages produce. Go has nothing that |
| 107 | // reads as a heading or a tag, so these appear in Markdown and HTML only. |
| 108 | KeySyntaxHeading = "syntax.heading" |
| 109 | KeySyntaxTag = "syntax.tag" |
| 110 | KeySyntaxAttribute = "syntax.attribute" |
| 111 | KeySyntaxEmphasis = "syntax.emphasis" |
| 112 | KeySyntaxLink = "syntax.link" |
| 113 | |
| 114 | KeyCompletionFrame = "completion.frame" |
| 115 | KeyCompletionItem = "completion.item" |
| 116 | KeyCompletionSelected = "completion.selected" |
| 117 | KeyCompletionDetail = "completion.detail" |
| 118 | |
| 119 | KeyDiagnosticError = "diagnostic.error" |
| 120 | KeyDiagnosticWarning = "diagnostic.warning" |
| 121 | KeyDiagnosticInfo = "diagnostic.info" |
| 122 | ) |