aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMahmoud Badri <mahmoud.badri@qt.io>2021-03-16 00:08:36 +0200
committerMahmoud Badri <mahmoud.badri@qt.io>2021-03-16 09:16:21 +0000
commitf820164b1ab4edf0421ac2b222b51b1e12e5430c (patch)
tree47a62313c8eb97c615f0ea86503eecf3d80e78e5
parent23477f633bf1f83c25e2a7bc55c8462195035598 (diff)
QmlDesigner: Use a different color for unimported items section
Fixes: QDS-3873 Change-Id: Ic713353d8fe5c1bfb4ff11f1224294ecde182fa7 Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
-rw-r--r--share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml3
-rw-r--r--share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml4
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml1
-rw-r--r--share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml2
-rw-r--r--src/plugins/qmldesigner/components/itemlibrary/itemlibraryimport.h2
5 files changed, 12 insertions, 0 deletions
diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml
index 6e0724d86bb..3f59deb8061 100644
--- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml
+++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemDelegate.qml
@@ -31,6 +31,9 @@ import StudioTheme 1.0 as StudioTheme
Item {
id: delegateRoot
+
+ property alias textColor: text.color
+
signal showContextMenu()
Rectangle {
diff --git a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml
index 9f7c2b13b64..f4e69d31ae6 100644
--- a/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml
+++ b/share/qtcreator/qmldesigner/itemLibraryQmlSources/ItemsView.qml
@@ -155,6 +155,8 @@ ScrollView {
sectionHeight: 30
sectionFontSize: 15
showArrow: categoryModel.rowCount() > 0
+ labelColor: importUnimported ? StudioTheme.Values.themeUnimportedModuleColor
+ : StudioTheme.Values.themeTextColor
leftPadding: 0
rightPadding: 0
topPadding: 0
@@ -204,6 +206,8 @@ ScrollView {
model: itemModel
delegate: ItemDelegate {
visible: itemVisible
+ textColor: importUnimported ? StudioTheme.Values.themeUnimportedModuleColor
+ : StudioTheme.Values.themeTextColor
width: styleConstants.cellWidth + itemGrid.flexibleWidth
height: styleConstants.cellHeight
onShowContextMenu: {
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml
index cdc5780f523..57d0d65a771 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/HelperWidgets/Section.qml
@@ -32,6 +32,7 @@ import StudioTheme 1.0 as StudioTheme
Item {
id: section
property alias caption: label.text
+ property alias labelColor: label.color
property alias sectionHeight: header.height
property alias sectionBackgroundColor: header.color
property alias sectionFontSize: label.font.pixelSize
diff --git a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
index 0ea1e18746c..4fd5c23c6c8 100644
--- a/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
+++ b/share/qtcreator/qmldesigner/propertyEditorQmlSources/imports/StudioTheme/Values.qml
@@ -198,6 +198,8 @@ QtObject {
property string themeStateBackground: Theme.color(Theme.DSstateBackgroundColor)
property string themeStatePreviewOutline: Theme.color(Theme.DSstatePreviewOutline)
+ property string themeUnimportedModuleColor: "#e33c2e"
+
// Taken out of Constants.js
property string themeChangedStateText: Theme.color(Theme.DSchangedStateText)
diff --git a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryimport.h b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryimport.h
index 982e47df70e..997ca65c714 100644
--- a/src/plugins/qmldesigner/components/itemlibrary/itemlibraryimport.h
+++ b/src/plugins/qmldesigner/components/itemlibrary/itemlibraryimport.h
@@ -42,6 +42,7 @@ class ItemLibraryImport : public QObject
Q_PROPERTY(bool importUsed READ importUsed NOTIFY importUsedChanged FINAL)
Q_PROPERTY(bool importExpanded READ importExpanded WRITE setImportExpanded NOTIFY importExpandChanged FINAL)
Q_PROPERTY(bool importRemovable READ importRemovable NOTIFY importRemovableChanged FINAL)
+ Q_PROPERTY(bool importUnimported READ importUnimported FINAL)
Q_PROPERTY(QObject *categoryModel READ categoryModel NOTIFY categoryModelChanged FINAL)
public:
@@ -90,6 +91,7 @@ signals:
private:
void updateRemovable();
+ bool importUnimported() const { return m_sectionType == SectionType::Unimported; }
Import m_import;
bool m_importExpanded = true;