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 /plugin.go | |
| parent | 50fe92a1b184a12d25fe8f65c1743d6189498501 (diff) | |
disable color works
Signed-off-by: Jeff Carr <[email protected]>
Diffstat (limited to 'plugin.go')
| -rw-r--r-- | plugin.go | 37 |
1 files changed, 22 insertions, 15 deletions
@@ -28,6 +28,12 @@ func action(a widget.Action) { me.treeRoot = n } addWidget(n) + w = n.TK.(*guiWidget) + if w.enable { + // don't change the color + } else { + w.setColor(&colorDisabled) + } } else { // this is done to protect the plugin being 'refreshed' with the // widget binary tree. TODO: find a way to keep them in sync @@ -35,10 +41,19 @@ func action(a widget.Action) { a.WidgetId, a.ActionType, a.WidgetType, a.ProgName) } case widget.Show: - if widget.GetBool(a.Value) { - w.showView() + if w.Visible() { + // widget was already shown } else { - w.hideWidgets() + log.Log(INFO, "Setting Visible to true", a.ProgName) + w.SetVisible(true) + } + w.showView() + case widget.Hide: + if w.Visible() { + log.Log(INFO, "Setting Visible to false", a.ProgName) + w.SetVisible(false) + } else { + // widget was already hidden } case widget.Set: if a.WidgetType == widget.Flag { @@ -62,19 +77,11 @@ func action(a widget.Action) { log.Log(NOW, "attempting to close the plugin and release stdout and stderr") standardExit() case widget.Enable: - if w.Visible() { - // widget was already shown - } else { - log.Log(INFO, "Setting Visible to true", a.ProgName) - w.SetVisible(true) - } + w.enable = true + w.enableColor() case widget.Disable: - if w.Visible() { - log.Log(INFO, "Setting Visible to false", a.ProgName) - w.SetVisible(false) - } else { - // widget was already hidden - } + w.enable = false + w.disableColor() case widget.Delete: if w == nil { return |
