From 470eb6ae2d64d25744d78116fc8865ea00f3c0ad Mon Sep 17 00:00:00 2001 From: Aleksey Lim Date: Wed, 03 Jun 2009 22:38:31 +0000 Subject: Tamtam Mini control bars get really small #924 #285 --- (limited to 'common') diff --git a/common/Tooltips.py b/common/Tooltips.py index e59e88d..42511c2 100644 --- a/common/Tooltips.py +++ b/common/Tooltips.py @@ -118,11 +118,6 @@ class Tooltips: COMPL = _('Complexity of beat') BEAT = _('Beats per bar') TEMPO = _('Tempo') - JAZZ = _('Jazz / Rock Kit') - AFRI = _('African Kit') - ARAB = _('Arabic Kit') - BRES = _('South American Kit') - ELEC = _('Electronic Kit') RECMIC = _('Record with the microphone') RECLAB = _('Open SynthLab to create noise') MT_RECORDBUTTONS = [_('Record mic into slot 1'), _('Record mic into slot 2'), _('Record mic into slot 3'), _('Record mic into slot 4')] diff --git a/common/Util/Instruments.py b/common/Util/Instruments.py index 1bbf8b5..83def45 100644 --- a/common/Util/Instruments.py +++ b/common/Util/Instruments.py @@ -1,4 +1,6 @@ import os +from gettext import gettext as _ + import common.Config as Config import common.Util.InstrumentDB as InstrumentDB from sugar.activity.activity import get_bundle_name @@ -295,3 +297,13 @@ _addInstrument( "drum3kit", 0, 0, "percussions", 0, 0, 0, 1, DRUM3KIT ) _addInstrument( "drum4kit", 0, 0, "percussions", 0, 0, 0, 1, DRUM4KIT ) _addInstrument( "drum5kit", 0, 0, "percussions", 0, 0, 0, 1, DRUM5KIT ) _addInstrument( "drum6kit", 0, 0, "percussions", 0, 0, 0, 1, DRUM6KIT ) + +DRUMTIPS = [ + _('Jazz / Rock Kit'), + _('African Kit'), + _('Arabic Kit'), + _('South American Kit'), + _('Electronic Kit'), + _('Nepali') ] + +DRUMCOUNT = 6 diff --git a/common/port/scrolledbox.py b/common/port/scrolledbox.py index 0ed8e36..db38b51 100644 --- a/common/port/scrolledbox.py +++ b/common/port/scrolledbox.py @@ -40,6 +40,7 @@ class ScrolledBox(gtk.EventBox): self._aviewport = None self._aviewport_sig = None self._arrows_policy = arrows_policy + self._scroll_policy = scroll_policy self._left = None self._right = None @@ -56,7 +57,8 @@ class ScrolledBox(gtk.EventBox): self._left = ScrollButton('go-left') else: self._left = ScrollButton('go-up') - self._left.connect('clicked', self._scroll_cb, 'left') + self._left.connect('clicked', self._scroll_cb, + gtk.gdk.SCROLL_LEFT) box.pack_start(self._left, False, False, 0) self._scrolled = gtk.ScrolledWindow() @@ -79,7 +81,8 @@ class ScrolledBox(gtk.EventBox): self._right = ScrollButton('go-right') else: self._right = ScrollButton('go-down') - self._right.connect('clicked', self._scroll_cb, 'right') + self._right.connect('clicked', self._scroll_cb, + gtk.gdk.SCROLL_RIGHT) box.pack_start(self._right, False, False, 0) def modify_fg(self, state, bg): @@ -144,10 +147,14 @@ class ScrolledBox(gtk.EventBox): event.direction = gtk.gdk.SCROLL_UP if event.direction == gtk.gdk.SCROLL_RIGHT: event.direction = gtk.gdk.SCROLL_DOWN + + if self._scroll_policy == gtk.POLICY_NEVER: + self._scroll_cb(None, event.direction) + return False - def _scroll_cb(self, widget, data): - if data == 'left': + def _scroll_cb(self, widget, direction): + if direction in (gtk.gdk.SCROLL_LEFT, gtk.gdk.SCROLL_UP): val = max(self._adj.get_property('lower'), self._adj.get_value() - self._adj.get_property('page_increment')) else: -- cgit v0.9.1