GNOME Bugzilla – Bug 624940
lookingGlass improvements
Last modified: 2010-08-23 17:06:20 UTC
I wanted to inspect an actor that had no padding or spacing, but could only select its children. So I wrote a patch that lets you use the scroll wheel to select higher or lower levels in the higherarchy. (Scroll up selects successively-higher parents, scroll-down selects back toward the child you started from.) After doing that it occurred to me that maybe it would be better to have it be based on Z order rather than hierarchy (ie, by hiding some actors around the pick() call so as to end up selecting the actors behind them). Could do that too... The first patch is just a reorg of existing code, and could be squashed with the scrollwheel patch. The third patch makes "Esc" DTRT. The fourth fixes the queue_relayout warnings, because they were annoying me.
Created attachment 166298 [details] [review] [lg] split inspector event handlers out into separate functions
Created attachment 166299 [details] [review] [lg] Use scroll wheel in inspector to select parent actors scroll-up selects the parent actor, then grandparent, etc. scroll-down moves the selection back towards the frontmost actor.
Created attachment 166300 [details] [review] [lg] Close inspector on Esc
Created attachment 166301 [details] [review] [lg] fix queue_relayout warnings
Don't know if this is at all applicable but just saw this go by and wanted to mention that Inkscape uses alt+click to successively drill down the z-order for selections. Don't know if that helps at all.
Review of attachment 166298 [details] [review]: Looks good.
Review of attachment 166299 [details] [review]: ::: js/ui/lookingGlass.js @@ +425,3 @@ + // select parent + switch (event.get_scroll_direction()) { + _onScrollEvent: function (actor, event) { I find the split between _target and _pointerTarget confusing; the way you have this coded, you can't move the mouse between going up and down, right? That seems like it'd require very steady hands. Maybe instead have UP set an explicit "searching" mode, and require a click to exit it?
Review of attachment 166300 [details] [review]: Looks OK.
Review of attachment 166301 [details] [review]: Looks fine.
(In reply to comment #7) > I find the split between _target and _pointerTarget confusing; the way you have > this coded, you can't move the mouse between going up and down, right? No. I guess I should have added a comment. _pointerTarget is the actor immediately under the pointer, and _target is the actor currently selected by the inspector (which is always either _pointerTarget or one of its ancestors). But the motion-event handler was tweaked so that it doesn't set _target on every event; it only changes _target if _pointerTarget changes. So, eg, if you hover over the "Activities" StLabel, and scroll up, it will select its parent (the 'panelActivities' StClickable), and that will stay selected until you move the pointer outside the StLabel.
(belatedly) added a comment and pushed Attachment 166298 [details] pushed as 1a50b94 - [lg] split inspector event handlers out into separate functions Attachment 166299 [details] pushed as 09edf4b - [lg] Use scroll wheel in inspector to select parent actors Attachment 166300 [details] pushed as 083b1c9 - [lg] Close inspector on Esc Attachment 166301 [details] pushed as 957b3b6 - [lg] fix queue_relayout warnings