Changeset - 566a781a4689
[Not reviewed]
default
0 1 0
drewp@bigasterisk.com - 11 years ago 2014-06-16 23:56:35
drewp@bigasterisk.com
fix CC display update failure when rows are very small and you click in one and the size adjustment signal doesn't fire
Ignore-this: fcb851e0dc7eb50fc1b673d92533608a
1 file changed with 15 insertions and 10 deletions:
0 comments (0 inline, 0 general)
light9/curvecalc/curveview.py
Show inline comments
 
@@ -402,23 +402,26 @@ class Curveview(object):
 
                reactor.callLater(0, self.update_curve)
 
            return False
 
            
 
        #self.widget.connect('size-allocate', sizeEvent) # see docstring
 

	
 
        def visEvent(w, alloc):
 
            p = self.canvas.props
 
            w = self.widget.get_allocated_width()
 
            h = self.widget.get_allocated_height()
 
            if (w, h) != (p.x2, p.y2):
 
                p.x1, p.x2 = 0, w
 
                p.y1, p.y2 = 0, h
 
                self.update_curve()
 
            self.setCanvasToWidgetSize()
 
            return False
 
        self.widget.add_events(Gdk.EventMask.VISIBILITY_NOTIFY_MASK)
 
        self.widget.connect('visibility-notify-event', visEvent)
 
        
 

	
 
    def setCanvasToWidgetSize(self):
 
        p = self.canvas.props
 
        w = self.widget.get_allocated_width()
 
        h = self.widget.get_allocated_height()
 
        if (w, h) != (p.x2, p.y2):
 
            p.x1, p.x2 = 0, w
 
            p.y1, p.y2 = 0, h
 
            self.update_curve()
 

	
 
    def createCanvasWidget(self, parent):
 
        # this is only separate from createOuterWidgets because in the
 
        # past, i worked around display bugs by recreating the whole
 
        # canvas widget. If that's not necessary, this could be more
 
        # clearly combined with createOuterWidgets since there's no
 
        # time you'd want that one but not this one.
 
@@ -1110,14 +1113,16 @@ class CurveRow(object):
 
        self.curveView.widget.show()
 
        self.setHeight(100)
 
        self.cols.pack_start(self.curveView.widget, expand=True, fill=True, padding=0)       
 

	
 
    def setHeight(self, h):
 
        self.curveView.widget.set_size_request(-1, h)
 
        # the event watcher wasn't catching these
 
        reactor.callLater(.5, self.curveView.update_curve)
 

	
 
        # this should have been automatic when the size changed, but
 
        # the signals for that are wrong somehow.
 
        reactor.callLater(0, self.curveView.setCanvasToWidgetSize) 
 
        
 
    def setupControls(self, controls, name, curve):
 
        box = Gtk.Box.new(Gtk.Orientation.HORIZONTAL, 0)
 
        controls.add(box)
 

	
 
        curve_name_label = Gtk.LinkButton()
0 comments (0 inline, 0 general)