diff --git a/assets/qml/Dashboard/DashboardTitle.qml b/assets/qml/Dashboard/DashboardTitle.qml index c97ab966..9649c2ab 100644 --- a/assets/qml/Dashboard/DashboardTitle.qml +++ b/assets/qml/Dashboard/DashboardTitle.qml @@ -28,88 +28,70 @@ import Qt.labs.settings 1.1 import "../Widgets" as Widgets -Item { +Rectangle { id: root + radius: 5 - // - // Signals & settings for console button - // property alias consoleChecked: consoleBt.checked + Settings { property alias consoleVisible: root.consoleChecked } - // - // Window shadow (must go before window declaration - // to avoid blurry artifacts & glitches). - // - Widgets.Shadow { - anchors.fill: window - } - - // - // Window - // - Rectangle { - id: window - radius: 5 - anchors.fill: parent - - gradient: Gradient { - GradientStop { - position: 0 - color: Cpp_ThemeManager.windowGradient1 - } - - GradientStop { - position: 1 - color: Cpp_ThemeManager.windowGradient2 - } + gradient: Gradient { + GradientStop { + position: 0 + color: Cpp_ThemeManager.windowGradient1 } - RowLayout { - spacing: app.spacing + GradientStop { + position: 1 + color: Cpp_ThemeManager.windowGradient2 + } + } - anchors { - margins: 0 - left: parent.left - right: parent.right - leftMargin: app.spacing - rightMargin: app.spacing - verticalCenter: parent.verticalCenter - } + RowLayout { + spacing: app.spacing - Widgets.Icon { - Layout.alignment: Qt.AlignVCenter - source: "qrc:/icons/arrow-right.svg" - } + anchors { + margins: 0 + left: parent.left + right: parent.right + leftMargin: app.spacing + rightMargin: app.spacing + verticalCenter: parent.verticalCenter + } - Label { - font.bold: true - font.pixelSize: 16 - color: palette.brightText - font.family: app.monoFont - text: Cpp_UI_Dashboard.title - Layout.alignment: Qt.AlignVCenter - } + Widgets.Icon { + Layout.alignment: Qt.AlignVCenter + source: "qrc:/icons/arrow-right.svg" + } - Item { - Layout.fillWidth: true - } + Label { + font.bold: true + font.pixelSize: 16 + color: palette.brightText + font.family: app.monoFont + text: Cpp_UI_Dashboard.title + Layout.alignment: Qt.AlignVCenter + } - Button { - flat: true - id: consoleBt - checkable: true - font.bold: true - text: qsTr("Console") - Layout.alignment: Qt.AlignVCenter - icon.source: "qrc:/icons/code.svg" - icon.color: Cpp_ThemeManager.menubarText - palette.buttonText: Cpp_ThemeManager.menubarText - palette.button: Cpp_ThemeManager.windowGradient1 - palette.window: Cpp_ThemeManager.windowGradient1 - } + Item { + Layout.fillWidth: true + } + + Button { + flat: true + id: consoleBt + checkable: true + font.bold: true + text: qsTr("Console") + Layout.alignment: Qt.AlignVCenter + icon.source: "qrc:/icons/code.svg" + icon.color: Cpp_ThemeManager.menubarText + palette.buttonText: Cpp_ThemeManager.menubarText + palette.button: Cpp_ThemeManager.windowGradient1 + palette.window: Cpp_ThemeManager.windowGradient1 } } } diff --git a/assets/qml/JsonEditor/GroupEditor.qml b/assets/qml/JsonEditor/GroupEditor.qml index d15ff3e2..d2a330f3 100644 --- a/assets/qml/JsonEditor/GroupEditor.qml +++ b/assets/qml/JsonEditor/GroupEditor.qml @@ -88,16 +88,6 @@ ColumnLayout { height: group.height + app.spacing width: parent.width - 4 * app.spacing - // - // Window shadow - // - Widgets.Shadow { - anchors.fill: group - } - - // - // Group window - // JsonGroupDelegate { id: group group: index diff --git a/assets/qml/JsonEditor/TreeView.qml b/assets/qml/JsonEditor/TreeView.qml index c6234d8b..7394f0ee 100644 --- a/assets/qml/JsonEditor/TreeView.qml +++ b/assets/qml/JsonEditor/TreeView.qml @@ -130,10 +130,16 @@ Widgets.Window { } Label { + id: label Layout.fillWidth: true elide: Label.ElideRight Layout.alignment: Qt.AlignVCenter text: Cpp_JSON_Editor.datasetTitle(groupDelegate.groupId, index) + + MouseArea { + anchors.fill: parent + cursorShape: Qt.PointingHandCursor + } } Label { diff --git a/assets/qml/Panes/Console.qml b/assets/qml/Panes/Console.qml index 7297bd1c..58f4bd01 100644 --- a/assets/qml/Panes/Console.qml +++ b/assets/qml/Panes/Console.qml @@ -65,14 +65,6 @@ Item { } } - // - // Window shadow (must go before window declaration - // to avoid blurry artifacts & glitches). - // - Widgets.Shadow { - anchors.fill: window - } - // // Console window // diff --git a/assets/qml/Panes/Dashboard.qml b/assets/qml/Panes/Dashboard.qml index 25926f96..2b105e16 100644 --- a/assets/qml/Panes/Dashboard.qml +++ b/assets/qml/Panes/Dashboard.qml @@ -47,21 +47,12 @@ Item { Layout.fillHeight: true // - // View options window + shadow + // View options window // - Item { + DashboardItems.ViewOptions { Layout.fillHeight: true Layout.minimumWidth: 280 - - Widgets.Shadow { - anchors.fill: viewOptions - } - - DashboardItems.ViewOptions { - id: viewOptions - anchors.fill: parent - onWidgetSizeChanged: (maxSize) => widgetGrid.maxSize = maxSize - } + onWidgetSizeChanged: (maxSize) => widgetGrid.maxSize = maxSize } // @@ -70,21 +61,14 @@ Item { ColumnLayout { spacing: terminalView.enabled ? app.spacing : 0 - Item { + DashboardItems.WidgetGrid { + id: widgetGrid Layout.fillWidth: true Layout.fillHeight: true Layout.minimumWidth: 240 - - Widgets.Shadow { - anchors.fill: widgetGrid - } - - DashboardItems.WidgetGrid { - id: widgetGrid - anchors.fill: parent - } } + Item { enabled: false id: terminalView @@ -97,10 +81,6 @@ Item { Behavior on Layout.bottomMargin { NumberAnimation{} } - Widgets.Shadow { - anchors.fill: terminal - } - Widgets.Window { id: terminal gradient: true diff --git a/assets/qml/Panes/Setup.qml b/assets/qml/Panes/Setup.qml index 7e021329..3b8980a7 100644 --- a/assets/qml/Panes/Setup.qml +++ b/assets/qml/Panes/Setup.qml @@ -124,19 +124,10 @@ Item { } } - // - // Window shadow (must go before window declaration - // to avoid blurry artifacts & glitches). - // - Widgets.Shadow { - anchors.fill: window - } - // // Window // Widgets.Window { - id: window gradient: true title: qsTr("Setup") anchors.fill: parent diff --git a/assets/qml/Widgets/Window.qml b/assets/qml/Widgets/Window.qml index c003d906..f051756f 100644 --- a/assets/qml/Widgets/Window.qml +++ b/assets/qml/Widgets/Window.qml @@ -81,9 +81,9 @@ Page { border.width: 1 color: "transparent" anchors.fill: parent - border.color: "#a7a7a7" anchors.topMargin: header.height anchors.margins: root.borderWidth + border.color: Cpp_ThemeManager.border } } diff --git a/assets/qml/Windows/JsonEditor.qml b/assets/qml/Windows/JsonEditor.qml index e4c46cff..b546c2eb 100644 --- a/assets/qml/Windows/JsonEditor.qml +++ b/assets/qml/Windows/JsonEditor.qml @@ -153,22 +153,14 @@ FramelessWindow.CustomWindow { // // JSON structure tree // - Item { + TreeView { + id: jsonTree Layout.fillHeight: true Layout.minimumWidth: 240 Layout.maximumWidth: 240 Layout.topMargin: app.spacing * 2 Layout.bottomMargin: app.spacing * 2 visible: Cpp_JSON_Editor.groupCount !== 0 - - Widgets.Shadow { - anchors.fill: jsonTree - } - - TreeView { - id: jsonTree - anchors.fill: parent - } } // diff --git a/assets/themes/1_Flat.json b/assets/themes/1_Flat.json index 4876072d..1b8515d8 100644 --- a/assets/themes/1_Flat.json +++ b/assets/themes/1_Flat.json @@ -8,6 +8,7 @@ "button":"#eaeaea", "window":"#eaeaea", "text":"#000000", + "border":"#a7a7a7", "midlight":"#eaeaea", "highlight":"#4287ba", "brightText":"#ffffff", diff --git a/assets/themes/2_Dark.json b/assets/themes/2_Dark.json index c6fb143d..bd48804c 100644 --- a/assets/themes/2_Dark.json +++ b/assets/themes/2_Dark.json @@ -8,6 +8,7 @@ "button":"#21373f", "window":"#21373f", "text":"#ffffff", + "border":"#14272e", "midlight":"#0e1419", "highlight":"#409da0", "brightText":"#ffffff", diff --git a/assets/themes/3_Classic.json b/assets/themes/3_Classic.json index 3b31de23..49c92c59 100644 --- a/assets/themes/3_Classic.json +++ b/assets/themes/3_Classic.json @@ -8,6 +8,7 @@ "button":"#21373f", "window":"#21373f", "text":"#ffffff", + "border":"#14272e", "midlight":"#0e1419", "highlight":"#409da0", "brightText":"#ffffff", diff --git a/assets/themes/4_Midnight.json b/assets/themes/4_Midnight.json index a8c1e47c..6f57ae6e 100644 --- a/assets/themes/4_Midnight.json +++ b/assets/themes/4_Midnight.json @@ -8,6 +8,7 @@ "button":"#686f82", "window":"#686f82", "text":"#ffffff", + "border":"#494f5e", "midlight":"#a8988f", "highlight":"#4992a6", "brightText":"#ffffff", diff --git a/assets/themes/5_Noir.json b/assets/themes/5_Noir.json index 1bc29509..1dad87df 100644 --- a/assets/themes/5_Noir.json +++ b/assets/themes/5_Noir.json @@ -8,6 +8,7 @@ "button":"#fafafa", "window":"#fafafa", "text":"#000000", + "border":"#b3b3b3", "midlight":"#2c2c2c", "highlight":"#1e7cf3", "brightText":"#ffffff", diff --git a/assets/themes/6_Mathworks.json b/assets/themes/6_Mathworks.json index e107d73c..79387b5c 100644 --- a/assets/themes/6_Mathworks.json +++ b/assets/themes/6_Mathworks.json @@ -8,6 +8,7 @@ "button":"#d8d8d8", "window":"#d8d8d8", "text":"#000000", + "border":"#9a9a9a", "midlight":"#d9d9d9", "highlight":"#53ab27", "brightText":"#ffffff", diff --git a/src/Misc/ModuleManager.cpp b/src/Misc/ModuleManager.cpp index 61463350..030920dd 100644 --- a/src/Misc/ModuleManager.cpp +++ b/src/Misc/ModuleManager.cpp @@ -90,8 +90,8 @@ Misc::ModuleManager::ModuleManager() else pixmap.load(":/images/splash@1x.png"); - // Disable splash screen shadow on macOS #ifdef Q_OS_MAC + // Disable splash screen shadow on macOS m_splash.setWindowFlags(Qt::SplashScreen | Qt::NoDropShadowWindowHint); #endif diff --git a/src/Misc/ThemeManager.cpp b/src/Misc/ThemeManager.cpp index c9b6e015..b7fe71ff 100644 --- a/src/Misc/ThemeManager.cpp +++ b/src/Misc/ThemeManager.cpp @@ -149,6 +149,7 @@ void Misc::ThemeManager::loadTheme(const int id) m_button = QColor(colors.value("button").toString()); m_window = QColor(colors.value("window").toString()); m_text = QColor(colors.value("text").toString()); + m_border = QColor(colors.value("border").toString()); m_midlight = QColor(colors.value("midlight").toString()); m_highlight = QColor(colors.value("highlight").toString()); m_brightText = QColor(colors.value("brightText").toString()); @@ -294,6 +295,11 @@ QColor Misc::ThemeManager::text() const return m_text; } +QColor Misc::ThemeManager::border() const +{ + return m_border; +} + QColor Misc::ThemeManager::midlight() const { return m_midlight; diff --git a/src/Misc/ThemeManager.h b/src/Misc/ThemeManager.h index a87b4f56..09b5b0a7 100644 --- a/src/Misc/ThemeManager.h +++ b/src/Misc/ThemeManager.h @@ -48,148 +48,151 @@ class ThemeManager : public QObject NOTIFY themeChanged) Q_PROPERTY(bool titlebarSeparator READ titlebarSeparator - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor base READ base - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor link READ link - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor button READ button - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor window READ window - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor text READ text - NOTIFY themeChanged) + CONSTANT) + Q_PROPERTY(QColor border + READ border + CONSTANT) Q_PROPERTY(QColor midlight READ midlight - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor highlight READ highlight - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor brightText READ brightText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor buttonText READ buttonText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor windowText READ windowText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor tooltipText READ tooltipText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor tooltipBase READ tooltipBase - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor highlightedText READ highlightedText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor highlightedTextAlternative READ highlightedTextAlternative - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor placeholderText READ placeholderText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor toolbarGradient1 READ toolbarGradient1 - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor toolbarGradient2 READ toolbarGradient2 - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor consoleText READ consoleText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor consoleBase READ consoleBase - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor consoleButton READ consoleButton - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor consoleWindow READ consoleWindow - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor consoleHighlight READ consoleHighlight - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor consoleHighlightedText READ consoleHighlightedText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor consolePlaceholderText READ consolePlaceholderText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor windowBackground READ windowBackground - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor windowGradient1 READ windowGradient1 - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor windowGradient2 READ windowGradient2 - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor menubarText READ menubarText - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor dialogBackground READ dialogBackground - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor alternativeHighlight READ alternativeHighlight - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor setupPanelBackground READ setupPanelBackground - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor widgetTextPrimary READ widgetTextPrimary - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor widgetTextSecondary READ widgetTextSecondary - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor widgetWindowBackground READ widgetWindowBackground - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor widgetWindowBorder READ widgetWindowBorder - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor paneWindowBackground READ paneWindowBackground - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor ledEnabled READ ledEnabled - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor ledDisabled READ ledDisabled - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor csvCheckbox READ csvCheckbox - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor widgetForegroundPrimary READ widgetForegroundPrimary - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor widgetForegroundSecondary READ widgetForegroundSecondary - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor widgetIndicator READ widgetIndicator - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor widgetControlBackground READ widgetControlBackground - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor connectButtonChecked READ connectButtonChecked - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor connectButtonUnchecked READ connectButtonUnchecked - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(QColor mqttButton READ mqttButton - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(StringList widgetColors READ widgetColors - NOTIFY themeChanged) + CONSTANT) Q_PROPERTY(StringList availableThemes READ availableThemes NOTIFY availableThemesChanged) @@ -201,8 +204,8 @@ class ThemeManager : public QObject Q_SIGNALS: void themeChanged(); - void customWindowDecorationsChanged(); void availableThemesChanged(); + void customWindowDecorationsChanged(); private: explicit ThemeManager(); @@ -223,6 +226,7 @@ public: QColor button() const; QColor window() const; QColor text() const; + QColor border() const; QColor midlight() const; QColor highlight() const; QColor brightText() const; @@ -290,6 +294,7 @@ private: QColor m_button; QColor m_window; QColor m_text; + QColor m_border; QColor m_midlight; QColor m_highlight; QColor m_brightText;