[node-patches] Change in ovirt-node[master]: tui: Make Options label stylable

fabiand at fedoraproject.org fabiand at fedoraproject.org
Tue Dec 11 20:09:36 UTC 2012


Fabian Deutsch has uploaded a new change for review.

Change subject: tui: Make Options label stylable
......................................................................

tui: Make Options label stylable

Change-Id: Idb4d08fdfabe13f9400dbf3dcad52dfded1a3f6c
Signed-off-by: Fabian Deutsch <fabiand at fedoraproject.org>
---
M scripts/tui/src/ovirt/node/tui.py
M scripts/tui/src/ovirt/node/ui/widgets.py
2 files changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/02/9902/1

diff --git a/scripts/tui/src/ovirt/node/tui.py b/scripts/tui/src/ovirt/node/tui.py
index 51f6793..c32de79 100644
--- a/scripts/tui/src/ovirt/node/tui.py
+++ b/scripts/tui/src/ovirt/node/tui.py
@@ -75,6 +75,7 @@
                ('plugin.widget.progressbar.box', 'light gray', ''),
                ('plugin.widget.progressbar.uncomplete', '', ''),
                ('plugin.widget.progressbar.complete', '', 'light gray'),
+               ('plugin.widget.options.label', 'dark gray, bold', ''),
                ]
 
     def __init__(self, app):
diff --git a/scripts/tui/src/ovirt/node/ui/widgets.py b/scripts/tui/src/ovirt/node/ui/widgets.py
index 979b7fc..41a0aa0 100644
--- a/scripts/tui/src/ovirt/node/ui/widgets.py
+++ b/scripts/tui/src/ovirt/node/ui/widgets.py
@@ -352,11 +352,16 @@
 class Options(urwid.WidgetWrap):
     signals = ["change"]
 
+    _label_attr = "plugin.widget.options.label"
+
     def __init__(self, label, options, selected_option_key):
         self._options = options
         self._button_to_key = {}
         self._bgroup = []
-        self._buttons = [urwid.Text(label + ":")]
+        self._label = urwid.Text(label + ":")
+        self._label_attrmap = urwid.AttrMap(self._label, self._label_attr)
+
+        self._buttons = []
         for option_key, option_label in self._options:
             widget = urwid.RadioButton(self._bgroup, option_label,
                                        on_state_change=self._on_state_change)
@@ -364,7 +369,7 @@
             if option_key == selected_option_key:
                 widget.set_state(True)
             self._buttons.append(widget)
-        self._columns = urwid.Columns(self._buttons)
+        self._columns = urwid.Columns([self._label_attrmap] + self._buttons)
         self._pile = urwid.Pile([urwid.Divider(), self._columns,
                                  urwid.Divider()])
         super(Options, self).__init__(self._pile)


--
To view, visit http://gerrit.ovirt.org/9902
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idb4d08fdfabe13f9400dbf3dcad52dfded1a3f6c
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: master
Gerrit-Owner: Fabian Deutsch <fabiand at fedoraproject.org>



More information about the node-patches mailing list