Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/iconcombobox.py
diff options
context:
space:
mode:
authorManuel QuiƱones <manuel.por.aca@gmail.com>2011-07-22 22:34:59 (GMT)
committer Daniel Drake <dsd@laptop.org>2011-07-22 22:41:33 (GMT)
commitb4db4ef06deb4e6b91b8333f1ff79199072e8e99 (patch)
tree3aa4cc6c6deb360962711314eeb2899e2b679d77 /iconcombobox.py
parentb5319b5bfd91bb66d26d441b05c52f7af06cd28c (diff)
Use icons for timer/duration selection (SL#2972)
These strings were too long; in Spanish the Stop button was pushed off the end of the toolbar. Replace them with icons for compactness, based on input from the design team. It would be nicer to have these icons only showing in the unexpanded rendering of the comboboxes, but this does not seem possible: http://lists.sugarlabs.org/archive/sugar-devel/2011-July/032363.html
Diffstat (limited to 'iconcombobox.py')
-rw-r--r--iconcombobox.py40
1 files changed, 40 insertions, 0 deletions
diff --git a/iconcombobox.py b/iconcombobox.py
new file mode 100644
index 0000000..01ce5f9
--- /dev/null
+++ b/iconcombobox.py
@@ -0,0 +1,40 @@
+#Copyright (c) 2011 One Laptop per Child
+
+#Permission is hereby granted, free of charge, to any person obtaining a copy
+#of this software and associated documentation files (the "Software"), to deal
+#in the Software without restriction, including without limitation the rights
+#to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+#copies of the Software, and to permit persons to whom the Software is
+#furnished to do so, subject to the following conditions:
+
+#The above copyright notice and this permission notice shall be included in
+#all copies or substantial portions of the Software.
+
+#THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+#IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+#FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+#AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+#LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+#OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+#THE SOFTWARE.
+
+import gtk
+
+from sugar.graphics.combobox import ComboBox
+from sugar.graphics import style
+
+
+class IconComboBox(gtk.ToolItem):
+ def __init__(self, icon_name, **kwargs):
+ gtk.ToolItem.__init__(self, **kwargs)
+
+ self.icon_name = icon_name
+ self.set_border_width(style.DEFAULT_PADDING)
+
+ self.combo = ComboBox()
+ self.combo.show()
+
+ self.add(self.combo)
+
+ def append_item(self, i, text):
+ self.combo.append_item(i, text, icon_name=self.icon_name)