diff options
author | Manuel 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) |
commit | b4db4ef06deb4e6b91b8333f1ff79199072e8e99 (patch) | |
tree | 3aa4cc6c6deb360962711314eeb2899e2b679d77 /record.py | |
parent | b5319b5bfd91bb66d26d441b05c52f7af06cd28c (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 'record.py')
-rw-r--r-- | record.py | 33 |
1 files changed, 16 insertions, 17 deletions
@@ -49,6 +49,7 @@ import utils from tray import HTray from mediaview import MediaView import hw +from iconcombobox import IconComboBox logger = logging.getLogger('record.py') COLOR_BLACK = gdk.color_parse('#000000') @@ -880,55 +881,53 @@ class RecordControl(): self.quality.combo.set_active(idx) -class TimerCombo(ToolComboBox): +class TimerCombo(IconComboBox): TIMERS = (0, 5, 10) def __init__(self): - self._combo_box_text = gtk.combo_box_new_text() - super(TimerCombo, self).__init__(combo=self._combo_box_text, label_text=_('Timer:')) + super(TimerCombo, self).__init__('timer') for i in self.TIMERS: if i == 0: - self._combo_box_text.append_text(_('Immediate')) + self.append_item(i, _('Immediate')) else: string = TimerCombo._seconds_string(i) - self._combo_box_text.append_text(string) - self._combo_box_text.set_active(0) + self.append_item(i, string) + self.combo.set_active(0) def get_value(self): - return TimerCombo.TIMERS[self._combo_box_text.get_active()] + return TimerCombo.TIMERS[self.combo.get_active()] def get_value_idx(self): - return self._combo_box_text.get_active() + return self.combo.get_active() def set_value_idx(self, idx): - self._combo_box_text.set_active(idx) + self.combo.set_active(idx) @staticmethod def _seconds_string(x): return ngettext('%s second', '%s seconds', x) % x -class DurationCombo(ToolComboBox): +class DurationCombo(IconComboBox): DURATIONS = (2, 4, 6) def __init__(self): - self._combo_box_text = gtk.combo_box_new_text() - super(DurationCombo, self).__init__(combo=self._combo_box_text, label_text=_('Duration:')) + super(DurationCombo, self).__init__('duration') for i in self.DURATIONS: string = DurationCombo._minutes_string(i) - self._combo_box_text.append_text(string) - self._combo_box_text.set_active(0) + self.append_item(i, string) + self.combo.set_active(0) def get_value(self): - return 60 * self.DURATIONS[self._combo_box_text.get_active()] + return 60 * self.DURATIONS[self.combo.get_active()] def get_value_idx(self): - return self._combo_box_text.get_active() + return self.combo.get_active() def set_value_idx(self, idx): - self._combo_box_text.set_active(idx) + self.combo.set_active(idx) @staticmethod def _minutes_string(x): |