QmlDesigner: Apply theming to transient scrollbars

Change-Id: Iea76d981447f2367615ce624da399ecb984cb662
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
Henning Gruendl
2023-09-01 15:53:39 +02:00
committed by Henning Gründl
parent b2ee8acafa
commit f4466ed7b6
8 changed files with 21 additions and 13 deletions

View File

@@ -342,6 +342,9 @@ public:
DSpopoutButtonBorder_hover,
DSpopoutButtonBorder_interaction,
DSpopoutButtonBorder_disabled,
DSscrollBarTrack,
DSscrollBarHandle,
DSscrollBarHandle_idle,
/*Legacy QtDS*/
DSiconColor,
@@ -365,8 +368,6 @@ public:
DSsliderHandleHover,
DSsliderHandleFocus,
DSsliderHandleInteraction,
DSscrollBarTrack,
DSscrollBarHandle,
DSsectionHeadBackground,
DSstateDefaultHighlight,
DSstateSeparatorColor,

View File

@@ -736,7 +736,8 @@ void StudioStyle::drawComplexControl(
bool enabled = scrollBar->state & QStyle::State_Enabled;
bool hovered = enabled && scrollBar->state & QStyle::State_MouseOver;
QColor buttonColor = hovered ? "#D9D9D9" : "#9B9B9B";
QColor buttonColor = creatorTheme()->color(hovered ? Theme::DSscrollBarHandle
: Theme::DSscrollBarHandle_idle);
QColor gradientStartColor = buttonColor.lighter(118);
QColor gradientStopColor = buttonColor;
if (hasTransientStyle) {
@@ -755,12 +756,12 @@ void StudioStyle::drawComplexControl(
painter->save();
painter->setPen(Qt::NoPen);
if (hasTransientStyle) {
QColor brushColor("#D9D9D9");
QColor brushColor(creatorTheme()->color(Theme::DSscrollBarTrack));
brushColor.setAlpha(0.3 * 255);
painter->setBrush(QBrush(brushColor));
painter->drawRoundedRect(scrollBarGroove, 4, 4);
} else {
painter->setBrush(QBrush("#773E3E"));
painter->setBrush(QBrush(creatorTheme()->color(Theme::DSscrollBarTrack)));
painter->drawRect(rect);
}
painter->restore();