diff options
| author | Jeff Carr <[email protected]> | 2024-01-30 02:38:06 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-01-30 02:38:06 -0600 |
| commit | 4f19c8b64df77d204dfd0fab462f99f4ef5009b7 (patch) | |
| tree | f4da5dadc592e4bc3635e56480efbf15f68f32df /color.go | |
| parent | 50fe92a1b184a12d25fe8f65c1743d6189498501 (diff) | |
disable color works
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'color.go')
| -rw-r--r-- | color.go | 29 |
1 files changed, 28 insertions, 1 deletions
@@ -41,7 +41,14 @@ var superLightGrey gocui.Attribute = gocui.GetColor("#55AAFF") // super light gr // Normal Text On mouseover // // Widget Frame Text background Text background -var colorWindow colorT = colorT{none, gocui.ColorBlue, none, none, powdererBlue, "normal window"} +var colorWindow colorT = colorT { + frame: none, + fg: gocui.ColorBlue, + bg: none, + selFg: none, + selBg: powdererBlue, + name: "normal window", +} var colorActiveW colorT = colorT{none, none, powdererBlue, none, powdererBlue, "active window"} var colorTab colorT = colorT{gocui.ColorBlue, gocui.ColorBlue, none, none, powdererBlue, "normal tab"} @@ -51,6 +58,15 @@ var colorButton colorT = colorT{gocui.ColorGreen, none, gocui.ColorWhite, gocui. var colorLabel colorT = colorT{none, none, superLightGrey, none, superLightGrey, "normal label"} var colorGroup colorT = colorT{none, none, superLightGrey, none, superLightGrey, "normal group"} +var colorDisabled colorT = colorT { + frame: superLightGrey, + fg: superLightGrey, + bg: superLightGrey, + selFg: gocui.ColorBlack, + selBg: gocui.ColorBlack, + name: "disabled widget", +} + // widget debugging colors. these widgets aren't displayed unless you are debugging var colorRoot colorT = colorT{gocui.ColorRed, none, powdererBlue, none, gocui.ColorBlue, "debug root"} var colorFlag colorT = colorT{gocui.ColorRed, none, powdererBlue, none, gocui.ColorGreen, "debug flag"} @@ -83,6 +99,17 @@ func (tk *guiWidget) setColor(newColor *colorT) { tk.recreateView() } +func (w *guiWidget) disableColor() { + if w.color != &colorDisabled { + w.defaultColor = w.color + } + w.setColor(&colorDisabled) +} + +func (w *guiWidget) enableColor() { + w.setColor(w.defaultColor) +} + func (w *guiWidget) setDefaultWidgetColor() { w.showView() } |
