summaryrefslogtreecommitdiff
path: root/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItemWithIcon.qml
diff options
context:
space:
mode:
Diffstat (limited to 'share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItemWithIcon.qml')
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItemWithIcon.qml34
1 files changed, 18 insertions, 16 deletions
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItemWithIcon.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItemWithIcon.qml
index 14588ad556..e6bd35e8c4 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItemWithIcon.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/MenuItemWithIcon.qml
@@ -1,15 +1,17 @@
-// Copyright (C) 2021 The Qt Company Ltd.
+// Copyright (C) 2023 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
-import QtQuick 2.15
-import QtQuick.Controls 2.15
-import QtQuick.Templates 2.15 as T
+import QtQuick
+import QtQuick.Controls
+import QtQuick.Templates as T
import StudioTheme 1.0 as StudioTheme
T.MenuItem {
id: control
- property int labelSpacing: StudioTheme.Values.contextMenuLabelSpacing
+ property StudioTheme.ControlStyle style: StudioTheme.Values.controlStyle
+
+ property int labelSpacing: control.style.contextMenuLabelSpacing
implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset,
implicitContentWidth + leftPadding + rightPadding)
@@ -20,7 +22,7 @@ T.MenuItem {
padding: 0
spacing: 0
- horizontalPadding: StudioTheme.Values.contextMenuHorizontalPadding
+ horizontalPadding: control.style.contextMenuHorizontalPadding
action: Action {}
contentItem: Item {
@@ -28,18 +30,18 @@ T.MenuItem {
id: iconLabel
text: control.checked ? StudioTheme.Constants.tickIcon : ""
visible: true
- color: control.enabled ? StudioTheme.Values.themeTextColor : StudioTheme.Values.themeTextColorDisabled
+ color: control.enabled ? control.highlighted ? control.style.text.selectedText : control.style.text.idle : control.style.text.disabled
font.family: StudioTheme.Constants.iconFont.family
- font.pixelSize: StudioTheme.Values.myIconFontSize
+ font.pixelSize: control.style.baseIconFontSize
anchors.verticalCenter: parent.verticalCenter
}
Text {
id: textLabel
- x: StudioTheme.Values.height
+ x: control.style.squareControlSize.width
text: control.text
font: control.font
- color: control.enabled ? StudioTheme.Values.themeTextColor : StudioTheme.Values.themeTextColorDisabled
+ color: control.enabled ? control.highlighted ? control.style.text.selectedText : control.style.text.idle : control.style.text.disabled
anchors.verticalCenter: parent.verticalCenter
}
}
@@ -47,11 +49,11 @@ T.MenuItem {
background: Rectangle {
implicitWidth: iconLabel.implicitWidth + textLabel.implicitWidth + control.labelSpacing
+ control.leftPadding + control.rightPadding
- implicitHeight: StudioTheme.Values.height
- x: StudioTheme.Values.border
- y: StudioTheme.Values.border
- width: control.menu.width - (StudioTheme.Values.border * 2)
- height: control.height - (StudioTheme.Values.border * 2)
- color: control.down ? control.palette.midlight : control.highlighted ? StudioTheme.Values.themeInteraction : "transparent"
+ implicitHeight: control.style.controlSize.height
+ x: control.style.borderWidth
+ y: control.style.borderWidth
+ width: control.menu.width - (control.style.borderWidth * 2)
+ height: control.height - (control.style.borderWidth * 2)
+ color: control.highlighted ? control.style.interaction : "transparent"
}
}