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
 
@@ -405,17 +405,20 @@ class Curveview(object):
 
        #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
 
@@ -1113,8 +1116,10 @@ class CurveRow(object):
 

	
 
    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)
0 comments (0 inline, 0 general)