Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorAleksey Lim <alsroot@member.fsf.org>2009-06-03 22:38:31 (GMT)
committer Aleksey Lim <alsroot@member.fsf.org>2009-06-03 22:38:31 (GMT)
commit470eb6ae2d64d25744d78116fc8865ea00f3c0ad (patch)
tree21bcf1e50b44555a739c3405ed2847411490714c /common
parentf9e90e8225b828975350f1d528234b1df6b1238e (diff)
Tamtam Mini control bars get really small #924 #285
Diffstat (limited to 'common')
-rw-r--r--common/Tooltips.py5
-rw-r--r--common/Util/Instruments.py12
-rw-r--r--common/port/scrolledbox.py15
3 files changed, 23 insertions, 9 deletions
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: