Modify

Opened 8 years ago

Closed 8 years ago

Last modified 8 years ago

#7314 closed enhancement (fixed)

[patch] Faster relation selection with Alt+click and middle-click

Reported by: joshdoe Owned by: team
Priority: normal Milestone:
Component: Core Version:
Keywords: relation selection Cc:

Description

I've been working with relations quite a bit, and it could be easier to select the relation that a given way belongs to (exclusively multipolygons actually). There are a few methods I know of to select such a relation:

  • Select the way, right-click on relation in property/membership dialog, then click Select relation
  • Select the way, double-click on relation in Relation Toolbox (plugin reltoolbox)

Both of these require moving the mouse and clicking three times; it might not seem like much but it adds up. I propose cycling through relations in addition to ways and nodes, both via Alt+click (my preferred method) and middle-click. I believe this would entail changing NavigatableComponent.getAllNearest(), or creating a modified copy (at least for middle-click, haven't found where Alt+click is handled yet). After cycling through any nearby Ways and Nodes, Relations could be next, based on whether they're parents of the nearby Ways and Nodes.

I think most people wouldn't even notice this change, and it seems like a logical method to select relations to me. Whether to restrict this just to multipolygons or to allow any relation is something I'm not sure about.

Attachments (1)

get_relations_with_getAllNearest.patch (1.8 KB) - added by joshdoe 8 years ago.
adds parent relations of nearest nodes and ways

Download all attachments as: .zip

Change History (9)

comment:1 Changed 8 years ago by akks

I think it is a good idea to extend middleclick.

Alt-Click can cause some problems on Linux (Alt-mousedrag is used for window moving sometimes).

Currently there is "AreaBoundary" action in Utilsplugin2 that implement relation cycling (together with more complex boundary selection).

comment:2 in reply to:  1 ; Changed 8 years ago by skyper

Replying to akks:

I think it is a good idea to extend middleclick.

+1

Alt-Click can cause some problems on Linux (Alt-mousedrag is used for window moving sometimes).

Yes, Alt is used by some window-managers. Alt + left click + drag currently moves the window in metacity (Gnome), xfwm (XFCE) and openbox (LXDE). Do not know about KDE. Alt+TAB and Alt + right click seem to be associated with the WM aswell.

comment:3 in reply to:  2 Changed 8 years ago by joshdoe

Replying to skyper:

Replying to akks:

I think it is a good idea to extend middleclick.

+1

I've already done this, just by adding all parent relations of the already found nearest nodes and ways. It's a trivial patch which I will attach later.

Alt-Click can cause some problems on Linux (Alt-mousedrag is used for window moving sometimes).

Yes, Alt is used by some window-managers. Alt + left click + drag currently moves the window in metacity (Gnome), xfwm (XFCE) and openbox (LXDE). Do not know about KDE. Alt+TAB and Alt + right click seem to be associated with the WM aswell.

I know it's a problem for some, but this Alt+click functionality is already implemented (though not well documented, so I improved the docs here?). Users that have problems with Alt+click can disable this Alt-capturing behavior in their window manager, use the AltGr key or right-hand Alt key instead, or make this selection mode the default by setting selectaction.cycles.multiple.matches to true.

Changed 8 years ago by joshdoe

adds parent relations of nearest nodes and ways

comment:4 Changed 8 years ago by joshdoe

Summary: Faster relation selection with Alt+click and middle-click[patch] Faster relation selection with Alt+click and middle-click

This patch and the one from #7317 fully implement this. I couldn't find other functions that used getAllNearest(), so I don't think changing this behavior should break anything.

comment:5 Changed 8 years ago by joshdoe

As someone who's been working with relations quite a bit recently ("upgrading" GNIS nodes to ways/multipolygons), I have found this and #7317 very useful. Both patches are pretty trivial and should apply cleanly.

comment:6 Changed 8 years ago by akks

Resolution: fixed
Status: newclosed

In 5016/josm:

Patch by JoshDoe [Faster relation selection with Alt+click and middle-click], fix #7314, #7317

comment:7 Changed 8 years ago by akks

You now have 6 patches in core :)
Code is very clean, I like it. Please reopen the ticket in anything goes wrong.

comment:8 in reply to:  7 Changed 8 years ago by joshdoe

Replying to akks:

You now have 6 patches in core :)
Code is very clean, I like it. Please reopen the ticket in anything goes wrong.

Thanks!

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.