Skip to content
Commit bad2b20c authored by Agata Cacko's avatar Agata Cacko
Browse files

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).

BUG:434915
parent ec904eba
Loading
Loading
Loading
Pipeline #76368 skipped with stage
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment