Bug 392070 - right click in number boxes in edit brush settings opens popup instead of allowing to type numbers.
Summary: right click in number boxes in edit brush settings opens popup instead of all...
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: Usability (show other bugs)
Version: 4.0.1
Platform: Other Microsoft Windows
: NOR wishlist
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-03-19 16:46 UTC by nikola
Modified: 2019-04-09 11:44 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Different behavior on right click (228.28 KB, image/png)
2018-03-19 16:46 UTC, nikola
Details

Note You need to log in before you can comment on or make changes to this bug.
Description nikola 2018-03-19 16:46:35 UTC
Created attachment 111514 [details]
Different behavior on right click

There are 2 different behaviors of controls responding on right click. Intention is to enter exact number value by typing it in control instead of choosing it by moving slider.

1. in "Edit brush settings" panel control open popup (undo, redo, cut, copy, paste, delete, select All)
2. in tool options panel similar control allow numeric entry without opening popup

Both reactions are printscreened and can be viewed in attachment.

First behavior is not acceptable. To enter numbers it is needed to right click on control and to close popup by clicking outside. Even functionalities that offer popup are easier to do in 2. type of control.

WISH: make controls in "Edit brush settings" panel behave like ones in "Tool Options" or similar controls in menubar for Opacity, Size...
Comment 1 Scott Petrovic 2018-03-19 16:54:54 UTC
This would need discussion. There is a right click menu in the brush settings when over the sliders. This was probably put there for a reason, so we want to make sure people don't need this before we would remove it potentially.
Comment 2 nikola 2018-03-19 19:49:13 UTC
It is hard to think of usability reasons. Numbers that users want to enter manualy are small and faster to type than to copy and paste from clipboard via popup menu (e.g. for rotation: 90, 180, 270; for brush size 128). Novice users can use slider method.
Proposal
How about adding a setting (checkbox?) in preferences that omit this popup. It could be "only beta feature" so users can test it and discuss from experience before final decision is made.
Note
In Blender3D there is similar control that opens popup on right click. Left click allows direct input instead of using slider. Slider responds on left click + drag. I prefer Krita slider in Tool Options :)
Comment 3 Halla Rempt 2018-03-20 07:10:05 UTC
Hm, I think that the right-click menu for the brush editor shouldn't override the right-click for the super spinboxes, but I'm not sure how to actually setup everything to make that work. Qt is rather confusing in this area.
Comment 4 nikola 2018-03-20 13:59:31 UTC
I found workaround by accident:
right click on arrows (up or down) on right side instead of slider. Popup doesn't appear.
Tested only on windows version of Krita.
Comment 5 nikola 2019-04-09 00:56:07 UTC
I don't know if this can be of any help but for me this added line:

d->edit->setContextMenuPolicy(Qt::PreventContextMenu);

in constructor of KisAbstractSliderSpinBox make context-menu disappear. Right click seem to work as it should. Can the solution be somewhere nearby?
Comment 6 vanyossi 2019-04-09 05:09:04 UTC
Funny, I always set the sliders to specifyc numbers like this:

left click on the slider to set
Press Ctrl once
Set number value
Intro

nikola: On which file? can you make a patch?
Comment 7 nikola 2019-04-09 07:43:29 UTC
I don't know how to submit patch. The file is kis_slider_spin_box.cpp in C:\dev\krita\libs\ui\widgets on my Windows platform. I hope somebody with more knowledge will look further and test on various platforms and eventually patch.

Added line is marked commented with // ++

    //Make edit transparent
    d->edit->setAutoFillBackground(false);
    QPalette pal = d->edit->palette();
    pal.setColor(QPalette::Base, Qt::transparent);
    d->edit->setPalette(pal);
    d->edit->setContextMenuPolicy(Qt::PreventContextMenu); // ++
    connect(d->edit, SIGNAL(editingFinished()), this, SLOT(editLostFocus()));
Comment 8 Halla Rempt 2019-04-09 11:44:13 UTC
Git commit 5666128c4ef7acd703620ef166d066b41fb1903b by Boudewijn Rempt.
Committed on 09/04/2019 at 11:29.
Pushed by rempt into branch 'master'.

Disable the redundant edit menu for the slider spinboxes

M  +1    -3    libs/ui/widgets/kis_slider_spin_box.cpp

https://commits.kde.org/krita/5666128c4ef7acd703620ef166d066b41fb1903b