Add a toggle on/off switch for pen pressure
ClosedPublic

Authored by tantsevov on Jul 29 2016, 4:29 PM.

Details

Summary

Feature for https://phabricator.kde.org/T3279. Button is located in the Tool Bar but not visible by defult. User can add it in Tool bar options. Has a customizable shortcut.
Based on @dkazakov branch krita-hud-kazakov.

Test Plan

Does anyone have better name for button?
Unfortunately, I haven't tablet with pen, so I can't test it, but by @dkazakov, this option seems to work.

Diff Detail

Repository
R37 Krita
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
tantsevov updated this revision to Diff 5562.Jul 29 2016, 4:29 PM
tantsevov retitled this revision from to Add a toggle on/off switch for pen pressure.
tantsevov updated this object.
tantsevov edited the test plan for this revision. (Show Details)
tantsevov added a reviewer: Krita.
tantsevov added subscribers: dkazakov, rempt, scottpetrovic and 2 others.

"Ignore Pen Pressure" is a negative. When a button is enabled, it means a feature should be added, not removed. That is how all features in the application should be working. This functionality isn't working like that.

"Use Pen Pressure" should be how it functions and it should be enabled by default. We have discussed this already on IRC so I am assuming you just made this comment before we talked.

tantsevov updated this revision to Diff 5572.Jul 30 2016, 10:12 AM

Now it's not a button, but check box. I think that this is the best solution for this feature. In Tool Box options it calls "Pressure usage". I don't know how delete "Use pen pressure" button from settings, mb @dkazakov or @rempt can help me with it. Btw, I don't have tablet, so pleace check it for correct work.

dkazakov requested changes to this revision.Jul 31 2016, 7:03 AM
dkazakov added a reviewer: dkazakov.

Hi, @tantsevov!

Well, the pure checkbox solution is really wrong. It looks differently from other buttons in the toolbar. And there is one more bug: now we have two "Use pressure" actions for some reason... I don't know why?

This revision now requires changes to proceed.Jul 31 2016, 7:03 AM

@dkazakov, hello! There are two pressure button because of check box. For example, in settings you can find "Eraser button" mode, separately from the composite.

tantsevov updated this revision to Diff 5690.Aug 5 2016, 11:27 AM
tantsevov edited edge metadata.

Add changeble icon for button. But have some icon truble which is determined by Krita, the reason I showed the video.
https://youtu.be/cHGXs_Q7Zu4

I think some file is missing:

[ 55%] Building CXX object libs/ui/CMakeFiles/kritaui.dir/kritaui_automoc.cpp.o
[ 55%] Linking CXX shared library libkritaui.so
[ 66%] Built target kritaui
make[2]: *** No rule to make target '/home/devel5/kde-src/krita/krita/pics/tool_transform/light_transform_icons_penPressure_locked.png', needed by 'krita/qrc_tool-transform-icons.cpp'.  Stop.
CMakeFiles/Makefile2:1090: recipe for target 'krita/CMakeFiles/krita.dir/all' failed
make[1]: *** [krita/CMakeFiles/krita.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
Scanning dependencies of target KisSimpleMathParserTest
dkazakov requested changes to this revision.Aug 6 2016, 10:17 AM
dkazakov edited edge metadata.

The icon is missing due to some accident :) And the fact that the icon is not themable is actually a problem.

krita/pics/tool_transform/tool-transform-icons.qrc
37

Did you also add a dark version of the icon? On the light theme, the icon looks a bit too bright, so I cannot understand if ti is expected so or not :)

And yes, please add the icon itself to the patch :)

libs/ui/kis_paintop_box.cc
1104

You should not add the "light" prefix. The prefix is chosen based on the current theme set in Krita.

Please also take care if your widget handles themeChanged() signal correctly. Please check the constructor of KisPaintopBox for examples :) Otherwise the icon of teh button will not change on the switching of the theme.

1110

Debugging line!

This revision now requires changes to proceed.Aug 6 2016, 10:17 AM
tantsevov updated this revision to Diff 5710.Aug 7 2016, 7:49 AM
tantsevov edited edge metadata.
This comment was removed by tantsevov.

Ouch. My bad! Wrong console usage.

tantsevov updated this revision to Diff 5712.Aug 7 2016, 12:24 PM
tantsevov edited edge metadata.
tantsevov removed R37 Krita as the repository for this revision.

Update button icons.

dkazakov requested changes to this revision.Aug 8 2016, 5:38 AM
dkazakov edited edge metadata.

As we discussed in telegram, this patch crashes Liquify tool and the ScratchPad. The switch should also work in them.

This revision now requires changes to proceed.Aug 8 2016, 5:38 AM
dkazakov accepted this revision.Aug 8 2016, 9:37 AM
dkazakov edited edge metadata.
This revision is now accepted and ready to land.Aug 8 2016, 9:37 AM
This revision was automatically updated to reflect the committed changes.
tantsevov edited edge metadata.Sep 27 2016, 8:09 PM