GNOME Bugzilla – Bug 759601
Add/Remove layer masks by clicking the layer preview
Last modified: 2016-08-25 23:16:14 UTC
Created attachment 317582 [details] [review] Alternate proposal to add layer masks via ctrl-click of layer image in the dock. Alternate patch proposal to add layer masks via ctrl-click of layer image in the dock. Also adds a preference dialog entry to select the default behavior when ctrl-clicking to add a layer mask.
Created attachment 317584 [details] [review] Alternate proposal for adding layers masks through ctrl-click of image same as previous patch but reverts one type change back to static which got added inadvertently in the last one.
This theme is basically the opposite/inverted color scheme of the dark one btw :)
Oops! sorry wrong bug report.
Created attachment 317671 [details] [review] Update to fix to prevent saving the default on exit.
+1
Made a video to show off how much faster using ctrl-click to add or remove a layer mask for any given layer and how to set a default type or use of the dialog instead. Video is here https://youtu.be/WYyiRFKvYBg
Ok I think I should comment on this... We have a gazillion requests to persistently remember various dialog defaults. Adding them all to prefs is not a solution, we have too many preferences already. Also, we should not use Ctrl for this, we will need this for future multiple selection on the layer tree. What about this: Alt-click -> Add/Remove layer mask with dialog Alt-shift-click -> Add/Remove layer mask with last defaults from dialog Sidenote: all attached patches break abstraction by including actions/ and dialogs/ stuff from widgets/, and there is an enum for these 0, 1, 2 cases.
(In reply to Michael Natterer from comment #7) > Ok I think I should comment on this... > > We have a gazillion requests to persistently remember various dialog > defaults. Adding them all to prefs is not a solution, we have too > many preferences already. > I guess that's one point where we disagree, i prefer to have as much control as possible and i like to have the ability to choose. I could add it to an existing tab in prefs as an expander option instead to make it less obvious though. Any suggestion to which would be better? > Also, we should not use Ctrl for this, we will need this for future > multiple selection on the layer tree. > > What about this: > > Alt-click -> Add/Remove layer mask with dialog > Alt-shift-click -> Add/Remove layer mask with last defaults from dialog > Alt-click is the default window grab action for Ubutnu so thats not the best idea. Alt-click doesn't interfere with anything as long as its done only on the image, the mechanism stays the same for everything else. > Sidenote: all attached patches break abstraction by including > actions/ and dialogs/ stuff from widgets/, and there is an > enum for these 0, 1, 2 cases. Not sure what you mean, i didn't find any way to make it work by calling it through the actions mechanism. Which is why i did it this way.
Created attachment 320129 [details] [review] Patch to enable adding layer masks through ctrl-shift-click on layer image in layer dock.
Created attachment 320141 [details] [review] Patch to enable adding layer masks through ctrl-shift-click on layer image in layer dock. 2016-01-31
Created attachment 323698 [details] [review] Patch to enable adding layer masks through ctrl-shift-click on layer image in layer dock. Updated 2016-03-11 defaults to white mask.
(In reply to Michael Natterer from comment #7) > Ok I think I should comment on this... > > We have a gazillion requests to persistently remember various dialog > defaults. Adding them all to prefs is not a solution, we have too > many preferences already. > > Also, we should not use Ctrl for this, we will need this for future > multiple selection on the layer tree. > > What about this: > > Alt-click -> Add/Remove layer mask with dialog > Alt-shift-click -> Add/Remove layer mask with last defaults from dialog > > Sidenote: all attached patches break abstraction by including > actions/ and dialogs/ stuff from widgets/, and there is an > enum for these 0, 1, 2 cases. I've modified the patch accordingly.
Created attachment 326248 [details] [review] Patch to enable adding layer masks through ctrl-shift-click on layer image in layer dock. Updated 2016-04-18. Patch to enable adding layer masks through ctrl-shift-click on layer image in layer dock. Updated 2016-04-18 fixed to apply cleanly for latest master branch.
Created attachment 327107 [details] [review] Removed empty mc.orig file inadvertently added in the last patch.
Ben, can you obsolete the outdated patches?
Done
Created attachment 328430 [details] [review] Patch to enable adding layer masks through ctrl-shift-click on layer image in layer dock. Updated for clean patching latest git 2016-04-24. Patch to enable adding layer masks through ctrl-shift-click on layer image in layer dock. Updated for clean patching latest git 2016-04-24. Hopefully people are using it seeing as it isn't going to get committed (after 6 months of updates).
Why hasn't this been committed yet? Clearly Ben is willing to maintain it. Seeing how this has been (mis)handled is not encouraging for new contributors.
(In reply to BugsBunny from comment #18) > Why hasn't this been committed yet? Clearly Ben is willing to maintain it. > Seeing how this has been (mis)handled is not encouraging for new > contributors. BugsBunny: This is likely my last update, from i've seen in the last 6 months GIMP seems to suffer from a "not invented here syndrome". People seem refractory to power users and Photoshop refugees (sometimes with reason but often not). I suspect i was only humored because of the theme work (patches and theme files) i did. Oh well live and learn.
Sorry I suck at reviewing this... Will do soon.
(In reply to BugsBunny from comment #18) > Why hasn't this been committed yet? Clearly Ben is willing to maintain it. > Seeing how this has been (mis)handled is not encouraging for new > contributors. The most recent patch had been added on 2016-05-01. People who think that this is still too long are welcome to help with the reviewing/testing to speed this up.
Related: bug 623594
Did anyone check if any of the actions described in bug bug 623594 conflict here?
I've been looking at the patch several times now. Ben, could you come to IRC in order to discuss it? What you wrote in comment 19 is the wrong impression.
I haven't had the time to hangout on IRC waiting for people to show up, as for the patch i'm rather tired of debating it, it's already been changed to use actions and i switched it from ctrl-click to ctrl-alt-click. The preference item has to stay to make it useful. I don't get what the issue is with it considering what it does, besides it's already strayed far from what i originally wanted and is about as far as i'm willing to change it which was to have a button entry in the dock. I think i've bent over backwards on this issue, no more.
I've thought about an approach to bring dialog defaults to preferences in a more general manner, fixing this and many other issues at the same time. I hoped to discuss it with you, if you are still interested...
I'll try and make time for it some time this week'ish.
(In reply to Michael Natterer from comment #26) > I've thought about an approach to bring dialog defaults to preferences > in a more general manner, fixing this and many other issues at the same > time. I hoped to discuss it with you, if you are still interested... I tried showing up 7 times on irc in the last two weeks and you either weren't there or not responding, so i'm done with that. How about you just email it to me and we'll go from there.
Did you join the #gimp channel on irc.gimp.org and ask there? I'm asking because I don't see any activity besides three joins in the logs, so if you said anything, it might not have come through.
Sigh. Yes the same one i was using when i did the themes, on the same account. I don't care what the logs say i was there 7 times and i even tried to send him a direct message to no avail. This is getting really tiresome and annoying.
Ah, I'm pretty sure mitch meant to discuss this on the channel, at least I'm pretty sure he didn't intend to do this in a direct IRC message. Also, this would have had the side-effect of other people noticing that you have been there.
Also, I was pretty much AFK for almost two weeks because of shitload of other work to do. I did see your direct message a day later or so.
That may be but its the same litany since January. I'm done discussing this, and this patch.
Created attachment 332622 [details] [review] Add remove masks with dock button or through ctrl-shift-click or select mask dialog through ctrl-alt-click This is the patch i've really wanted since the beginning, i know it'll never happen but someone else may find it useful. This lets you add/remove masks to a layer with a dock button or through ctrl-shift-click or select mask dialog through ctrl-alt-click.
While applying the latest patch, I realized that this is somewhat the same as skipping the "new layer" and other dialogs with shift. See bug 159832. It's also related to dialog defaults which we currently keep in static variables all around the code. See bug 599573.
Finally, sorry for the waiting, and for the massive changes to the patch :) commit 0b7381a8223f1a02e1c1c0b9e7609544d82e8fce Author: Benoit Touchette <draekko.software+gimp@gmail.com> Date: Tue Aug 23 19:18:20 2016 +0200 Bug 759601 - Add/Remove layer masks by clicking the layer preview Quite heavily modified by Mitch to address the more general issues mentioned in comment 35 of the bug: - Remember the added mask's type and the invert boolean in GimpDialogConfig - Add new prefs page "Dialog Defaults" which will contain only stuff from GimpDialogConfig and can be reset separately - Remove static mask variables from layers-commands.c and use the new config values for both interactive mask adding with the dialog, and for the shortcut based method - Add a button to the layers dialog which supports add, add with last values, delete, apply - Add modifier-click shortcuts on the layer preview with the same modifiers as on the button app/actions/layers-actions.c | 22 +++++++++- app/actions/layers-commands.c | 134 +++++++++++++++++++++++++++++++++++++++----------------- app/actions/layers-commands.h | 2 + app/config/gimpdialogconfig.c | 41 ++++++++++++++--- app/config/gimpdialogconfig.h | 2 + app/config/gimprc-blurbs.h | 6 +++ app/dialogs/preferences-dialog.c | 45 +++++++++++++++++-- app/widgets/gimphelp-ids.h | 1 + app/widgets/gimplayertreeview.c | 68 +++++++++++++++++++++++----- 9 files changed, 260 insertions(+), 61 deletions(-)
Hi, If the button can work as a toggle button to add a mask when a layer is selected, and to remove the mask when a layer's mask is selected, then there would be no worry of the perceived conflict between using ctrl+click for this feature and the planned multi-selection of layers.
The button doesn't have this problem anyway, only the layer preview clicks. Also, the toggle button would have to distinguish between delete mask and apply mask too.
(In reply to Michael Natterer from comment #38) the toggle button would have to distinguish between > delete mask and apply mask too. Yes.
Hi, In Photoshop, Shift + click (used for multi-selection of layers) is also used to hide/reveal a layer mask. http://www.designeasy.co/2011/05/photoshop-layer-mask-keyboard-shortcuts.html FYI
@Micheal good to know i haven't had the chance to test it, spent yesterday day in the hospital with chest pains. Depending on how i feel to day i might give it a go and see how it works.
Hi, It would be better if clicking the button could straight away add a layer mask with full opacity (as by Shift+layer click), while Shift+button click should open the dialog. Intelligently, if the target layer has an active selection, the mask should be initialized from the selection. IMO, accessing the pop-up dialog of options should be optional. Similarly, adding a new layer should be optional since 99.9% of new layers added are expected to be transparent. Note that Ctrl+Shift+button click also adds a new layer with previous value/fill.
@Michael Found enough energy to give the new code a try and that isn't what i needed or intended, the dialog is totally annoying when clicking on the button and wasn't what i wanted to have there, the whole point of the patch is to do away with the dialog to streamline adding layers. Also its totally not obvious where to enable the shift click for a new user and its seems to be disabled by default. I'm really disappointed with this new code.
After some trial and error i discovered that ctrl-click abd shift-click remove and add a layer, i find that annoying. I think having the same key to add and remove would be better and feels more consistent with other software. Also you only have to remember 1 key. Also i just noticed the alt-click which did bring up the dialog is gone. I would rather have the dialog on shift-click and the ctrl-click use the default layer add value. And doing away with the dialog on the button would be great. At least offer the option for that in the dialog pereference so users can choose.
@Michael Appreciate the effort but it kind of falls short.
(In reply to Ben from comment #44) > I would rather have the > dialog on shift-click and the ctrl-click use the default layer add value. > And doing away with the dialog on the button would be great. At least offer > the option for that in the dialog pereference so users can choose. I strongly concur with Ben's proposal.
@Michael: still recovering from my issue on tuesday will try to find the energy to make a patch proposal.
I hope you get better soon. I patched it up that way so it's consistent with other buttons click -> dialog shift-click -> last values The issue of swapping click and shift-click has been raised a couple of times, but any patch would have to maintain consistency across all such dialogs.
(In reply to Michael Natterer from comment #48) > The issue of swapping click and shift-click has been raised a couple of times, What is the problem swapping them? > but any patch would have to maintain consistency across all such dialogs. Which other dialogs? As of now, I only know of two which are invoked with the button click: 1. Add new layer 2. Add layer mask Please, not to say GIMP should behave or look like other similar apps, but a few things should be simpler like JUST DO IT.
@Michael Can we at least have the choice whether or not to have the dialog for the mask button? At least that would be a fair compromise, just needs an extra checkbox for the dialog preferences for this item to toggle it on/off and switch between that and just applying the default mask as the alternate.
@Michael thanks and if i code it up would consider it at least.
Sadly, it's much more than those two. I am annoyed by frequent dialogs too, here is the (maybe incomplete) list: - add layer - add layer mask - add channel - add path - selection to path - stroke path - stroke selection
(In reply to Michael Natterer from comment #52) > Sadly, it's much more than those two. I am annoyed by frequent dialogs too, > here is the (maybe incomplete) list: > > - add layer > - add layer mask > - add channel > - add path > - selection to path > - stroke path > - stroke selection Indeed but i only have energy right now to deal with one, this one since its what we're discussing.
How does work well in Photoshop and Krita with easy?
@Michael i created a new bug/patch report to continue with this.