Krita is a free and open source cross-platform application that offers an end-to-end solution for creating digital art files from scratch built on the KDE and Qt frameworks.
C++
Try to improve orderning of qml components plugin.
Wolthera van Hövell tot Westerflier7171c167843c
diff --git a/qmlmodules/components/CMakeLists.txt b/qmlmodules/components/CMakeLists.txtindex 495374d8da..62bb66c489 100644--- a/qmlmodules/components/CMakeLists.txt+++ b/qmlmodules/components/CMakeLists.txt@@ -13,6 +13,10 @@ if (QT_MAJOR_VERSION STREQUAL "6")PRIVATESvgTextLabel.cppSvgTextLabel.h+ KisNumParser.cpp+ KisNumParser.h+ KisCubicCurveQMLWrapper.cpp+ KisCubicCurveQMLWrapper.h)else ()@@ -36,33 +40,48 @@ else ()endif ()-ecm_target_qml_sources(kritaqmlcomponents SOURCES-- qml/button/GroupButton.qml- qml/button/OptionButtonStrip.qml-+ecm_target_qml_sources(kritaqmlcomponents PRIVATE PATH textinput SOURCES+ qml/textinput/TextInputWithSelectionRange.qml+ qml/textinput/TextInputWithPrefixAndSuffix.qml+)++ecm_target_qml_sources(kritaqmlcomponents PRIVATE PATH overlays SOURCESqml/overlays/WarningOverlay.qmlqml/overlays/SliderOverlay.qml- qml/tooltip/KisToolTip.qml+)- qml/textinput/TextInputWithSelectionRange.qml- qml/textinput/TextInputWithPrefixAndSuffix.qml-+ecm_target_qml_sources(kritaqmlcomponents PRIVATE PATH spinbox SOURCESqml/spinbox/ParseSpinBoxContentItem.qml- qml/spinbox/IntParseSpinBox.qml- qml/spinbox/DoubleSpinBox.qml- qml/spinbox/DoubleParseSpinBox.qml+)+ecm_target_qml_sources(kritaqmlcomponents PRIVATE PATH sliderspinbox SOURCESqml/sliderspinbox/SliderSpinBoxManipulator.qmlqml/sliderspinbox/SliderSpinBoxRangeSwitch.qmlqml/sliderspinbox/SliderSpinBoxContentItem.qml- qml/sliderspinbox/IntSliderSpinBox.qml- qml/sliderspinbox/DoubleSliderSpinBox.qml+)- qml/curvewidget/CurveWidget.qml- qml/angleselector/AngleGauge.qml- qml/angleselector/AngleSelector.qml+ecm_target_qml_sources(kritaqmlcomponents PRIVATE PATH angleselector SOURCESqml/angleselector/AngleSelectorUtil.js+ qml/angleselector/AngleGauge.qml+)++ecm_target_qml_sources(kritaqmlcomponents SOURCES+ qml/button/GroupButton.qml+ qml/button/OptionButtonStrip.qml++ qml/IntParseSpinBox.qml+ qml/DoubleSpinBox.qml+ qml/DoubleParseSpinBox.qml++ qml/IntSliderSpinBox.qml+ qml/DoubleSliderSpinBox.qml++ qml/tooltip/KisToolTip.qml++ qml/curvewidget/CurveWidget.qml++ qml/AngleSelector.qml+)target_link_libraries(kritaqmlcomponentsdiff --git a/qmlmodules/components/qml/angleselector/AngleSelector.qml b/qmlmodules/components/qml/AngleSelector.qmlsimilarity index 98%rename from qmlmodules/components/qml/angleselector/AngleSelector.qmlrename to qmlmodules/components/qml/AngleSelector.qmlindex 1ee0e45068..eff7ee2814 100644--- a/qmlmodules/components/qml/angleselector/AngleSelector.qml+++ b/qmlmodules/components/qml/AngleSelector.qml@@ -5,8 +5,9 @@*/import QtQuick 2.15import QtQuick.Controls 2.15-import org.krita.components 1.0 as Kis-import "AngleSelectorUtil.js" as AngleSelectorUtil+import "angleselector"+import "tooltip"+import "angleselector/AngleSelectorUtil.js" as AngleSelectorUtil/*\qmltype AngleSelector@@ -212,7 +213,7 @@ FocusScope {spacing: 5anchors.fill: parent- Kis.AngleGauge {+ AngleGauge {id: angleGaugeanchors.verticalCenter: parent.verticalCenter@@ -232,7 +233,7 @@ FocusScope {}}- Kis.DoubleParseSpinBox {+ DoubleParseSpinBox {id: spinBoxanchors.verticalCenter: parent.verticalCenter@@ -306,7 +307,7 @@ FocusScope {display: AbstractButton.IconOnlyaction: actionFlipHorizontallyAndVerticallyicon.color: palette.buttonText;- Kis.KisToolTip {+ KisToolTip {parentControl: buttonFlipHorizontallyAndVerticallytext: actionFlipHorizontallyAndVertically.text}diff --git a/qmlmodules/components/qml/spinbox/DoubleParseSpinBox.qml b/qmlmodules/components/qml/DoubleParseSpinBox.qmlsimilarity index 98%rename from qmlmodules/components/qml/spinbox/DoubleParseSpinBox.qmlrename to qmlmodules/components/qml/DoubleParseSpinBox.qmlindex c2de104444..592d19e5cb 100644--- a/qmlmodules/components/qml/spinbox/DoubleParseSpinBox.qml+++ b/qmlmodules/components/qml/DoubleParseSpinBox.qml@@ -4,6 +4,7 @@* SPDX-License-Identifier: GPL-2.0-or-later*/import QtQuick 2.15+import "spinbox"/*\qmltype DoubleParseSpinBoxdiff --git a/qmlmodules/components/qml/sliderspinbox/DoubleSliderSpinBox.qml b/qmlmodules/components/qml/DoubleSliderSpinBox.qmlsimilarity index 98%rename from qmlmodules/components/qml/sliderspinbox/DoubleSliderSpinBox.qmlrename to qmlmodules/components/qml/DoubleSliderSpinBox.qmlindex 05006af481..c8f2a23243 100644--- a/qmlmodules/components/qml/sliderspinbox/DoubleSliderSpinBox.qml+++ b/qmlmodules/components/qml/DoubleSliderSpinBox.qml@@ -4,7 +4,7 @@* SPDX-License-Identifier: GPL-2.0-or-later*/import QtQuick 2.15-import org.krita.components 1.0 as Kis+import "sliderspinbox"/*\qmltype DoubleSliderSpinBox@@ -59,7 +59,7 @@ import org.krita.components 1.0 as KisThe "soft range" is considered valid if the "soft maximum" is greater thanthe "soft minimum".*/-Kis.DoubleSpinBox {+DoubleSpinBox {id: root/*@@ -142,7 +142,7 @@ Kis.DoubleSpinBox {contentItem: FocusScope {focus: true- Kis.SliderSpinBoxContentItem {+ SliderSpinBoxContentItem {id: contentIdanchors.fill: parentdiff --git a/qmlmodules/components/qml/spinbox/DoubleSpinBox.qml b/qmlmodules/components/qml/DoubleSpinBox.qmlsimilarity index 100%rename from qmlmodules/components/qml/spinbox/DoubleSpinBox.qmlrename to qmlmodules/components/qml/DoubleSpinBox.qmldiff --git a/qmlmodules/components/qml/spinbox/IntParseSpinBox.qml b/qmlmodules/components/qml/IntParseSpinBox.qmlsimilarity index 99%rename from qmlmodules/components/qml/spinbox/IntParseSpinBox.qmlrename to qmlmodules/components/qml/IntParseSpinBox.qmlindex 20190e7b59..eaa7d93043 100644--- a/qmlmodules/components/qml/spinbox/IntParseSpinBox.qml+++ b/qmlmodules/components/qml/IntParseSpinBox.qml@@ -5,6 +5,7 @@*/import QtQuick 2.15import QtQuick.Controls 2.15+import "spinbox"/*\qmltype IntParseSpinBoxdiff --git a/qmlmodules/components/qml/sliderspinbox/IntSliderSpinBox.qml b/qmlmodules/components/qml/IntSliderSpinBox.qmlsimilarity index 99%rename from qmlmodules/components/qml/sliderspinbox/IntSliderSpinBox.qmlrename to qmlmodules/components/qml/IntSliderSpinBox.qmlindex 89c8dbbf9c..a9eca30f8d 100644--- a/qmlmodules/components/qml/sliderspinbox/IntSliderSpinBox.qml+++ b/qmlmodules/components/qml/IntSliderSpinBox.qml@@ -5,6 +5,7 @@*/import QtQuick 2.15import QtQuick.Controls 2.15+import "sliderspinbox"/*\qmltype IntSliderSpinBox@@ -134,7 +135,7 @@ SpinBox {contentItem: FocusScope {focus: true- KisSliderSpinBoxContentItem {+ SliderSpinBoxContentItem {id: contentIdanchors.fill: parentdiff --git a/qmlmodules/components/qml/button/GroupButton.qml b/qmlmodules/components/qml/button/GroupButton.qmlindex 066a39da4c..acec104f1a 100644--- a/qmlmodules/components/qml/button/GroupButton.qml+++ b/qmlmodules/components/qml/button/GroupButton.qml@@ -72,7 +72,7 @@ Button {/sa GroupPosition*/- property int groupPosition: KisGroupButton.GroupPosition.NoGroup+ property int groupPosition: GroupButton.GroupPosition.NoGrouppalette.button: checked? sysPalette.highlight: sysPalette.button;palette.buttonText: checked? sysPalette.highlightedText: sysPalette.buttonText@@ -80,10 +80,10 @@ Button {clip: trueimplicitWidth: implicitContentWidth + (root.leftPadding ?? root.padding)+ (root.rightPadding ?? root.padding)- leftInset: (groupPosition === KisGroupButton.GroupPosition.GroupRight ||- groupPosition === KisGroupButton.GroupPosition.GroupCenter) * -50- rightInset: (groupPosition === KisGroupButton.GroupPosition.GroupLeft ||- groupPosition === KisGroupButton.GroupPosition.GroupCenter) * -50+ leftInset: (groupPosition === GroupButton.GroupPosition.GroupRight ||+ groupPosition === GroupButton.GroupPosition.GroupCenter) * -50+ rightInset: (groupPosition === GroupButton.GroupPosition.GroupLeft ||+ groupPosition === GroupButton.GroupPosition.GroupCenter) * -50Rectangle {width: 1@@ -91,7 +91,7 @@ Button {anchors.right: parent.rightcolor: root.palette.buttonText;opacity: 0.1;- visible: root.groupPosition === KisGroupButton.GroupPosition.GroupLeft ||- root.groupPosition === KisGroupButton.GroupPosition.GroupCenter+ visible: root.groupPosition === GroupButton.GroupPosition.GroupLeft ||+ root.groupPosition === GroupButton.GroupPosition.GroupCenter}}diff --git a/qmlmodules/components/qml/sliderspinbox/SliderSpinBoxContentItem.qml b/qmlmodules/components/qml/sliderspinbox/SliderSpinBoxContentItem.qmlindex 8fbe8a1de5..47ce7b7e39 100644--- a/qmlmodules/components/qml/sliderspinbox/SliderSpinBoxContentItem.qml+++ b/qmlmodules/components/qml/sliderspinbox/SliderSpinBoxContentItem.qml@@ -5,7 +5,8 @@*/import QtQuick 2.15import QtQuick.Controls 2.15-import org.krita.components 1.0 as Kis+import "../overlays"+import "../spinbox"/*\qmltype SliderSpinBoxContentItem@@ -151,15 +152,15 @@ FocusScope {color: root.parentSpinBox.palette.text//: @info:tooltip toggle between soft and hard range in the slider spin boxtoolTip: i18nc("@info:tooltip","Toggle between full range and subrange.\nFull range: [%1, %2]\nSubrange: [%3, %4]",- Number(root.from).toLocaleString(Qt.locale(), decimals),- Number(root.to).toLocaleString(Qt.locale(), decimals),- Number(root.softFrom).toLocaleString(Qt.locale(), decimals),- Number(root.softTo).toLocaleString(Qt.locale(), decimals));+ Number(root.from).toLocaleString(Qt.locale(), 'f', decimals),+ Number(root.to).toLocaleString(Qt.locale(), 'f', decimals),+ Number(root.softFrom).toLocaleString(Qt.locale(), 'f', decimals),+ Number(root.softTo).toLocaleString(Qt.locale(), 'f', decimals));onSoftRangeActiveChanged: root.softRangeActive = softRangeActive}- Kis.SliderOverlay {+ SliderOverlay {id: sliderOverlayproperty real value: parseSpinBoxContentItem.value@@ -177,7 +178,7 @@ FocusScope {exponentRatio: root.exponentRatio}- Kis.ParseSpinBoxContentItem {+ ParseSpinBoxContentItem {id: parseSpinBoxContentItemanchors.top: parent.topdiff --git a/qmlmodules/components/qml/spinbox/ParseSpinBoxContentItem.qml b/qmlmodules/components/qml/spinbox/ParseSpinBoxContentItem.qmlindex 1c7a4d62bd..31d9272878 100644--- a/qmlmodules/components/qml/spinbox/ParseSpinBoxContentItem.qml+++ b/qmlmodules/components/qml/spinbox/ParseSpinBoxContentItem.qml@@ -6,7 +6,9 @@import QtQml 2.15import QtQuick 2.15import QtQuick.Controls 2.15-import org.krita.components 1.0 as Kis+import "../textinput"+import "../overlays"+import org.krita.components 1.0/*\qmltype ParseSpinBoxContentItem@@ -104,7 +106,7 @@ FocusScope {onDecimalsChanged: textInput.contentsText = Number(root.value).toLocaleString(Qt.locale(), 'f', decimals);- Kis.WarningOverlay {+ WarningOverlay {id: warningOverlayanchors.fill: parentclip: true@@ -114,7 +116,7 @@ FocusScope {warningSignAlignment: Qt.AlignRight}- Kis.TextInputWithPrefixAndSuffix {+ TextInputWithPrefixAndSuffix {id: textInputproperty double parsedValue: 0.0@@ -141,7 +143,7 @@ FocusScope {}}- Kis.KisNumParser { id: numParser;}+ KisNumParser { id: numParser;}onContentsTextChanged: {parsedValue = numParser.parseSimpleMathExpr(contentsText);