Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Jam/Toolbars.py
diff options
context:
space:
mode:
authorWalter Bender <walter.bender@gmail.com>2011-07-31 22:16:41 (GMT)
committer Aleksey Lim <alsroot@sugarlabs.org>2011-07-31 22:34:59 (GMT)
commite2d511e81772ac8ae69a8a664f03d9d576e0c26a (patch)
tree97386075e0561651dd1de062fa773b05d5e084ed /Jam/Toolbars.py
parent97c158551a2d289772a67d29c062d0a90282a5da (diff)
moving playback buttons to main toolbar to make room for more beats
The playback toolbar cannot properly handle all of the beats when the run on smaller displays. This patch moves the playback button and mute button to the main toolbar to make room for more beats. (In the case of the old-style toolbars, the beat buttons are moved to a new toolbar, aptly named "beats"). Somewhat alleviates the problem, but 12 beats still does not fit on an 800x600 screen. Still awaiting a icon for the beats toolbar.
Diffstat (limited to 'Jam/Toolbars.py')
-rw-r--r--Jam/Toolbars.py54
1 files changed, 29 insertions, 25 deletions
diff --git a/Jam/Toolbars.py b/Jam/Toolbars.py
index 3b2f32f..d33e0ae 100644
--- a/Jam/Toolbars.py
+++ b/Jam/Toolbars.py
@@ -141,6 +141,24 @@ class JamToolbar(gtk.Toolbar):
self.owner.sendSyncQuery()
+def common_playback_buttons(toolbar, owner):
+ """ Playback and mute buttons are either on the main toolbar or
+ the Playback toolbar, depending upon whether or not the new
+ toolbars are available. """
+
+ toolbar.stopButton = ToolButton('media-playback-stop')
+ toolbar.stopButton.connect('clicked', owner.handleStopButton)
+ toolbar.insert(toolbar.stopButton, -1)
+ toolbar.stopButton.show()
+ toolbar.stopButton.set_tooltip(_('Stop Loops'))
+
+ toolbar.muteButton = ToggleToolButton('mute')
+ toolbar.muteButton.connect('clicked', owner.handleMuteButton)
+ toolbar.insert(toolbar.muteButton, -1)
+ toolbar.muteButton.show()
+ toolbar.muteButton.set_tooltip(_('Mute Loops'))
+
+
class PlaybackToolbar(gtk.Toolbar):
def __init__(self, owner):
@@ -150,17 +168,18 @@ class PlaybackToolbar(gtk.Toolbar):
self.toolItem = {}
- self.stopButton = ToolButton('media-playback-stop')
- self.stopButton.connect('clicked', self.handleStopButton)
- self.insert(self.stopButton, -1)
- self.stopButton.show()
- self.stopButton.set_tooltip(_('Stop Loops'))
+ common_playback_buttons(self, owner)
+
+ self.show_all()
- self.muteButton = ToggleToolButton('mute')
- self.muteButton.connect('clicked', self.handleMuteButton)
- self.insert(self.muteButton, -1)
- self.muteButton.show()
- self.muteButton.set_tooltip(_('Mute Loops'))
+class BeatToolbar(gtk.Toolbar):
+
+ def __init__(self, owner):
+ gtk.Toolbar.__init__(self)
+
+ self.owner = owner
+
+ self.toolItem = {}
self._insert_separator(True)
@@ -249,21 +268,6 @@ class PlaybackToolbar(gtk.Toolbar):
self.owner._setSyncBeats(beats)
- def handleStopButton(self, widget):
- self.owner.setStopped()
-
- def setMuted(self, muted):
- if self.muteButton.get_active() == muted:
- return
-
- self.muteButton.set_active(muted)
-
- def handleMuteButton(self, widget):
- if widget.get_active():
- self.owner._setMuted(True)
- else:
- self.owner._setMuted(False)
-
class DesktopToolbar(gtk.Toolbar):