Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Berg <benjamin@sipsolutions.net>2011-11-06 16:39:06 (GMT)
committer Benjamin Berg <benjamin@sipsolutions.net>2011-11-06 16:39:06 (GMT)
commit4eaac2db60b5bff4d44d4b4498636a6279722679 (patch)
treef9a492facde388ea62b9e7f06fc6323d32a912be
parent555df14710f67373f16d87268be6a4863a16151f (diff)
Add label to menu palettes.
The text is currently not visible, because the text is grayed out.
-rw-r--r--src/sugar3/graphics/palette.py28
1 files changed, 18 insertions, 10 deletions
diff --git a/src/sugar3/graphics/palette.py b/src/sugar3/graphics/palette.py
index 777da19..5eee3a7 100644
--- a/src/sugar3/graphics/palette.py
+++ b/src/sugar3/graphics/palette.py
@@ -60,15 +60,12 @@ class Palette(PaletteWindow):
self._icon_visible = True
self._palette_state = self.PRIMARY
- self._palette_box = Gtk.VBox()
-
- primary_box = Gtk.HBox()
- self._palette_box.pack_start(primary_box, False, True, 0)
- primary_box.show()
+ self._primary_box = Gtk.HBox()
+ self._primary_box.show()
self._icon_box = Gtk.HBox()
self._icon_box.set_size_request(style.GRID_CELL_SIZE, -1)
- primary_box.pack_start(self._icon_box, False, True, 0)
+ self._primary_box.pack_start(self._icon_box, False, True, 0)
labels_box = Gtk.VBox()
self._label_alignment = Gtk.Alignment.new(0, 0.5, 1, 0.33)
@@ -76,7 +73,7 @@ class Palette(PaletteWindow):
style.DEFAULT_SPACING)
self._label_alignment.add(labels_box)
self._label_alignment.show()
- primary_box.pack_start(self._label_alignment, True, True, 0)
+ self._primary_box.pack_start(self._label_alignment, True, True, 0)
labels_box.show()
self._label = Gtk.AccelLabel(label='')
@@ -97,7 +94,6 @@ class Palette(PaletteWindow):
labels_box.pack_start(self._secondary_label, True, True, 0)
self._secondary_box = Gtk.VBox()
- self._palette_box.pack_start(self._secondary_box, True, True, 0)
self._separator = Gtk.HSeparator()
self._secondary_box.pack_start(self._separator, True, True, 0)
@@ -121,8 +117,6 @@ class Palette(PaletteWindow):
self._secondary_box.pack_start(self.action_bar, True, True, 0)
self.action_bar.show()
- self._palette_box.show()
-
self.connect('notify::invoker', self.__notify_invoker_cb)
self.connect('popdown', self.__popdown_cb)
@@ -287,6 +281,11 @@ class Palette(PaletteWindow):
self._widget = _PaletteWindowWidget()
self._setup_widget()
+ self._palette_box = Gtk.VBox()
+ self._palette_box.pack_start(self._primary_box, False, True, 0)
+ self._palette_box.pack_start(self._secondary_box, True, True, 0)
+ self._palette_box.show()
+
self._widget.add(self._palette_box)
if self._content.get_children():
@@ -349,6 +348,15 @@ class Palette(PaletteWindow):
if self._widget is None:
self._widget = _PaletteMenuWidget()
+ self._label_menuitem = Gtk.MenuItem()
+ child = self._label_menuitem.get_child()
+ if child is not None:
+ self._label_menuitem.remove(child)
+ self._label_menuitem.add(self._primary_box)
+ self._label_menuitem.set_sensitive(False)
+ self._label_menuitem.show()
+ self._widget.append(self._label_menuitem)
+
self._setup_widget()
return self._widget