click on ruler enables guides -> use as toggle to disable them as well

Bug #951580 reported by mray
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
John Smith

Bug Description

When accidentally clicking on the ruler (I was aiming at the select tool) suddenly the guides became visible.
I was really surprised and it happened several times until I noticed:
Inkscape probably thinks I'm about to drag out a new guide and enables them: but i didn't!

While I kind of like the new way of enabeling guides through that bug I wish it could be used as a toggle.
Don't know if this qualifies as a wishlist item or a bug now :D

Tags: guides ui
su_v (suv-lp)
Changed in inkscape:
importance: Undecided → Wishlist
tags: added: guides ui
Revision history for this message
su_v (suv-lp) wrote :

I doubt it's a bug (IMHO it is a convenient and intentional shortcut to not have to toggle visibility of guides first when creating a new one):
<quote>
When you create a new guide by dragging off the ruler, guide visibility and snapping are turned on.
</quote>
<http://inkscape.org/doc/keys048.html#d0e959>

-> setting bug importance to 'Wishlist' (aka feature request) to use a single click on ruler as toggle for the visibility of guides (but how does one create guides then without - possibly accidentally - disabling/hiding them?).

summary: - click on ruler enables guides
+ click on ruler enables guides -> use as toggle to disable them as well
Revision history for this message
mray (mrayyyy) wrote :

Your quote says: "When you create...." but regarding my experience: I never wanted, and I never DID create (or didn't notice) any guide. Thats the surprising/problematic part for a user if suddenly everything fills up with guides.

I like the idea having a proper toggle area for guides though.
btw: Adobe uses this area for: doubleclick -> change unit (inch/mm/..) , also a nice use.

Revision history for this message
su_v (suv-lp) wrote :

> I never wanted, and I never DID create (or didn't notice) any guide.

Then you would not even have noticed that clicking on the ruler toggles their visibility on (unless you are editing files created by someone else who used guides). If there are no guides in the current document, clicking on a ruler has no visual effect.

Revision history for this message
mray (mrayyyy) wrote :

I work on a http://960.gs/ grid template - so I didn't even have to create the guides myself.
I think the problem is that a "dragging-area" behaves like a broken button, just because a click counts as a zero-length drag.

So my suggestion would be:
either make the whole ruler a true toggle button, or
make guides only visible if a guide was actually created.

Revision history for this message
su_v (suv-lp) wrote :

<off-topic>
>>> I never wanted, and I never DID create (or didn't notice)
>>> any guide. Thats the surprising/problematic part for a
>>> user if suddenly everything fills up with guides.

> I work on a http://960.gs/ grid template - so I didn't
> even have to create the guides myself.

I downloaded the available Inkscape templates from
<https://github.com/nathansmith/960-Grid-System/tree/master/templates/inkscape>
and all three of them have the guides (as well as the grid) _visible by default_ (Inkscape stores the visibility of guides and grids in the document itself, as document properties). ISTM that the designers of 960.gs consider guides as essential drawing aids.
</off-topic>

> So my suggestion would be:
> either make the whole ruler a true toggle button (…)

AFAICT the event context currently does not test whether the drag is within the drag tolerance (set in Inkscape Preferences), but assumes that a mouse button press on the ruler is always initiating a drag event to create a new guide:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/desktop-events.cpp#L94>

Implementing a test for the drag tolerance similar e.g. to how click and click-drag in the zoom context works:
<http://bazaar.launchpad.net/~inkscape.dev/inkscape/trunk/view/head:/src/zoom-context.cpp#L136>
might allow to handle a single click as toggle, and a click-drag as event to enable guides (before the new one is actually created).

> (…) or make guides only visible if a guide was actually created.

Guides have to be made visible _before_ a new guide is created: you want to see existing guides (and the new one) while positioning it, not drop it blindly and toggle visibility after the fact. AFAIU Inkscape only knows after the mouse button was released whether a new guide had been created or not.

Changed in inkscape:
status: New → Confirmed
Revision history for this message
mray (mrayyyy) wrote :

From what you say it seems unfeasible to prevent guides from popping up on the ruler when clicking it.
But is there a problem in making it toggle? (a toggle would rock)
In my eyes it is currently a slightly glitchy behaviour.

I realize this is really a minor issue and I'm grateful for your attention.
Just trying to contribute as a designer here.

Also I want to express my deep gratitude to all developers! You guys rock. Thank you so much, working with Inkscape makes one feel good :)

Revision history for this message
John Smith (john-smithi) wrote :

Here is a patch that toggles the guides on and off when clicking (within drag tolerance) on the ruler.

Changed in inkscape:
assignee: nobody → John Smith (john-smithi)
status: Confirmed → In Progress
Revision history for this message
LucaDC (lucadc) wrote :

Nice and useful feature: tried under Windows XP and works as expected.

I understand the implementation but forgetting for a while being a programmer, I acted as a user and noticed something that may be improved.

If you click and drag while not exiting the ruler, guides are always turned on but no new guide has been created yet; you could even release the mouse in the ruler. This is not a big problem, though.
If you click and drag out the ruler your new guide, and then change your mind and bring it back to the ruler to delete it and drop it near the point from which it had been generated, all guides are turned off. I've tried sometimes and it's not as difficult as could sound to catch a point near where you started.

I would tie the always turn guide on to exiting the ruler and the toggle feature to _not_ exiting the ruler. So:
 - click on the ruler, never exit the drag area, release the mouse: toggle guides;
 - click on the ruler, exit the drag area: nothing happens and toggle will never occur (disable it regardless of what happens after);
 - click on the ruler, exit the ruler: all guides on (toggle has already been disabled);
 - click on the ruler, exit the ruler, reenter the ruler: nothing happens (you've just created and destroyed a guide, forcing all guides on when exiting the ruler).
I would set a 'toggle' flag when clicking on the ruler and clear it when either exiting the drag area or the ruler; when releasing the mouse, if it's still set then toggle guide display, otherwise do nothing. When exiting the ruler with mouse still clicked, always clear the toggle flag and turn all guides on.

Revision history for this message
John Smith (john-smithi) wrote :

> always turn guide on when exiting the ruler
This should work in this patch

>bring it back to the ruler to delete it and drop it near the point from which it had been
This could go either way. In many applications (including Inkscape) clicking and dragging a button outside the button, then moving the mouse back inside the button and releasing actually counts the same as a simple button press. The click/drag/return/release action here works in the same way.

Revision history for this message
LucaDC (lucadc) wrote :

> This could go either way. In many applications (including Inkscape) clicking
> and dragging a button outside the button, then moving the mouse back
> inside the button and releasing actually counts the same as a simple button
> press. The click/drag/return/release action here works in the same way.
I had thought about this but eventually discarded the idea because in fact when pressing a button you don't have different behaviors depending on where you did click or if you moved: what only counts is where you release the mouse and that triggers a single action; but indeed in the ruler such differences are much relevant because they trigger different actions.
Of course the current behavior could be accepted, at least in a first stage, but I'd be more strict in implementing it.

Revision history for this message
John Smith (john-smithi) wrote :

Committed r11448 to trunk.
Includes the click/drag/return/release behavior as suggested by LucaDC in #8.

John Smith (john-smithi)
Changed in inkscape:
status: In Progress → Fix Committed
su_v (suv-lp)
Changed in inkscape:
milestone: none → 0.49
Bryce Harrington (bryce)
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.