Bug 434915

Summary: Clear color history button remains visible in advanced color selector when Show color history is turned off
Product: [Applications] krita Reporter: nikola <nikola.knezevic.mne>
Component: UsabilityAssignee: Tiar <tamtamy.tymona>
Status: RESOLVED FIXED    
Severity: minor CC: acc4commissions, ahab.greybeard, info, tamtamy.tymona
Priority: NOR    
Version: nightly build (please specify the git hash!)   
Target Milestone: ---   
Platform: Microsoft Windows   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description nikola 2021-03-25 01:45:47 UTC
In Advanced Color Selector:

1. clear color history button should be hidden when color history palette is hidden.

2. when color history is aligned horizontally, button remains centered vertically (visualy disconnected from palette), taking up space unnecessary.

This behavior is present in Krita 5.0.0-prealpha from version when this button is introduced (current version: 5.0.0-prealpha/git dffcff1)
Comment 1 Halla Rempt 2021-03-30 12:10:38 UTC
*** Bug 435145 has been marked as a duplicate of this bug. ***
Comment 2 Ahab Greybeard 2021-04-01 06:07:07 UTC
I can confirm this for the Mar 30 5.0.0 (git 783e86c) appimage.

Colour history display orientation makes no difference.
If the colour history is disabled, the clear button is still there and it reduces the available space for the rest of the docker displey elements.
It also looks awkward and untidy.
Comment 3 Tiar 2021-08-24 13:52:47 UTC
Git commit bad2b20c02accdd6fb234afca885d3a7cc4cff96 by Agata Cacko.
Committed on 24/08/2021 at 13:52.
Pushed by tymond into branch 'master'.

Fix clear color history button layout

Before this commit, clear color history button was just added
to the side layout without even checking if the color history
is vertical. It caused bad look when the color history was located
horizontal (underneath the color selector).

This commit puts both the color history widget and the clear color
history button into its own layout. Depending on the direction
(horizontal or vertical), the layout is in that direction,
and the widgets are added in order: first color history, then the
button.

A solution of not creating its own ayout and using the existing
m_verticalColorPatchesLayout or m_horizontalColorPatchesLayout
wouldn't work, because for example the horizontalColorPatchesLayout
is in fact a QVBoxLayout, which means the widgets underneath the
color selector would be:
1) color history
2) clear color history button
3) color patches from the image
all placed one underneath the other.
But the desired result is different:
1) color history + clear color history button
2) color patches from the image
So this commit adds a new horizontal layout that is placed
in the (1) slot and contains both of the widgets.
The same goes for the other direction.

The new layouts also place the clear color history button aligned
centrally in the direction opposite to the layout
(central horizontal alignment in case of vertical color history,
and central vertical alignment for horizontal color history).

M  +27   -6    plugins/dockers/advancedcolorselector/kis_color_selector_ng_docker_widget.cpp
M  +3    -0    plugins/dockers/advancedcolorselector/kis_color_selector_ng_docker_widget.h

https://invent.kde.org/graphics/krita/commit/bad2b20c02accdd6fb234afca885d3a7cc4cff96
Comment 4 Halla Rempt 2021-08-25 08:35:30 UTC
Git commit e5fc9e2f6132e2c654306f0f8a44cc14dac4dc49 by Halla Rempt, on behalf of Agata Cacko.
Committed on 25/08/2021 at 08:25.
Pushed by rempt into branch 'krita/5.0'.

Fix clear color history button layout

Before this commit, clear color history button was just added
to the side layout without even checking if the color history
is vertical. It caused bad look when the color history was located
horizontal (underneath the color selector).

This commit puts both the color history widget and the clear color
history button into its own layout. Depending on the direction
(horizontal or vertical), the layout is in that direction,
and the widgets are added in order: first color history, then the
button.

A solution of not creating its own ayout and using the existing
m_verticalColorPatchesLayout or m_horizontalColorPatchesLayout
wouldn't work, because for example the horizontalColorPatchesLayout
is in fact a QVBoxLayout, which means the widgets underneath the
color selector would be:
1) color history
2) clear color history button
3) color patches from the image
all placed one underneath the other.
But the desired result is different:
1) color history + clear color history button
2) color patches from the image
So this commit adds a new horizontal layout that is placed
in the (1) slot and contains both of the widgets.
The same goes for the other direction.

The new layouts also place the clear color history button aligned
centrally in the direction opposite to the layout
(central horizontal alignment in case of vertical color history,
and central vertical alignment for horizontal color history).
(cherry picked from commit bad2b20c02accdd6fb234afca885d3a7cc4cff96)

M  +27   -6    plugins/dockers/advancedcolorselector/kis_color_selector_ng_docker_widget.cpp
M  +3    -0    plugins/dockers/advancedcolorselector/kis_color_selector_ng_docker_widget.h

https://invent.kde.org/graphics/krita/commit/e5fc9e2f6132e2c654306f0f8a44cc14dac4dc49
Comment 5 Tiar 2021-09-16 21:38:56 UTC
*** Bug 442561 has been marked as a duplicate of this bug. ***