Keyboard shortcut - Lock current layer

Bug #728081 reported by pRototype
22
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Wishlist
Jessica

Bug Description

This is a new entry on the wishlist from me.

I simply want to be able to use a keyboard shortcut to lock current layer.

Reason is that I often find myself switching active layer, and I only want to edit a layer at a time, espechially when the layers below is pretty filled of all kind of objects. Aiming the mouse pointer to the lock-icon make me spend a lot more time on a draw job than I would do if I could do this more effective.

Thanks

su_v (suv-lp)
tags: added: layers shortcuts
Changed in inkscape:
importance: Undecided → Wishlist
jazzynico (jazzynico)
Changed in inkscape:
status: New → Confirmed
Revision history for this message
Jessica (jess+launchpad) wrote :

Here's a patch that adds Lock and Hide toggle verbs, which you can then assign to keys.

Added two verbs:
- LayerToggleLock
- LayerToggleHide

Tested with 0.48.3.1, which is currently the highest version in the gentoo repos. Was a lot less complicated than I thought it would be, only had to modify verbs.cpp and verbs.h

~jessica

Revision history for this message
jazzynico (jazzynico) wrote :

Patch tested successfully on Windows XP, Inkscape trunk revision 11129. Thanks, Jessica!

Now we need to associate the actions to shortcuts, and the list is already a bit crowded...
I'd use Ctrl+Alt+H (hide) and Ctrl+Alt+L (lock), but the first one is already used by org.inkscape.typography.previousglyphlayer. If we consider that core Inkscape shortcuts have priority over extensions, we can also modify the previousglyphlayer shortcut...

Changed in inkscape:
assignee: nobody → Jessica (jess+launchpad)
milestone: none → 0.49
status: Confirmed → In Progress
Revision history for this message
jazzynico (jazzynico) wrote :

Patch committed in the trunk, revision 11131.

Ctrl+Alt shortcuts may not be a very good choice due to windows managers interactions (Ctrl+Alt+L locks screen on Ubuntu...).
I'll try to find better free shortcuts.

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

Since translators complained that such verbs without GUI hook are difficult to translate [1], attaching a proposal to reorg and extend the 'Layer' menu (adding the two toggle commands, and grouping 'Duplicate current layer' with 'Delete current layer' further down).

[1] <http://thread.gmane.org/gmane.comp.graphics.inkscape.devel/38674/focus=38676>

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

Patch to add stub ('unbound') entries for the new verbs in 'share/keys/default.xml' (to make them discoverable for users which prefer to use custom key-mapping).

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

The shortcut as currently implemented IMHO has one big caveat users need to be made aware off: if the current drawing level is inside a group, the parent group instead of the parent layer is actually locked/hidden. If the user then leaves the group (e.g. by clicking on a different object outside the group, it is difficult to unlock (or unhide) that specific group.

The only indication that this going to happens is the "Layer" selector in the status bar which displays the current drawing level (i.e. the id of the group which is going to be (un)locked or (un)hidden).

Related reports (the issue is not new):
Bug #863974 "elements no longer available for selection"
Bug #845844 "Groups not selectable - turned insensitive (locked) without using object properties dialog"
Bug #304251 "incorrect locking/unlocking -- unlocking the layer locks the group which was choosen to be active"

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

Updated patch for shortcut stubs (to keep 'inkscape.xml' and 'default-xml' in sync).

Revision history for this message
jazzynico (jazzynico) wrote :

Both the menu skeleton and shortcuts changes look good. Thanks ~suv!
Any idea for suitable shortcuts?

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

> Any idea for suitable shortcuts?

Not really - maybe leave it up to the users for now?

Personally, I use these bindings in '~/.config/inkscape/keys/default.xml' - they are rather cryptic, but ok for testing (and for my own needs):

  <bind key="L" modifiers="Alt,Shift" action="LayerToggleHide" display="true" /> <!-- L -->
  <bind key="l" modifiers="Alt,Ctrl" action="LayerToggleLock" display="true" /> <!-- l -->

(on my system 'Alt+Ctrl' is not reserved by the window manager (quartz-wm), and if conflicts arise with other OS X system shortcuts, I usually tend to change those instead)

Revision history for this message
jazzynico (jazzynico) wrote :

New menu and stub committed in the trunk, revision 11528.

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

If of concern to others, the issue mentioned in comment #6 should be tracked in a separate report.

Closing this one as 'Fix committed', milestone 0.91.

Changed in inkscape:
status: In Progress → Fix Committed
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.