Showing brush size in the detailed brush preset list in the brush preset docker
ClosedPublic

Authored by neviril on Nov 1 2017, 1:50 AM.

Details

Reviewers
rempt
Group Reviewers
Krita
Summary

This patch shows brush size to the left of brush preset names in the brush preset docker (detailed view), as often is the case in other painting applications (like for example MediBang Paint). In a previous code submission, the displayed brush size was initially rounded to the nearest integer, which led to a very simple patch (1 and "a half" lines edited in total) and very compact display size, but it quickly turned out that this might not be ideal for very small brushes where subpixel size differences do matter.

For aesthetic reasons and to save space (1-2 characters) it makes sense to avoid showing the decimal portion when brush size exceeds a certain (arbitrary) value. I couldn't unfortunately manage to find an obvious way to this in one line that could work even for very large brush sizes (e.g. 10000px, albeit currently not supported). While the current code works, it adds clutter to the source file. The alternative could be simply always using a 2-digit floating precision, like the brush size shown in the upper Krita toolbar.

Below is a sample image showing how different brush sizes are displayed on Windows with the proposed patch.

As I noted in https://phabricator.kde.org/T7386 there might be some quirks depending on whether the option to temporarily save brush preset changes is enabled or not.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
neviril created this revision.Nov 1 2017, 1:50 AM
woltherav added a subscriber: woltherav.

Adding reviewers :)

rempt accepted this revision.Nov 1 2017, 9:44 AM
rempt added a subscriber: rempt.

Hm... This looks quite useful, though the same information sometimes reoccurs in the preset name. I have half a mind that it might be better to make an option for this, but only half a mind :-) I'm fine with this going in as is.

This revision is now accepted and ready to land.Nov 1 2017, 9:44 AM

I think it's good. We probably shouldn't be putting setting numbers inside of preset names like we do now anyway.

scottpetrovic closed this revision.Nov 1 2017, 1:38 PM

just pushed to master...closing