Mercurial > code > home > repos > light9
changeset 1205:566a781a4689
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
author | drewp@bigasterisk.com |
---|---|
date | Mon, 16 Jun 2014 23:56:35 +0000 |
parents | 67897bda0a9c |
children | 1b645670aa14 |
files | light9/curvecalc/curveview.py |
diffstat | 1 files changed, 15 insertions(+), 10 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/curvecalc/curveview.py Mon Jun 16 23:10:55 2014 +0000 +++ b/light9/curvecalc/curveview.py Mon Jun 16 23:56:35 2014 +0000 @@ -405,17 +405,20 @@ #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 @@ 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)