forked from qt-creator/qt-creator
QmlDesigner: Apply theming to transient scrollbars
Change-Id: Iea76d981447f2367615ce624da399ecb984cb662 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
b2ee8acafa
commit
f4466ed7b6
@@ -8,6 +8,8 @@ import StudioTheme 1.0 as StudioTheme
|
|||||||
T.ScrollBar {
|
T.ScrollBar {
|
||||||
id: control
|
id: control
|
||||||
|
|
||||||
|
property StudioTheme.ControlStyle style: StudioTheme.Values.controlStyle
|
||||||
|
|
||||||
property bool show: false
|
property bool show: false
|
||||||
property bool otherInUse: false
|
property bool otherInUse: false
|
||||||
property bool isNeeded: control.size < 1.0
|
property bool isNeeded: control.size < 1.0
|
||||||
@@ -31,12 +33,12 @@ T.ScrollBar {
|
|||||||
implicitWidth: control.thickness
|
implicitWidth: control.thickness
|
||||||
implicitHeight: control.thickness
|
implicitHeight: control.thickness
|
||||||
radius: width / 2
|
radius: width / 2
|
||||||
color: "#D9D9D9"
|
color: control.inUse ? control.style.scrollBar.handleHover : control.style.scrollBar.handle
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
id: controlTrack
|
id: controlTrack
|
||||||
color: "#D9D9D9"
|
color: control.style.scrollBar.track
|
||||||
opacity: control.inUse || control.otherInUse ? 0.3 : 0.0
|
opacity: control.inUse || control.otherInUse ? 0.3 : 0.0
|
||||||
radius: width / 2
|
radius: width / 2
|
||||||
|
|
||||||
|
@@ -150,7 +150,8 @@ QtObject {
|
|||||||
|
|
||||||
component ScrollBarColors: QtObject {
|
component ScrollBarColors: QtObject {
|
||||||
property color track: Values.themeScrollBarTrack
|
property color track: Values.themeScrollBarTrack
|
||||||
property color handle: Values.themeScrollBarHandle
|
property color handle: Values.themeScrollBarHandle_idle
|
||||||
|
property color handleHover: Values.themeScrollBarHandle
|
||||||
}
|
}
|
||||||
|
|
||||||
property ScrollBarColors scrollBar: ScrollBarColors {}
|
property ScrollBarColors scrollBar: ScrollBarColors {}
|
||||||
|
@@ -383,6 +383,7 @@ QtObject {
|
|||||||
|
|
||||||
property color themeScrollBarTrack: Theme.color(Theme.DSscrollBarTrack)
|
property color themeScrollBarTrack: Theme.color(Theme.DSscrollBarTrack)
|
||||||
property color themeScrollBarHandle: Theme.color(Theme.DSscrollBarHandle)
|
property color themeScrollBarHandle: Theme.color(Theme.DSscrollBarHandle)
|
||||||
|
property color themeScrollBarHandle_idle: Theme.color(Theme.DSscrollBarHandle_idle)
|
||||||
|
|
||||||
property color themeSectionHeadBackground: Theme.color(Theme.DSsectionHeadBackground)
|
property color themeSectionHeadBackground: Theme.color(Theme.DSsectionHeadBackground)
|
||||||
|
|
||||||
|
@@ -21,7 +21,7 @@ QtObject {
|
|||||||
pixelSize: Qt.application.font.pixelSize * 1.6
|
pixelSize: Qt.application.font.pixelSize * 1.6
|
||||||
})
|
})
|
||||||
|
|
||||||
readonly property color backgroundColor: "#c2c2c2"
|
readonly property color backgroundColor: "#EAEAEA"
|
||||||
|
|
||||||
|
|
||||||
@if %{IsQt6Project}
|
@if %{IsQt6Project}
|
||||||
|
@@ -169,8 +169,9 @@ DSsliderHandleHover=ff606060
|
|||||||
DSsliderHandleFocus=ff0492c9
|
DSsliderHandleFocus=ff0492c9
|
||||||
DSsliderHandleInteraction=ff2aafd3
|
DSsliderHandleInteraction=ff2aafd3
|
||||||
|
|
||||||
DSscrollBarTrack=ffb5b4b4
|
DSscrollBarTrack=smokeGrey
|
||||||
DSscrollBarHandle=ff9b9b9b
|
DSscrollBarHandle=shadowGrey
|
||||||
|
DSscrollBarHandle_idle=slateGrey
|
||||||
|
|
||||||
DSsectionHeadBackground=ffd8d8d8
|
DSsectionHeadBackground=ffd8d8d8
|
||||||
|
|
||||||
|
@@ -135,8 +135,9 @@ DSnavigatorTextSelected=highlightBlue
|
|||||||
QmlDesigner_BackgroundColorDarkAlternate=dawnGrey
|
QmlDesigner_BackgroundColorDarkAlternate=dawnGrey
|
||||||
|
|
||||||
;TODO
|
;TODO
|
||||||
DSscrollBarTrack=dawnGrey
|
DSscrollBarTrack=smokeGrey
|
||||||
DSscrollBarHandle=offBlack
|
DSscrollBarHandle=concreteGrey
|
||||||
|
DSscrollBarHandle_idle=slateGrey
|
||||||
|
|
||||||
DSdockWidgetTitleBar=dawnGrey
|
DSdockWidgetTitleBar=dawnGrey
|
||||||
DSdockWidgetSplitter=fullBlack
|
DSdockWidgetSplitter=fullBlack
|
||||||
|
@@ -342,6 +342,9 @@ public:
|
|||||||
DSpopoutButtonBorder_hover,
|
DSpopoutButtonBorder_hover,
|
||||||
DSpopoutButtonBorder_interaction,
|
DSpopoutButtonBorder_interaction,
|
||||||
DSpopoutButtonBorder_disabled,
|
DSpopoutButtonBorder_disabled,
|
||||||
|
DSscrollBarTrack,
|
||||||
|
DSscrollBarHandle,
|
||||||
|
DSscrollBarHandle_idle,
|
||||||
|
|
||||||
/*Legacy QtDS*/
|
/*Legacy QtDS*/
|
||||||
DSiconColor,
|
DSiconColor,
|
||||||
@@ -365,8 +368,6 @@ public:
|
|||||||
DSsliderHandleHover,
|
DSsliderHandleHover,
|
||||||
DSsliderHandleFocus,
|
DSsliderHandleFocus,
|
||||||
DSsliderHandleInteraction,
|
DSsliderHandleInteraction,
|
||||||
DSscrollBarTrack,
|
|
||||||
DSscrollBarHandle,
|
|
||||||
DSsectionHeadBackground,
|
DSsectionHeadBackground,
|
||||||
DSstateDefaultHighlight,
|
DSstateDefaultHighlight,
|
||||||
DSstateSeparatorColor,
|
DSstateSeparatorColor,
|
||||||
|
@@ -736,7 +736,8 @@ void StudioStyle::drawComplexControl(
|
|||||||
bool enabled = scrollBar->state & QStyle::State_Enabled;
|
bool enabled = scrollBar->state & QStyle::State_Enabled;
|
||||||
bool hovered = enabled && scrollBar->state & QStyle::State_MouseOver;
|
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 gradientStartColor = buttonColor.lighter(118);
|
||||||
QColor gradientStopColor = buttonColor;
|
QColor gradientStopColor = buttonColor;
|
||||||
if (hasTransientStyle) {
|
if (hasTransientStyle) {
|
||||||
@@ -755,12 +756,12 @@ void StudioStyle::drawComplexControl(
|
|||||||
painter->save();
|
painter->save();
|
||||||
painter->setPen(Qt::NoPen);
|
painter->setPen(Qt::NoPen);
|
||||||
if (hasTransientStyle) {
|
if (hasTransientStyle) {
|
||||||
QColor brushColor("#D9D9D9");
|
QColor brushColor(creatorTheme()->color(Theme::DSscrollBarTrack));
|
||||||
brushColor.setAlpha(0.3 * 255);
|
brushColor.setAlpha(0.3 * 255);
|
||||||
painter->setBrush(QBrush(brushColor));
|
painter->setBrush(QBrush(brushColor));
|
||||||
painter->drawRoundedRect(scrollBarGroove, 4, 4);
|
painter->drawRoundedRect(scrollBarGroove, 4, 4);
|
||||||
} else {
|
} else {
|
||||||
painter->setBrush(QBrush("#773E3E"));
|
painter->setBrush(QBrush(creatorTheme()->color(Theme::DSscrollBarTrack)));
|
||||||
painter->drawRect(rect);
|
painter->drawRect(rect);
|
||||||
}
|
}
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
Reference in New Issue
Block a user