From 3172773f52fc4703631dae2495d15a2b42632d2e Mon Sep 17 00:00:00 2001 From: Henning Gruendl Date: Fri, 7 Jun 2019 18:24:09 +0200 Subject: [PATCH] QmlDesigner: Add more studio controls * Add alignment button rows with new controls * Add font style buttons with new controls * Add anchor button rows with new controls * Fix CheckBox error about undefined assignment * Add new colors in ColorLogic * Fix low contrast for edit mode text color ComboBox, SpinBox, LineEdit * Add new icon font * Fix TranslationIcon background color * Some minor import refactoring Change-Id: If014c3351fd33ccaf893a31033c893e13ee04821 Reviewed-by: Thomas Hartmann --- .../QtQuick/AnchorRow.qml | 82 +++++++++++++++++- .../AligmentHorizontalButtons.qml | 77 +++++++++------- .../HelperWidgets/AligmentVerticalButtons.qml | 78 ++++++++++------- .../imports/HelperWidgets/AnchorButtons.qml | 67 ++++++++------ .../HelperWidgets/BoolButtonRowButton.qml | 41 ++++----- .../imports/HelperWidgets/CheckBox.qml | 12 +-- .../imports/HelperWidgets/ColorLogic.qml | 7 +- .../imports/HelperWidgets/ComboBox.qml | 7 +- .../HelperWidgets/ExtendedFunctionLogic.qml | 2 +- .../HelperWidgets/FontStyleButtons.qml | 27 +++--- .../imports/HelperWidgets/LineEdit.qml | 7 +- .../imports/HelperWidgets/SpinBox.qml | 3 +- .../imports/StudioControls/AbstractButton.qml | 1 + .../imports/StudioControls/Button.qml | 5 ++ .../imports/StudioControls/ButtonRow.qml | 3 +- .../StudioControls/TranslationIndicator.qml | 3 +- .../imports/StudioTheme/Constants.qml | 42 +++++---- .../imports/StudioTheme/icons.ttf | Bin 4300 -> 5280 bytes 18 files changed, 308 insertions(+), 156 deletions(-) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml index 567093359ce..2800f89539e 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/QtQuick/AnchorRow.qml @@ -29,6 +29,9 @@ import QtQuick.Layouts 1.0 import QtQuick.Controls 1.0 as Controls import QtQuickDesignerTheme 1.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + RowLayout { id: anchorRow @@ -71,7 +74,7 @@ RowLayout { rows: 2 columns: 2 - Controls.Label { + Label { text: qsTr("Target") color: __defaultTextColor elide: Text.ElideRight @@ -85,7 +88,7 @@ RowLayout { } } - Controls.Label { + Label { text: "Margin" color: __defaultTextColor elide: Text.ElideRight @@ -99,6 +102,80 @@ RowLayout { backendValue: anchorMargin } + StudioControls.ButtonRow { + id: buttonRow + actionIndicatorVisible: false + + property variant relativeTarget: anchorBackend.relativeAnchorTargetTop + + onRelativeTargetChanged: { + + buttonSameEdge.checked = false + buttonCenter.checked = false + buttonOppositeEdge.checked = false + + if (relativeTarget == AnchorBindingProxy.SameEdge) { + if (!invertRelativeTargets) { + buttonSameEdge.checked = true + } else { + buttonOppositeEdge.checked = true + } + } else if (relativeTarget == AnchorBindingProxy.OppositeEdge) { + if (!invertRelativeTargets) { + buttonOppositeEdge.checked = true + } else { + buttonSameEdge.checked = true + } + } else if (relativeTarget == AnchorBindingProxy.Center) { + buttonCenter.checked = true + } + } + + StudioControls.ButtonGroup { + id: group + } + + StudioControls.AbstractButton { + id: buttonSameEdge + buttonIcon: verticalAnchor ? StudioTheme.Constants.anchorTop : StudioTheme.Constants.anchorLeft + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + //tooltip: verticalAnchor ? qsTr("Anchor to the top of the target.") : qsTr("Anchor to the left of the target.") + onClicked: { + if (!invertRelativeTargets) + sameEdgeButtonClicked(); + else + oppositeEdgeButtonClicked(); + } + } + StudioControls.AbstractButton { + id: buttonCenter + buttonIcon: verticalAnchor ? StudioTheme.Constants.centerVertical : StudioTheme.Constants.centerHorizontal + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + //tooltip: verticalAnchor ? qsTr("Anchor to the vertical center of the target.") : qsTr("Anchor to the horizontal center of the target.") + onClicked: centerButtonClicked(); + } + StudioControls.AbstractButton { + id: buttonOppositeEdge + buttonIcon: verticalAnchor ? StudioTheme.Constants.anchorBottom : StudioTheme.Constants.anchorRight + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + //tooltip: verticalAnchor ? qsTr("Anchor to the bottom of the target.") : qsTr("Anchor to the right of the target.") + onClicked: { + if (!invertRelativeTargets) + oppositeEdgeButtonClicked(); + else + sameEdgeButtonClicked(); + } + } + } + + +/* ButtonRow { id: buttonRow @@ -157,6 +234,7 @@ RowLayout { } } } +*/ } } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml index af29773ce26..bb545d23699 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentHorizontalButtons.qml @@ -25,21 +25,12 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme Row { id: alignmentHorizontalButtons - RoundedPanel { - width: 16 - height: parent.height - roundLeft: true - ExtendedFunctionButton { - x: 2 - anchors.verticalCenter: parent.verticalCenter - backendValue: alignmentHorizontalButtons.backendValue - } - } - property bool blueHighlight: false property variant backendValue: backendValues.horizontalAlignment; @@ -48,19 +39,20 @@ Row { property bool baseStateFlag: isBaseState; + property color __currentColor: blueHighlight ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor + onValueChanged: { - buttonRow.initalChecked = 0 - buttonRow.checkedIndex = 0 + buttonAlignLeft.checked = true + buttonAlignHCenter.checked = false + buttonAlignRight.checked = false + if (value !== undefined) { if (value === "AlignLeft") { - buttonRow.initalChecked = 0 - buttonRow.checkedIndex = 0 + buttonAlignLeft.checked = true } else if (value === "AlignHCenter") { - buttonRow.initalChecked = 1 - buttonRow.checkedIndex = 1 + buttonAlignHCenter.checked = true } else if (value === "AlignRight") { - buttonRow.initalChecked = 2 - buttonRow.checkedIndex = 2 + buttonAlignRight.checked = true } } evaluate() @@ -89,27 +81,54 @@ Row { } } - ButtonRow { - id: buttonRow - exclusive: true + ExtendedFunctionLogic { + id: extFuncLogic + backendValue: alignmentHorizontalButtons.backendValue + } - ButtonRowButton { - roundLeftButton: false - iconSource: "image://icons/alignment-left" + (blueHighlight ? "-h" : "") + StudioControls.ButtonRow { + id: buttonRow + actionIndicatorVisible: true + + actionIndicator.icon.color: extFuncLogic.color + actionIndicator.icon.text: extFuncLogic.glyph + actionIndicator.onClicked: extFuncLogic.show() + + StudioControls.ButtonGroup { + id: group + } + + StudioControls.AbstractButton { + id: buttonAlignLeft + buttonIcon: StudioTheme.Constants.textAlignLeft + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignLeft") } } - ButtonRowButton { - iconSource: "image://icons/alignment-center" + (blueHighlight ? "-h" : "") + StudioControls.AbstractButton { + id: buttonAlignHCenter + buttonIcon: StudioTheme.Constants.textAlignCenter + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignHCenter") } } - ButtonRowButton { - iconSource: "image://icons/alignment-right" + (blueHighlight ? "-h" : "") + StudioControls.AbstractButton { + id: buttonAlignRight + buttonIcon: StudioTheme.Constants.textAlignRight + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignRight") diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml index ac3bd20f358..d74fa5d66ec 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AligmentVerticalButtons.qml @@ -25,22 +25,12 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme Row { id: alignmentVerticalButtons - RoundedPanel { - width: 16 - height: parent.height - roundLeft: true - - ExtendedFunctionButton { - x: 2 - anchors.verticalCenter: parent.verticalCenter - backendValue: alignmentVerticalButtons.backendValue - } - } - property bool blueHighlight: false property variant backendValue: backendValues.verticalAlignment; @@ -49,19 +39,20 @@ Row { property bool baseStateFlag: isBaseState; + property color __currentColor: blueHighlight ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor + onValueChanged: { - buttonRow.initalChecked = 0 - buttonRow.checkedIndex = 0 + buttonAlignTop.checked = true + buttonAlignVCenter.checked = false + buttonAlignBottom.checked = false + if (value !== undefined) { if (value === "AlignTop") { - buttonRow.initalChecked = 0 - buttonRow.checkedIndex = 0 + buttonAlignTop.checked = true } else if (value === "AlignVCenter") { - buttonRow.initalChecked = 1 - buttonRow.checkedIndex = 1 + buttonAlignVCenter.checked = true } else if (value === "AlignBottom") { - buttonRow.initalChecked = 2 - buttonRow.checkedIndex = 2 + buttonAlignBottom.checked = true } } evaluate() @@ -90,27 +81,54 @@ Row { } } - ButtonRow { - id: buttonRow - exclusive: true + ExtendedFunctionLogic { + id: extFuncLogic + backendValue: alignmentVerticalButtons.backendValue + } - ButtonRowButton { - roundLeftButton: false - iconSource: "image://icons/alignment-top" + (blueHighlight ? "-h" : "") + StudioControls.ButtonRow { + id: buttonRow + actionIndicatorVisible: true + + actionIndicator.icon.color: extFuncLogic.color + actionIndicator.icon.text: extFuncLogic.glyph + actionIndicator.onClicked: extFuncLogic.show() + + StudioControls.ButtonGroup { + id: group + } + + StudioControls.AbstractButton { + id: buttonAlignTop + buttonIcon: StudioTheme.Constants.textAlignTop + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignTop") } } - ButtonRowButton { - iconSource: "image://icons/alignment-middle" + (blueHighlight ? "-h" : "") + StudioControls.AbstractButton { + id: buttonAlignVCenter + buttonIcon: StudioTheme.Constants.textAlignMiddle + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignVCenter") } } - ButtonRowButton { - iconSource: "image://icons/alignment-bottom" + (blueHighlight ? "-h" : "") + StudioControls.AbstractButton { + id: buttonAlignBottom + buttonIcon: StudioTheme.Constants.textAlignBottom + checkable: true + autoExclusive: true + StudioControls.ButtonGroup.group: group + iconColor: __currentColor onClicked: { if (checked) backendValue.setEnumeration("Text", "AlignBottom") diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml index e7f9859ee49..963f578221a 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/AnchorButtons.qml @@ -25,23 +25,32 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme + +StudioControls.ButtonRow { + id: buttonRow -ButtonRow { enabled: anchorBackend.hasParent opacity: enabled ? 1 : 0.5 - id: buttonRow + actionIndicatorVisible: false - ButtonRowButton { - iconSource: "image://icons/anchor-top" - tooltip: qsTr("Anchor item to the top.") + StudioControls.ButtonGroup { + id: group + } + + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorTop + //tooltip: qsTr("Anchor item to the top.") property bool topAnchored: anchorBackend.topAnchored onTopAnchoredChanged: { checked = topAnchored } - onClicked: { + onClicked: { if (checked) { if (anchorBackend.bottomAnchored) anchorBackend.verticalCentered = false; @@ -52,9 +61,10 @@ ButtonRow { } } - ButtonRowButton { - iconSource: "image://icons/anchor-bottom" - tooltip: qsTr("Anchor item to the bottom.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorBottom + //tooltip: qsTr("Anchor item to the bottom.") property bool bottomAnchored: anchorBackend.bottomAnchored onBottomAnchoredChanged: { @@ -73,9 +83,10 @@ ButtonRow { } - ButtonRowButton { - iconSource: "image://icons/anchor-left" - tooltip: qsTr("Anchor item to the left.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorLeft + //tooltip: qsTr("Anchor item to the left.") property bool leftAnchored: anchorBackend.leftAnchored onLeftAnchoredChanged: { @@ -93,9 +104,10 @@ ButtonRow { } } - ButtonRowButton { - iconSource: "image://icons/anchor-right" - tooltip: qsTr("Anchor item to the right.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorRight + //tooltip: qsTr("Anchor item to the right.") property bool rightAnchored: anchorBackend.rightAnchored onRightAnchoredChanged: { @@ -113,14 +125,15 @@ ButtonRow { } } - ButtonRowButton { + StudioControls.AbstractButton { enabled: false } - ButtonRowButton { - iconSource: "image://icons/anchor-fill" - tooltip: qsTr("Fill parent item.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.anchorFill + //tooltip: qsTr("Fill parent item.") property bool isFilled: anchorBackend.isFilled onIsFilledChanged: { @@ -136,13 +149,14 @@ ButtonRow { } } - ButtonRowButton { + StudioControls.AbstractButton { enabled: false } - ButtonRowButton { - iconSource: "image://icons/anchor-vertical" - tooltip: qsTr("Anchor item vertically.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.centerVertical + //tooltip: qsTr("Anchor item vertically.") property bool verticalCentered: anchorBackend.verticalCentered; onVerticalCenteredChanged: { @@ -162,9 +176,10 @@ ButtonRow { } } - ButtonRowButton { - iconSource: "image://icons/anchor-horizontal" - tooltip: qsTr("Anchor item horizontally.") + StudioControls.AbstractButton { + checkable: true + buttonIcon: StudioTheme.Constants.centerHorizontal + //tooltip: qsTr("Anchor item horizontally.") property bool horizontalCentered: anchorBackend.horizontalCentered; onHorizontalCenteredChanged: { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/BoolButtonRowButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/BoolButtonRowButton.qml index 2b413caaef3..45ff2619288 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/BoolButtonRowButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/BoolButtonRowButton.qml @@ -25,33 +25,31 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme -ButtonRowButton { - id: boolButtonRowButton +StudioControls.Button { + id: button property variant backendValue - property bool isHighlighted: false - property string standardIconSource - property string highlightedIconSource - - leftPadding: 18 - - iconSource: isHighlighted ? highlightedIconSource : standardIconSource + iconColor: isHighlighted ? StudioTheme.Values.themeInteraction : StudioTheme.Values.themeTextColor + actionIndicatorVisible: true + checkable: true QtObject { id: innerObject function evaluate() { if (innerObject.baseStateFlag) { - if (boolButtonRowButton.backendValue !== null + if (button.backendValue !== null && innerObject.isInModel) { isHighlighted = true } else { isHighlighted = false } } else { - if (boolButtonRowButton.backendValue !== null + if (button.backendValue !== null && innerObject.isInSubState) { isHighlighted = true } else { @@ -63,27 +61,30 @@ ButtonRowButton { property bool baseStateFlag: isBaseState onBaseStateFlagChanged: evaluate() - property bool isInModel: boolButtonRowButton.backendValue.isInModel + property bool isInModel: button.backendValue.isInModel onIsInModelChanged: evaluate() - property bool isInSubState: boolButtonRowButton.backendValue.isInSubState + property bool isInSubState: button.backendValue.isInSubState onIsInSubStateChanged: evaluate() - property variant theValue: boolButtonRowButton.backendValue.value + property variant theValue: button.backendValue.value onTheValueChanged: { evaluate() - boolButtonRowButton.checked = innerObject.theValue + button.checked = innerObject.theValue } } onCheckedChanged: { - boolButtonRowButton.backendValue.value = checked + button.backendValue.value = button.checked } - ExtendedFunctionButton { - backendValue: boolButtonRowButton.backendValue - x: 2 - anchors.verticalCenter: parent.verticalCenter + ExtendedFunctionLogic { + id: extFuncLogic + backendValue: button.backendValue } + + actionIndicator.icon.color: extFuncLogic.color + actionIndicator.icon.text: extFuncLogic.glyph + actionIndicator.onClicked: extFuncLogic.show() } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml index 8642b9d924c..e599088e426 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/CheckBox.qml @@ -24,10 +24,10 @@ ****************************************************************************/ import QtQuick 2.1 -import StudioControls 1.0 as Controls +import StudioControls 1.0 as StudioControls import QtQuick.Controls.Styles 1.1 -Controls.CheckBox { +StudioControls.CheckBox { id: checkBox property variant backendValue @@ -47,14 +47,14 @@ Controls.CheckBox { id: colorLogic backendValue: checkBox.backendValue onValueFromBackendChanged: { - if (checkBox.checked !== colorLogic.valueFromBackend) - checkBox.checked = colorLogic.valueFromBackend; + if (colorLogic.valueFromBackend !== undefined + && checkBox.checked !== colorLogic.valueFromBackend) + checkBox.checked = colorLogic.valueFromBackend } } onCheckedChanged: { if (backendValue.value !== checkBox.checked) - backendValue.value = checkBox.checked; + backendValue.value = checkBox.checked } - } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml index 97c03ea9215..4426e95cdeb 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ColorLogic.qml @@ -28,20 +28,21 @@ import QtQuick.Controls 1.1 as Controls import QtQuick.Controls.Styles 1.0 import QtQuickDesignerTheme 1.0 import "Constants.js" as Constants +import StudioTheme 1.0 as StudioTheme QtObject { id: innerObject property variant backendValue - property color textColor: Theme.color(Theme.PanelTextColorLight) + property color textColor: StudioTheme.Values.themeTextColor//Theme.color(Theme.PanelTextColorLight) property variant valueFromBackend: backendValue.value; property bool baseStateFlag: isBaseState; property bool isInModel: backendValue.isInModel; property bool isInSubState: backendValue.isInSubState; property bool highlight: textColor === __changedTextColor - property color __defaultTextColor: Theme.color(Theme.PanelTextColorLight) - readonly property color __changedTextColor: Theme.color(Theme.QmlDesigner_HighlightColor) + property color __defaultTextColor: StudioTheme.Values.themeTextColor//Theme.color(Theme.PanelTextColorLight) + readonly property color __changedTextColor: StudioTheme.Values.themeInteraction//Theme.color(Theme.QmlDesigner_HighlightColor) onBackendValueChanged: { evaluate(); diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml index 65178606324..62a285a52ba 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ComboBox.qml @@ -24,15 +24,16 @@ ****************************************************************************/ import QtQuick 2.1 -import StudioControls 1.0 as Controls import QtQuick.Controls.Styles 1.1 +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme -Controls.ComboBox { +StudioControls.ComboBox { id: comboBox property variant backendValue - labelColor: colorLogic.textColor + labelColor: edit ? StudioTheme.Values.themeTextColor : colorLogic.textColor property string scope: "Qt" property bool useInteger: false diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml index f6fdf3d2cbc..f64dd622206 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/ExtendedFunctionLogic.qml @@ -54,7 +54,7 @@ Item { // translations are a special case extendedFunctionButton.glyph = StudioTheme.Constants.actionIcon } else { - extendedFunctionButton.glyph = StudioTheme.Constants.closeCross + extendedFunctionButton.glyph = StudioTheme.Constants.actionIconBinding extendedFunctionButton.color = StudioTheme.Values.themeInteraction } } else { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml index 23e5db53e5f..ff06c1e1bdb 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/FontStyleButtons.qml @@ -25,6 +25,7 @@ import QtQuick 2.1 import HelperWidgets 2.0 +import StudioTheme 1.0 as StudioTheme ButtonRow { @@ -34,25 +35,31 @@ ButtonRow { property variant strikeout: backendValues.font_strikeout BoolButtonRowButton { - standardIconSource: "image://icons/style-bold" - highlightedIconSource: "image://icons/style-bold-h" + buttonIcon: StudioTheme.Constants.fontStyleBold backendValue: bold } + Item { + width: 4 + height: 4 + } BoolButtonRowButton { - standardIconSource: "image://icons/style-italic" - highlightedIconSource: "image://icons/style-italic-h" + buttonIcon: StudioTheme.Constants.fontStyleItalic backendValue: italic } + Item { + width: 4 + height: 4 + } BoolButtonRowButton { - standardIconSource: "image://icons/style-underline" - highlightedIconSource: "image://icons/style-underline-h" + buttonIcon: StudioTheme.Constants.fontStyleUnderline backendValue: underline } - + Item { + width: 4 + height: 4 + } BoolButtonRowButton { - standardIconSource: "image://icons/style-strikeout" - highlightedIconSource: "image://icons/style-strikeout-h" + buttonIcon: StudioTheme.Constants.fontStyleStrikethrough backendValue: strikeout } - } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml index 0dfa558c09e..90e222beadc 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/LineEdit.qml @@ -24,17 +24,18 @@ ****************************************************************************/ import QtQuick 2.2 -import StudioControls 1.0 as Controls +import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme import QtQuick.Controls.Styles 1.0 import QtQuickDesignerTheme 1.0 -Controls.TextField { +StudioControls.TextField { id: lineEdit property variant backendValue property color borderColor: "#222" property color highlightColor: "orange" - color: colorLogic.textColor + color: lineEdit.edit ? StudioTheme.Values.themeTextColor : colorLogic.textColor property bool showTranslateCheckBox: true translationIndicatorVisible: showTranslateCheckBox diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml index eb941166fe2..a8d3d03e06c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/SpinBox.qml @@ -26,6 +26,7 @@ import QtQuick 2.1 import QtQuick.Controls.Styles 1.1 import StudioControls 1.0 as StudioControls +import StudioTheme 1.0 as StudioTheme Item { id: wrapper @@ -91,7 +92,7 @@ Item { } } - labelColor: colorLogic.textColor + labelColor: edit ? StudioTheme.Values.themeTextColor : colorLogic.textColor onCompressedValueModified: { if (backendValue.value !== realValue) diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml index 6746508be26..4dec58d4b6c 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/AbstractButton.qml @@ -31,6 +31,7 @@ T.AbstractButton { id: myButton property alias buttonIcon: buttonIcon.text + property alias iconColor: buttonIcon.color property alias backgroundVisible: buttonBackground.visible implicitWidth: Math.max(implicitBackgroundWidth + leftInset + rightInset, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Button.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Button.qml index 40713d3ed13..42d7b3eda83 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Button.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/Button.qml @@ -31,9 +31,14 @@ ButtonRow { id: myButtonRow property alias buttonIcon: myAbstractButton.buttonIcon + property alias iconColor: myAbstractButton.iconColor property alias checkable: myAbstractButton.checkable + property alias checked: myAbstractButton.checked + + signal onCheckedChanged() AbstractButton { id: myAbstractButton + onCheckedChanged: myButtonRow.onCheckedChanged() } } diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml index 614847f3408..059c38ad2c3 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/ButtonRow.qml @@ -32,9 +32,8 @@ Row { // TODO When using Item as root it won't react to outer layout id: myButtonGroup - property alias actionIcon: actionIndicator.icon + property alias actionIndicator: actionIndicator - //property bool hover: myCheckBox.hovered // TODO property alias actionIndicatorVisible: actionIndicator.visible property real __actionIndicatorWidth: StudioTheme.Values.squareComponentWidth property real __actionIndicatorHeight: StudioTheme.Values.height diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml index 7b08347879b..7c4e0c90cec 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioControls/TranslationIndicator.qml @@ -108,8 +108,7 @@ Item { PropertyChanges { target: translationIndicatorBackground - //color: StudioTheme.Values.themeFocusDrag // TODO - color: "red" + color: StudioTheme.Values.themeInteraction // TODO } }, State { diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml index b3b4c58041a..207a154719b 100644 --- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml +++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Constants.qml @@ -37,24 +37,30 @@ QtObject { } readonly property string actionIcon: "\u0021" - readonly property string anchorBottom: "\u0022" - readonly property string anchorFill: "\u0023" - readonly property string anchorLeft: "\u0024" - readonly property string anchorRight: "\u0025" - readonly property string anchorTop: "\u0026" - readonly property string centerHorizontal: "\u0027" - readonly property string centerVertical: "\u0028" - readonly property string closeCross: "\u0029" - readonly property string fontStyleBold: "\u002A" - readonly property string fontStyleItalic: "\u002B" - readonly property string fontStyleStrikethrough: "\u002C" - readonly property string fontStyleUnderline: "\u002D" - readonly property string textAlignCenter: "\u002E" - readonly property string textAlignLeft: "\u002F" - readonly property string textAlignRight: "\u0030" - readonly property string tickIcon: "\u0031" - readonly property string upDownIcon: "\u0032" - readonly property string upDownSquare2: "\u0033" + readonly property string actionIconBinding: "\u0022" + readonly property string anchorBaseline: "\u0023" + readonly property string anchorBottom: "\u0024" + readonly property string anchorFill: "\u0025" + readonly property string anchorLeft: "\u0026" + readonly property string anchorRight: "\u0027" + readonly property string anchorTop: "\u0028" + readonly property string centerHorizontal: "\u0029" + readonly property string centerVertical: "\u002A" + readonly property string closeCross: "\u002B" + readonly property string fontStyleBold: "\u002C" + readonly property string fontStyleItalic: "\u002D" + readonly property string fontStyleStrikethrough: "\u002E" + readonly property string fontStyleUnderline: "\u002F" + readonly property string textAlignBottom: "\u0030" + readonly property string textAlignCenter: "\u0031" + readonly property string textAlignLeft: "\u0032" + readonly property string textAlignMiddle: "\u0033" + readonly property string textAlignRight: "\u0034" + readonly property string textAlignTop: "\u0035" + readonly property string tickIcon: "\u0036" + readonly property string triState: "\u0037" + readonly property string upDownIcon: "\u0038" + readonly property string upDownSquare2: "\u0039" readonly property font iconFont: Qt.font({ "family": controlIcons.name, diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/icons.ttf index d2bd44ad4ac760c93f8abf081d30aa11c7924633..9658c0178212b8847a96504a8b339fdc6ac0a77b 100644 GIT binary patch delta 2623 zcmX@3xInX>fsuiMftR6yftew|%`L>Y>uY}u1A|Bl0|SGMf3Ut$SZd-{1_s6m1_p+N z%942n#Z3=GUR3=9k`>50V!|Nk>EGcbtMFfcH1q~}zo z+0Od z7KV!q>I~crybQby>I_^AVGIon>llR?#2EM(I2hCz)W9SM13!cO}D=;WCs4%E91TZkLD(N%oF`5h8 zF^bDE@-eEbv9U9=iODmHnSsRQ7}=Tm7=;;Cm6Y`u?HI*DqGsx9`iyGqZ0yW@%<3Sm zX69z{jAG(qAf=2gva$!Aoka5mgG{BAnAIhDxS0!>g@g_X%P|+!bLbgLaOMkyX#U&I zWX{YEQXs|6&63Z|#wBu4M2LqupG8nif>%PEqd?Tr#^I2IqKasN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