diff options
author | amartin <olpc@xo-00-CE-12.localdomain> | 2007-06-29 16:20:39 (GMT) |
---|---|---|
committer | amartin <olpc@xo-00-CE-12.localdomain> | 2007-06-29 16:20:39 (GMT) |
commit | c43ee6f6f73b0f579df2b0e2a53552ba78cd1a72 (patch) | |
tree | 2e1a8002b15f0efd832c7b270258c8b23aaad102 /Edit | |
parent | 79f52b3e1696d345cc2ecdc1235f7c830a5a2fa6 (diff) |
page properties
Diffstat (limited to 'Edit')
-rw-r--r-- | Edit/MainWindow.py | 12 | ||||
-rw-r--r-- | Edit/Properties.py | 22 |
2 files changed, 19 insertions, 15 deletions
diff --git a/Edit/MainWindow.py b/Edit/MainWindow.py index e6d7118..6e4a902 100644 --- a/Edit/MainWindow.py +++ b/Edit/MainWindow.py @@ -1069,13 +1069,13 @@ class MainWindow( SubActivity ): balloc = self.GUI["2contextBox"].get_allocation() walloc = self.GUI["9propertiesPopup"].get_allocation() if walloc.height != 1: # hack to deal with showing the window before first allocation T_T - self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0], balloc.y - walloc.height + winLoc[1] ) + self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0] - 30, balloc.y - walloc.height + winLoc[1] ) else: self.GUI["9propertiesPopup"].move(0, 2048) # off the screen self.GUI["9propertiesPopup"].show() if walloc.height == 1: walloc = self.GUI["9propertiesPopup"].get_allocation() - self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0], balloc.y - walloc.height + winLoc[1] ) + self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0] - 30, balloc.y - walloc.height + winLoc[1] ) else: self.GUI["9propertiesPopup"].hide() @@ -1202,13 +1202,13 @@ class MainWindow( SubActivity ): balloc = self.GUI["2contextBox"].get_allocation() walloc = self.GUI["9propertiesPopup"].get_allocation() if walloc.height != 1: # hack to make deal with showing the window before first allocation T_T - self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0], balloc.y - walloc.height + winLoc[1] ) + self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0] - 30, balloc.y - walloc.height + winLoc[1] ) else: self.GUI["9propertiesPopup"].move(0, 2048) # off the screen self.GUI["9propertiesPopup"].show() if walloc.height == 1: walloc = self.GUI["9propertiesPopup"].get_allocation() - self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0], balloc.y - walloc.height + winLoc[1] ) + self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0] - 30, balloc.y - walloc.height + winLoc[1] ) else: self.GUI["9propertiesPopup"].hide() @@ -1294,13 +1294,13 @@ class MainWindow( SubActivity ): balloc = self.GUI["2contextBox"].get_allocation() walloc = self.GUI["9propertiesPopup"].get_allocation() if walloc.height != 1: # hack to make deal with showing the window before first allocation T_T - self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0], balloc.y - walloc.height + winLoc[1] ) + self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0] - 100, balloc.y - walloc.height + winLoc[1] ) else: self.GUI["9propertiesPopup"].move(0, 2048) # off the screen self.GUI["9propertiesPopup"].show() if walloc.height == 1: walloc = self.GUI["9propertiesPopup"].get_allocation() - self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0], balloc.y - walloc.height + winLoc[1] ) + self.GUI["9propertiesPopup"].move( balloc.x + winLoc[0] - 100, balloc.y - walloc.height + winLoc[1] ) else: self.GUI["9propertiesPopup"].hide() diff --git a/Edit/Properties.py b/Edit/Properties.py index 0913966..7e64b4b 100644 --- a/Edit/Properties.py +++ b/Edit/Properties.py @@ -61,18 +61,20 @@ class Properties( gtk.VBox ): beatBox = gtk.VBox() self.beatAdjust = gtk.Adjustment( 4, 2, 12, 1, 1, 0) self.GUI['beatSlider'] = ImageVScale( Config.TAM_TAM_ROOT + "/Resources/Images/sliderEditVolume.png", self.beatAdjust, 7 ) - self.beatAdjust.connect("value-changed", self.handleBeat) + self.GUI['beatSlider'].connect("button-release-event", self.handleBeat) self.GUI['beatSlider'].set_snap( 1 ) self.GUI['beatSlider'].set_inverted(True) self.GUI['beatSlider'].set_size_request(50, 200) beatBox.pack_start( self.GUI['beatSlider'] ) self.beatLabel = gtk.Image() self.beatLabel.set_from_file(Config.IMAGE_ROOT + 'volume3.png') - self.handleBeat( self.beatAdjust ) + self.beatAdjust.connect("value-changed", self.updateBeatLabel) + self.updateBeatLabel( self.beatAdjust ) beatBox.pack_start( self.beatLabel ) self.pageBox.pack_start( beatBox ) colorBox = gtk.VBox() self.GUI["color0Button"] = ImageRadioButton( None, Config.IMAGE_ROOT+"pageThumbnailBut0.png", Config.IMAGE_ROOT+"pageThumbnailBut0Down.png", backgroundFill = Config.PANEL_COLOR ) + self.GUI["color0Button"].set_size_request( 80, -1 ) self.GUI["color0Button"].connect( "clicked", self.handleColor, 0 ) colorBox.pack_start( self.GUI["color0Button"] ) self.GUI["color1Button"] = ImageRadioButton( self.GUI["color0Button"], Config.IMAGE_ROOT+"pageThumbnailBut1.png", Config.IMAGE_ROOT+"pageThumbnailBut1Down.png", backgroundFill = Config.PANEL_COLOR ) @@ -436,15 +438,17 @@ class Properties( gtk.VBox ): if len(stream): self.noteDB.updatePages( [ PARAMETER.PAGE_COLOR, len(stream)//2 ] + stream ) - def handleBeat( self, adjust ): + def updateBeatLabel( self, adjust ): beats = int(adjust.value) self.beatLabel.set_from_file(Config.IMAGE_ROOT + 'propBeats' + str(beats) + '.png') - if not self.setup: - stream = [] - for page in self.pageIds: - stream += [ page, beats ] - if len(stream): - self.noteDB.updatePages( [ PARAMETER.PAGE_BEATS, len(stream)//2 ] + stream ) + + def handleBeat( self, widget, signal_id ): + beats = int(widget.get_adjustment().value) + stream = [] + for page in self.pageIds: + stream += [ page, beats ] + if len(stream): + self.noteDB.updatePages( [ PARAMETER.PAGE_BEATS, len(stream)//2 ] + stream ) def stepPitch( self, step ): |