Save current color with brush preset
AbandonedPublic

Authored by mscaliskan on Oct 15 2018, 8:24 PM.

Details

Reviewers
dkazakov
Group Reviewers
Krita
VDG
Summary

Save current color with brush preset and reload on first use.

BUG: 336731

Diff Detail

Repository
R37 Krita
Lint
Lint Skipped
Unit
Unit Tests Skipped
mscaliskan requested review of this revision.Oct 15 2018, 8:24 PM
mscaliskan created this revision.

Hello,

I am not sure about these two parts below

const KoColorDisplayRendererInterface *displayRenderer = \
                        KisDisplayColorConverter::dumbConverterInstance()->displayRendererInterface();
        KisMainWindow *mainWin = KisPart::instance()->currentMainwindow();
        KisViewManager *viewManager = mainWin->viewManager();
        colorButton = new KoDualColorButton(viewManager->resourceProvider()->fgColor(),
                                            viewManager->resourceProvider()->bgColor(),
                                            displayRenderer,this,this);

and

KisMainWindow *mainWin = KisPart::instance()->currentMainwindow();
    KisViewManager *viewManager = mainWin->viewManager();
    QAction* showBrushEditor = viewManager->actionCollection()->action("show_brush_editor");
    if (showBrushEditor && !d->id2radio.begin().value()->isVisible()) {
        showBrushEditor->trigger();
    }

Are these valid usages?

hi @mscaliskan

I am not sure about the code, but using the foreground and background color selector might not be the beste widget to use for this. Only one color needs to be selected. This widget is too complex for what needs to be done. I would use a more simple color picker....

You can see an example of the simple color picker by going here from the main menu.
Configure Krita > General > Cursor color

Is the "Used Fixed Color" only valid when the plain color radio button is selected? It is outside the radio button area, so it looks like it affects all the different radio button options. If does only affect the plain color option, maybe it could be grouped closer to it so it shows the relationship

hello @scottpetrovic

Thank you for your review.

"KisPlainColorSource" both needs background and foreground color information for the constructor, therefore I thought I need to provide background color too. May I use "_painter->backgroundColor" with custom foreground color? Is it enough for plain color?

"Use Fixed Color" option is enabled if the "Plain color" option is selected. If other than "Plain color" option is selected, it becomes unchecked and disabled.

I guess I am a bit confused with how this will work. Will this only temporarily replace the foreground color and background color, or will this lock the foreground color and background color so the other color pickers won't do anything?

https://bugs.kde.org/show_bug.cgi?id=336731

The main request only mentions changing the brush color to blue, not really anything more complex like also changing the background color. Maybe we need to bring some artists into this conversation about how this needs to work. This feature is a bit confusing for me, so I might not be the best person to give feedback on it.

Well, this will be a fixed color brush and it will not be effected by system color options (color picker on tool bar). I will try to upload a short video, how its work.

This is how it works.

Thanks for the video. I think some other artists that might use this are going to need to speak up about how this will work. This whole idea seems a bit confusing to me that changing your colors in the toolbar doesn't actually change the colors. If this is exactly what the artists want, we can roll with it.

dkazakov added a subscriber: dkazakov.EditedOct 25 2018, 11:08 AM

I have a feeling that all the global color selectors should be somehow linked to the "fixed color" of the brush. E.g. when one changes the brush to the one with fixed color, the color in all the global selectors should become synced. And when the user changes this color, then the "fixed color" should be adjusted in the preset.

There is one question though: should the color be reverted back to the initial one after the user switches off the preset with the fixed color?

Right now, the patch works infinitely confusing. We will get a lot of bug reports talking about "color selector not working".

Yes, this is confusing, so how about, if we disable color picker on tool bar (if this only effects brush color) when fixed colored brush preset selected, and re-enable it when an other brush preset without fixed color selected? This way, we revert back the previous color when an other preset selected. And also by disabling the color picker on tool bar, user can notice that the current brush is fixed color one.

Yes, this is confusing, so how about, if we disable color picker on tool bar (if this only effects brush color) when fixed colored brush preset selected, and re-enable it when an other brush preset without fixed color selected?

I would prefer to allow the user to use all the existing color selectors for this change. I can bet that no painter will ever enter that "color source" tab voluntary :) The interactions should be much simpler.

E.g.:

  1. Check a check box "Save brush color"
  2. Select the color using any existing color selection method.

I would prefer to allow the user to use all the existing color selectors for this change. I can bet that no painter will ever enter that "color source" tab voluntary :) The interactions should be much simpler.

E.g.:

  1. Check a check box "Save brush color"
  2. Select the color using any existing color selection method.

So you mean, just save the current global color with preset and if the user want to change color while working, let user change it. A preset with saved color will change global color option only on first load. Am I right?

mscaliskan retitled this revision from Create plain color brush presets with fixed color to Save current color with brush preset.Oct 28 2018, 10:00 PM
mscaliskan edited the summary of this revision. (Show Details)

I change whole revision and edit current revision title and summary. Please also check new video on summary how this new revision works. Please advise any problem you notice.

Sorry for the delay, I still plan to test this patch, but I'm a bit busy with family problems right now. I'll try to finally check the patch by the end of the week.

No problem at my side. This request has been waiting for about 4 years so, it can wait a bit more. ^_^b

dkazakov requested changes to this revision.Nov 6 2018, 8:43 PM

Hi, @mscaliskan!

There is some weird problem with the way how this feature interacts with "Save temporary tweaks to brush presets" feature. Please see the attached video:

When activating "Save temporary tweaks to brush presets", the following happens:

  1. Sometimes the checkbox randomly resets to uncheched state.
  2. Choosing the preset with some tweaks saved does not restore the old color
  3. Changing the color when a preset with "save color" active doesn't mark the preset as dirty.

My guts say that either some setPresetDirty or comparison function doesn't work correctly...

[disputable] I'm also not sure why you save both foreground and background colors :) I guess saving foreground color only should be enough for the users.

This revision now requires changes to proceed.Nov 6 2018, 8:43 PM
mscaliskan updated this revision to Diff 45299.Nov 11 2018, 4:14 PM

Sorry for my late reply, I was busy this week.
On my first implementation, I tried not to change the current preset before saving or overwriting. I changed this behavior and made some changes for the preset dirty state.

dkazakov requested changes to this revision.Nov 12 2018, 10:17 AM

Hi, @mscaliskan!

It still doesn't update the preset (and doesn't save the color) if the color selector is changed.

Steps to reproduce:

  1. Activate "Save temporary tweaks"
  2. Activate "Save color"
  3. Save the preset under a name "test_color"
  4. Select some other preset and return back to "test_color"
  5. Check that the preset is not marked by dirty
  6. Change the color by Advanced Color Selector
  7. [BUG] Notice that the preset has not become dirty!
  8. Select some other preset
  9. Change the color by Advanced Color Selector
  10. Return back to "test_color"
  11. [BUG] The saved color is not restored
This revision now requires changes to proceed.Nov 12 2018, 10:17 AM
mscaliskan updated this revision to Diff 45481.Nov 14 2018, 8:04 PM

Hi @dkazakov,
I think naming causing some misunderstandings, therefore I edited control name (please refer to videos).
For the issues you mentioned:
1-5. I think this is a normal behavior. If you save a dirty preset, you save edited option as new preset so, you can not see the dirty flag when you re-select it. Please refer to the video below. First, I changed another option and save it, then repeat it with color option. They behave the same.

6-11. Save color option store current color only on the first activation. Therefore, when you change the current color and open popup again, it does not update current color (isn't this is the desired behavior?). I think the control name cause this confusion. I change the control name to "Has Color" if there is a color option on current preset. If you want to override saved color with the current one, you have to uncheck and check again (but I think, overriding the saved color is not a common operation). If "Save temporary tweaks" is active, you can reset to the saved first color by reloading the preset. Please refer to the video below for overriding color and reset to the first color after overriding.

Please advice, If I have some misunderstandings about the problems or feature behavior.

Hi, @mscaliskan!

1-5. I think this is a normal behavior. If you save a dirty preset, you save edited option as new preset so, you can not see the dirty flag when you re-select it.

Yes, the bugs are only in points 7) and 11)

  • [BUG] Notice that the preset has not become dirty!
  • [BUG] The saved color is not restored

6-11. Save color option store current color only on the first activation. Therefore, when you change the current color and open popup again, it does not update current color (isn't this is the desired behavior?)

Well, no, it not exactly the desired behavior. Right now the feature is really confusing. If the the feature saves the color on the first activation only, then it should be some button click that saves the color, not a checkbox. Although I'm not sure that button-based approach is exactly what painters need. Please ask @scottpetrovic, @timotheegiet and @Deevad about their opinion on the topic.

Basically, there are two approaches to organize the UI:

  1. [the one that I proposed originally] When the checkbox is set, the color of the color selectors is always synchronized with the internal color of the brush. When the brush is activated, the color of the global selector is set to the saved value. When a brush with saved color is deselected, then ... (I don't know what is logical to do in this case). Right now this approach is partially implemented, but works incorrectly.
  1. [extension of your current idea] There is a checkbox "Has color saved" and a button "Save color now". The checkbox means that there is a color is saved at all, and the button defines a moment of time, when the color is actually saved into the preset. In this case, we probably shouldn't change the global color selector when activating the preset, or just have one more button "Load the color to color selectors".
dkazakov requested changes to this revision.Dec 25 2018, 6:06 AM

I will mark the patch as "needs changes", otherwise its status is confusing...

This revision now requires changes to proceed.Dec 25 2018, 6:06 AM

I am sorry, I could not continue to edit this revision.

mscaliskan abandoned this revision.Dec 25 2018, 8:02 AM

I am sorry, I could not continue to edit this revision.

It's a pity :(