Mercurial > code > home > repos > light9
changeset 1075:35a234c7e6ff
remove some more 'collapsed' curve code
Ignore-this: 609c9b2f898a5fa89be8719258e82f27
author | Drew Perttula <drewp@bigasterisk.com> |
---|---|
date | Tue, 03 Jun 2014 06:31:24 +0000 |
parents | 6f6091b3ba3a |
children | dc474426845d |
files | light9/curvecalc/curvecalc.glade light9/curvecalc/curveview.py |
diffstat | 2 files changed, 28 insertions(+), 52 deletions(-) [+] |
line wrap: on
line diff
--- a/light9/curvecalc/curvecalc.glade Tue Jun 03 06:02:20 2014 +0000 +++ b/light9/curvecalc/curvecalc.glade Tue Jun 03 06:31:24 2014 +0000 @@ -10,9 +10,12 @@ </object> <object class="GtkTextBuffer" id="help"> <property name="text">Mousewheel zoom; C-p play/pause music at mouse +Keys in a selected curve: 1..5 add point at time cursor +Keys in any curve: q,w,e,r,t,y set marker at time cursor +Curve point bindings: B1 drag point; C-B1 curve add point; S-B1 sketch points; B1 drag select points + +Old subterm system may still work: Drag sub into curve area for new curve+subterm -Keys in a selected curve: C to collapse; R to rebuild broken canvas widget; 1..5 add point at time cursor; q,w,e,r,t,y set marker at time cursor -Curve point bindings: B1 drag point; C-B1 curve add point; S-B1 sketch points; B1 drag select points Available in functions: nsin/ncos period=amp=1; within(a,b) bef(x) aft(x) compare to time; smoove(x) cubic smoothstep; chan(name); curvename(t) eval curve</property> </object> <object class="GtkWindow" id="MainWindow"> @@ -435,34 +438,10 @@ </packing> </child> <child> - <object class="GtkButton" id="button7"> - <property name="label" translatable="yes">Collapse all</property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <signal name="clicked" handler="onCollapseAll" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">1</property> - </packing> + <placeholder/> </child> <child> - <object class="GtkButton" id="button6"> - <property name="label" translatable="yes">Collapse none </property> - <property name="use_action_appearance">False</property> - <property name="visible">True</property> - <property name="can_focus">True</property> - <property name="receives_default">True</property> - <signal name="clicked" handler="onCollapseNone" swapped="no"/> - </object> - <packing> - <property name="expand">False</property> - <property name="fill">True</property> - <property name="position">2</property> - </packing> + <placeholder/> </child> <child> <placeholder/> @@ -617,6 +596,12 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> </object> @@ -742,6 +727,12 @@ <child> <placeholder/> </child> + <child> + <placeholder/> + </child> + <child> + <placeholder/> + </child> </object> </child> <child type="label">
--- a/light9/curvecalc/curveview.py Tue Jun 03 06:02:20 2014 +0000 +++ b/light9/curvecalc/curveview.py Tue Jun 03 06:31:24 2014 +0000 @@ -384,8 +384,9 @@ visibility-notify-event (Gdk.EventMask.VISIBILITY_NOTIFY_MASK) fires on some - resizes but maybe not all. Could be doing the right thing, - though + resizes but definitely not all. During window resizes, + sometimes I have to 'shake' the window size to get all + curves to update. configure-event seems to never fire. @@ -1154,14 +1155,6 @@ def onDelete(self): self.curveView.onDelete() - def update_ui_to_collapsed_state(self, *args): - if self.collapsed.get_active(): - self.curveView.widget.set_size_request(-1, 25) - [w.hide() for w in self.hideWhenCollapsed] - else: - self.curveView.widget.set_size_request(-1, 100) - [w.show() for w in self.hideWhenCollapsed] - def sync_mute_to_curve(self, *args): """send value from CheckButton to the master attribute inside Curve""" new_mute = self.muted.get_active() @@ -1257,17 +1250,16 @@ if not self.live: # workaround for old instances living past reload() return - if event.string == 'c': - r = self.row_under_mouse() - # calling toggled() had no effect; don't know why - r.collapsed.set_active(not r.collapsed.get_active()) + r = self.row_under_mouse() + key = event.string + pass # no handlers right now def row_under_mouse(self): x, y = self.curvesVBox.get_pointer() for r in self.allCurveRows: inRowX, inRowY = self.curvesVBox.translate_coordinates(r.box, x, y) - _, _, w, h = r.box.get_allocation() - if 0 <= inRowX < w and 0 <= inRowY < h: + alloc = r.box.get_allocation() + if 0 <= inRowX < alloc.width and 0 <= inRowY < alloc.height: return r raise ValueError("no curveRow is under the mouse") @@ -1295,7 +1287,7 @@ # this is firing really often if self.visibleHeight == size.height: return - print "size.height is new", size.height + log.debug("size.height is new: %s", size.height) self.visibleHeight = size.height self.setRowHeights() @@ -1342,12 +1334,5 @@ for r in self.allCurveRows: r.onDelete() - def collapseAll(self): - for r in self.allCurveRows: - r.collapsed.set_active(True) - - def collapseNone(self): - for r in self.allCurveRows: - r.collapsed.set_active(False)