diff --git a/example/qml-Qt6/page/T_Home.qml b/example/qml-Qt6/page/T_Home.qml index 27d95d4e..f9a4bf76 100644 --- a/example/qml-Qt6/page/T_Home.qml +++ b/example/qml-Qt6/page/T_Home.qml @@ -77,7 +77,7 @@ FluScrollablePage{ Rectangle{ anchors.fill: parent radius: 5 - color:FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) + color:FluTheme.itemHoverColor visible: item_mouse.containsMouse } Rectangle{ @@ -172,17 +172,10 @@ FluScrollablePage{ anchors.fill: parent radius: 8 color:{ - if(FluTheme.dark){ - if(item_mouse.containsMouse){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) - }else{ - if(item_mouse.containsMouse){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(item_mouse.containsMouse){ + return FluTheme.itemHoverColor } + return FluTheme.itemNormalColor } } Image{ @@ -227,7 +220,7 @@ FluScrollablePage{ height: 12 width: 12 radius: 6 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor anchors{ right: parent.right top: parent.top diff --git a/example/qml-Qt6/page/T_Screenshot.qml b/example/qml-Qt6/page/T_Screenshot.qml index 2a1571a2..a57c8707 100644 --- a/example/qml-Qt6/page/T_Screenshot.qml +++ b/example/qml-Qt6/page/T_Screenshot.qml @@ -35,7 +35,7 @@ FluScrollablePage{ color: FluTheme.dark ? FluColors.Black : FluColors.White FluShadow{ radius: 4 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor } Image{ id:image diff --git a/example/qml-Qt6/page/T_StatusView.qml b/example/qml-Qt6/page/T_StatusView.qml index 3a94578d..9ff1edb3 100644 --- a/example/qml-Qt6/page/T_StatusView.qml +++ b/example/qml-Qt6/page/T_StatusView.qml @@ -66,7 +66,7 @@ FluScrollablePage{ } Rectangle { anchors.fill: parent - color:FluTheme.primaryColor.dark + color:FluTheme.primaryColor } } } @@ -78,7 +78,7 @@ FluScrollablePage{ statusMode: FluStatusViewType.Loading Rectangle{ anchors.fill: parent - color:FluTheme.primaryColor.dark + color:FluTheme.primaryColor } }' } diff --git a/example/qml-Qt6/page/T_TableView.qml b/example/qml-Qt6/page/T_TableView.qml index 2d267e21..1a5288b0 100644 --- a/example/qml-Qt6/page/T_TableView.qml +++ b/example/qml-Qt6/page/T_TableView.qml @@ -181,7 +181,7 @@ FluContentPage{ iconSource: FluentIcons.ChevronUp iconColor: { if(1 === root.sortType){ - return FluTheme.primaryColor.dark + return FluTheme.primaryColor } return FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1) } @@ -202,7 +202,7 @@ FluContentPage{ iconSource: FluentIcons.ChevronDown iconColor: { if(2 === root.sortType){ - return FluTheme.primaryColor.dark + return FluTheme.primaryColor } return FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1) } diff --git a/example/qml-Qt6/page/T_Theme.qml b/example/qml-Qt6/page/T_Theme.qml index a0b73877..6960d2b4 100644 --- a/example/qml-Qt6/page/T_Theme.qml +++ b/example/qml-Qt6/page/T_Theme.qml @@ -32,7 +32,7 @@ FluScrollablePage{ anchors.centerIn: parent iconSource: FluentIcons.AcceptMedium iconSize: 15 - visible: modelData === FluTheme.primaryColor + visible: modelData === FluTheme.themeColor color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) } MouseArea{ @@ -40,7 +40,7 @@ FluScrollablePage{ anchors.fill: parent hoverEnabled: true onClicked: { - FluTheme.primaryColor = modelData + FluTheme.themeColor = modelData } } } @@ -88,7 +88,7 @@ FluScrollablePage{ CodeExpander{ Layout.fillWidth: true Layout.topMargin: -1 - code:'FluTheme.primaryColor = FluColors.Orange + code:'FluTheme.themeColor = FluColors.Orange FluTheme.dark = true diff --git a/example/qml/page/T_Home.qml b/example/qml/page/T_Home.qml index fb690040..a1c8a827 100644 --- a/example/qml/page/T_Home.qml +++ b/example/qml/page/T_Home.qml @@ -2,7 +2,6 @@ import QtQuick 2.15 import QtQuick.Layouts 1.15 import QtQuick.Window 2.15 import QtQuick.Controls 2.15 -import QtGraphicalEffects 1.0 import "qrc:///example/qml/global" import FluentUI 1.0 @@ -78,7 +77,7 @@ FluScrollablePage{ Rectangle{ anchors.fill: parent radius: 5 - color:FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) + color:FluTheme.itemHoverColor visible: item_mouse.containsMouse } Rectangle{ @@ -173,17 +172,10 @@ FluScrollablePage{ anchors.fill: parent radius: 8 color:{ - if(FluTheme.dark){ - if(item_mouse.containsMouse){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) - }else{ - if(item_mouse.containsMouse){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(item_mouse.containsMouse){ + return FluTheme.itemHoverColor } + return FluTheme.itemNormalColor } } Image{ @@ -228,7 +220,7 @@ FluScrollablePage{ height: 12 width: 12 radius: 6 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor anchors{ right: parent.right top: parent.top diff --git a/example/qml/page/T_Screenshot.qml b/example/qml/page/T_Screenshot.qml index 30761236..ba10cba1 100644 --- a/example/qml/page/T_Screenshot.qml +++ b/example/qml/page/T_Screenshot.qml @@ -36,7 +36,7 @@ FluScrollablePage{ color: FluTheme.dark ? FluColors.Black : FluColors.White FluShadow{ radius: 4 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor } Image{ id:image diff --git a/example/qml/page/T_StatusView.qml b/example/qml/page/T_StatusView.qml index c92f63a1..7c010ca9 100644 --- a/example/qml/page/T_StatusView.qml +++ b/example/qml/page/T_StatusView.qml @@ -67,7 +67,7 @@ FluScrollablePage{ } Rectangle { anchors.fill: parent - color:FluTheme.primaryColor.dark + color:FluTheme.primaryColor } } } @@ -79,7 +79,7 @@ FluScrollablePage{ statusMode: FluStatusViewType.Loading Rectangle{ anchors.fill: parent - color:FluTheme.primaryColor.dark + color:FluTheme.primaryColor } }' } diff --git a/example/qml/page/T_TableView.qml b/example/qml/page/T_TableView.qml index af53a424..a5e80c32 100644 --- a/example/qml/page/T_TableView.qml +++ b/example/qml/page/T_TableView.qml @@ -182,7 +182,7 @@ FluContentPage{ iconSource: FluentIcons.ChevronUp iconColor: { if(1 === root.sortType){ - return FluTheme.primaryColor.dark + return FluTheme.primaryColor } return FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1) } @@ -203,7 +203,7 @@ FluContentPage{ iconSource: FluentIcons.ChevronDown iconColor: { if(2 === root.sortType){ - return FluTheme.primaryColor.dark + return FluTheme.primaryColor } return FluTheme.dark ? Qt.rgba(1,1,1,1) : Qt.rgba(0,0,0,1) } diff --git a/example/qml/page/T_Theme.qml b/example/qml/page/T_Theme.qml index dcb3298a..6b29f5d7 100644 --- a/example/qml/page/T_Theme.qml +++ b/example/qml/page/T_Theme.qml @@ -33,7 +33,7 @@ FluScrollablePage{ anchors.centerIn: parent iconSource: FluentIcons.AcceptMedium iconSize: 15 - visible: modelData === FluTheme.primaryColor + visible: modelData === FluTheme.themeColor color: FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) } MouseArea{ @@ -41,7 +41,7 @@ FluScrollablePage{ anchors.fill: parent hoverEnabled: true onClicked: { - FluTheme.primaryColor = modelData + FluTheme.themeColor = modelData } } } @@ -89,7 +89,7 @@ FluScrollablePage{ CodeExpander{ Layout.fillWidth: true Layout.topMargin: -1 - code:'FluTheme.primaryColor = FluColors.Orange + code:'FluTheme.themeColor = FluColors.Orange FluTheme.dark = true diff --git a/src/FluTheme.cpp b/src/FluTheme.cpp index 657604eb..bc9b78ee 100644 --- a/src/FluTheme.cpp +++ b/src/FluTheme.cpp @@ -16,14 +16,31 @@ FluTheme::FluTheme(QObject *parent):QObject{parent}{ connect(this,&FluTheme::darkModeChanged,this,[=]{ Q_EMIT darkChanged(); }); - primaryColor(FluColors::getInstance()->Blue()); + connect(this,&FluTheme::darkChanged,this,[=]{refreshColors();}); + connect(this,&FluTheme::themeColorChanged,this,[=]{refreshColors();}); + themeColor(FluColors::getInstance()->Blue()); + darkMode(FluThemeType::DarkMode::Light); nativeText(false); enableAnimation(true); - darkMode(FluThemeType::DarkMode::Light); _systemDark = systemDark(); qApp->installEventFilter(this); } +void FluTheme::refreshColors(){ + auto isDark = dark(); + primaryColor(isDark ? _themeColor->lighter() : _themeColor->dark()); + backgroundColor(isDark ? QColor(0,0,0,255) : QColor(1,1,1,255)); + windowBackgroundColor(isDark ? QColor(32,32,32,255) : QColor(237,237,237,255)); + windowActiveBackgroundColor(isDark ? QColor(26,26,26,255) : QColor(243,243,243,255)); + fontPrimaryColor(isDark ? QColor(248,248,248,255) : QColor(7,7,7,255)); + fontSecondary(isDark ? QColor(222,222,222,255) : QColor(102,102,102,255)); + fontTertiary(isDark ? QColor(200,200,200,255) : QColor(153,153,153,255)); + itemNormalColor(isDark ? QColor(255,255,255,0) : QColor(0,0,0,0)); + itemHoverColor(isDark ? QColor(255,255,255,255*0.03) : QColor(0,0,0,255*0.03)); + itemPressColor(isDark ? QColor(255,255,255,255*0.06) : QColor(0,0,0,255*0.06)); + itemCheckColor(isDark ? QColor(255,255,255,255*0.09) : QColor(0,0,0,255*0.09)); +} + bool FluTheme::eventFilter(QObject *obj, QEvent *event){ Q_UNUSED(obj); if (event->type() == QEvent::ApplicationPaletteChange || event->type() == QEvent::ThemeChange) diff --git a/src/FluTheme.h b/src/FluTheme.h index 725f45b1..b48fa402 100644 --- a/src/FluTheme.h +++ b/src/FluTheme.h @@ -5,6 +5,7 @@ #include #include #include +#include #include "FluColorSet.h" #include "stdafx.h" #include "singleton.h" @@ -16,7 +17,18 @@ class FluTheme : public QObject { Q_OBJECT Q_PROPERTY(bool dark READ dark NOTIFY darkChanged) - Q_PROPERTY_AUTO(FluColorSet*,primaryColor) + Q_PROPERTY_AUTO(FluColorSet*,themeColor); + Q_PROPERTY_AUTO(QColor,primaryColor); + Q_PROPERTY_AUTO(QColor,backgroundColor); + Q_PROPERTY_AUTO(QColor,windowBackgroundColor); + Q_PROPERTY_AUTO(QColor,windowActiveBackgroundColor); + Q_PROPERTY_AUTO(QColor,fontPrimaryColor); + Q_PROPERTY_AUTO(QColor,fontSecondary); + Q_PROPERTY_AUTO(QColor,fontTertiary); + Q_PROPERTY_AUTO(QColor,itemNormalColor); + Q_PROPERTY_AUTO(QColor,itemHoverColor); + Q_PROPERTY_AUTO(QColor,itemPressColor); + Q_PROPERTY_AUTO(QColor,itemCheckColor); Q_PROPERTY_AUTO(int,darkMode); Q_PROPERTY_AUTO(bool,nativeText); Q_PROPERTY_AUTO(bool,enableAnimation); @@ -26,6 +38,7 @@ private: explicit FluTheme(QObject *parent = nullptr); bool eventFilter(QObject *obj, QEvent *event); bool systemDark(); + void refreshColors(); public: SINGLETONG(FluTheme) Q_INVOKABLE QJsonArray awesomeList(const QString& keyword = ""); @@ -33,7 +46,6 @@ public: static FluTheme *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine){return getInstance();} bool dark(); private: - bool _dark; bool _systemDark; }; diff --git a/src/Qt5/imports/FluentUI/Controls/FluAppBar.qml b/src/Qt5/imports/FluentUI/Controls/FluAppBar.qml index e03337cc..a680b844 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluAppBar.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluAppBar.qml @@ -14,12 +14,12 @@ Rectangle{ property string stayTopText : "置顶" property string stayTopCancelText : "取消置顶" property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000" - property color minimizeNormalColor: Qt.rgba(0,0,0,0) - property color minimizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - property color minimizePressColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) - property color maximizeNormalColor: Qt.rgba(0,0,0,0) - property color maximizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - property color maximizePressColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) + property color minimizeNormalColor: FluTheme.itemNormalColor + property color minimizeHoverColor: FluTheme.itemHoverColor + property color minimizePressColor: FluTheme.itemPressColor + property color maximizeNormalColor: FluTheme.itemNormalColor + property color maximizeHoverColor: FluTheme.itemHoverColor + property color maximizePressColor: FluTheme.itemPressColor property color closeNormalColor: Qt.rgba(0,0,0,0) property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1) property color closePressColor: Qt.rgba(251/255,115/255,115/255,0.8) @@ -32,7 +32,7 @@ Rectangle{ property url icon property int iconSize: 20 property bool isMac: FluTools.isMacos() - property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color borerlessColor : FluTheme.primaryColor property var maxClickListener : function(){ if (d.win.visibility === Window.Maximized) d.win.visibility = Window.Windowed @@ -135,7 +135,7 @@ Rectangle{ } text:d.stayTop ? control.stayTopCancelText : control.stayTopText radius: 0 - iconColor: d.stayTop ? (FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark) : control.textColor + iconColor: d.stayTop ? FluTheme.primaryColor : control.textColor onClicked: stayTopClickListener() } FluIconButton{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluCalendarView.qml b/src/Qt5/imports/FluentUI/Controls/FluCalendarView.qml index 910c158d..952d6a95 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluCalendarView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluCalendarView.qml @@ -65,7 +65,7 @@ Item { height: 50 radius: 25 visible: isYear - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor } FluText{ text:date.getFullYear() @@ -124,7 +124,7 @@ Item { height: 50 radius: 25 visible: isMonth - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor } FluText{ text:(date.getMonth()+1)+"月" @@ -184,7 +184,7 @@ Item { radius: 18 color:"#00000000" visible: isDay - border.color: FluTheme.primaryColor.dark + border.color: FluTheme.primaryColor border.width: 1 } Rectangle{ @@ -194,7 +194,7 @@ Item { height: 30 radius: 15 visible: isToDay - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor } FluText{ text:date.getDate() diff --git a/src/Qt5/imports/FluentUI/Controls/FluCarousel.qml b/src/Qt5/imports/FluentUI/Controls/FluCarousel.qml index 1418f493..a62cb1a1 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluCarousel.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluCarousel.qml @@ -124,9 +124,9 @@ Item { radius: 4 } scale: checked ? 1.2 : 1 - color: checked ? FluTheme.primaryColor.dark : Qt.rgba(1,1,1,0.7) + color: checked ? FluTheme.primaryColor : Qt.rgba(1,1,1,0.7) border.width: mouse_item.containsMouse ? 1 : 0 - border.color: FluTheme.primaryColor.dark + border.color: FluTheme.primaryColor MouseArea{ id:mouse_item hoverEnabled: true diff --git a/src/Qt5/imports/FluentUI/Controls/FluCheckBox.qml b/src/Qt5/imports/FluentUI/Controls/FluCheckBox.qml index e26989d8..c5c8a4ef 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluCheckBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluCheckBox.qml @@ -7,12 +7,12 @@ Button { property bool disabled: false property string contentDescription: "" property color borderNormalColor: FluTheme.dark ? Qt.rgba(160/255,160/255,160/255,1) : Qt.rgba(136/255,136/255,136/255,1) - property color bordercheckedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color bordercheckedColor: FluTheme.primaryColor property color borderHoverColor: FluTheme.dark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1) property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1) property color borderPressedColor: FluTheme.dark ? Qt.rgba(90/255,90/255,90/255,1) : Qt.rgba(191/255,191/255,191/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1) - property color checkedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color checkedColor: FluTheme.primaryColor property color hoverColor: FluTheme.dark ? Qt.rgba(72/255,72/255,72/255,1) : Qt.rgba(236/255,236/255,236/255,1) property color checkedHoverColor: FluTheme.dark ? Qt.darker(checkedColor,1.15) : Qt.lighter(checkedColor,1.15) property color checkedPreesedColor: FluTheme.dark ? Qt.darker(checkedColor,1.3) : Qt.lighter(checkedColor,1.3) diff --git a/src/Qt5/imports/FluentUI/Controls/FluColorPicker.qml b/src/Qt5/imports/FluentUI/Controls/FluColorPicker.qml index d8dd55a5..c902a7f6 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluColorPicker.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluColorPicker.qml @@ -19,7 +19,7 @@ Button{ color:"#00000000" border.color: { if(hovered) - return FluTheme.primaryColor.light + return FluTheme.primaryColor return FluTheme.dark ? Qt.rgba(100/255,100/255,100/255,1) : Qt.rgba(200/255,200/255,200/255,1) } border.width: 1 diff --git a/src/Qt5/imports/FluentUI/Controls/FluComboBox.qml b/src/Qt5/imports/FluentUI/Controls/FluComboBox.qml index 316c9e62..7419e371 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluComboBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluComboBox.qml @@ -45,7 +45,7 @@ T.ComboBox { topPadding: 6 - control.padding bottomPadding: 6 - control.padding renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering - selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) selectedTextColor: color text: control.editable ? control.editText : control.displayText enabled: control.editable diff --git a/src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml b/src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml index b7e6861e..757c08b4 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluCopyableText.qml @@ -17,7 +17,7 @@ TextEdit { selectByMouse: true selectedTextColor: color bottomPadding: 0 - selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) font:FluTextStyle.Body onSelectedTextChanged: { control.forceActiveFocus() diff --git a/src/Qt5/imports/FluentUI/Controls/FluDatePicker.qml b/src/Qt5/imports/FluentUI/Controls/FluDatePicker.qml index 4169748d..894def8b 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluDatePicker.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluDatePicker.qml @@ -169,11 +169,7 @@ Rectangle { anchors.rightMargin: 5 color: { if(getListView().currentIndex === position){ - if(FluTheme.dark){ - return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor.lighter,1.1) : FluTheme.primaryColor.lighter - }else{ - return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor.dark,1.1): FluTheme.primaryColor.dark - } + return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor,1.1): FluTheme.primaryColor } if(item_mouse.containsMouse){ return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) diff --git a/src/Qt5/imports/FluentUI/Controls/FluFilledButton.qml b/src/Qt5/imports/FluentUI/Controls/FluFilledButton.qml index 3584e089..3bf49a61 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluFilledButton.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluFilledButton.qml @@ -5,7 +5,7 @@ import FluentUI 1.0 Button { property bool disabled: false property string contentDescription: "" - property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color normalColor: FluTheme.primaryColor property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1) property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1) property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.2) : Qt.lighter(normalColor,1.2) diff --git a/src/Qt5/imports/FluentUI/Controls/FluIconButton.qml b/src/Qt5/imports/FluentUI/Controls/FluIconButton.qml index c65978cf..8f071df0 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluIconButton.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluIconButton.qml @@ -10,10 +10,10 @@ Button { property bool disabled: false property int radius:4 property string contentDescription: "" - property color hoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - property color pressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) - property color normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) - property color disableColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) + property color hoverColor: FluTheme.itemHoverColor + property color pressedColor: FluTheme.itemPressColor + property color normalColor: FluTheme.itemNormalColor + property color disableColor: FluTheme.itemNormalColor property Component iconDelegate: com_icon property color color: { if(!enabled){ diff --git a/src/Qt5/imports/FluentUI/Controls/FluImage.qml b/src/Qt5/imports/FluentUI/Controls/FluImage.qml index 78b02f47..b1001e3d 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluImage.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluImage.qml @@ -26,7 +26,7 @@ Image { Component{ id:com_loading Rectangle{ - color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) + color: FluTheme.itemHoverColor FluProgressRing{ anchors.centerIn: parent visible: control.status === Image.Loading @@ -36,7 +36,7 @@ Image { Component{ id:com_error Rectangle{ - color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) + color: FluTheme.itemHoverColor FluFilledButton{ text: control.errorButtonText anchors.centerIn: parent diff --git a/src/Qt5/imports/FluentUI/Controls/FluInfoBar.qml b/src/Qt5/imports/FluentUI/Controls/FluInfoBar.qml index 88367862..e4a159dd 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluInfoBar.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluInfoBar.qml @@ -170,7 +170,7 @@ FluObject { switch(_super.type){ case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1); case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1); - case mcontrol.const_info: return FluTheme.primaryColor.lighter; + case mcontrol.const_info: return FluTheme.primaryColor; case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1); } return "#FFFFFF" @@ -213,7 +213,7 @@ FluObject { switch(_super.type){ case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1); case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1); - case mcontrol.const_info: return FluTheme.primaryColor.lighter; + case mcontrol.const_info: return FluTheme.primaryColor; case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1); } return "#FFFFFF" diff --git a/src/Qt5/imports/FluentUI/Controls/FluMenuBarItem.qml b/src/Qt5/imports/FluentUI/Controls/FluMenuBarItem.qml index bc17c4ca..33f84aef 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluMenuBarItem.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluMenuBarItem.qml @@ -47,23 +47,13 @@ T.MenuBarItem { implicitHeight: 30 radius: 3 color: { - if(FluTheme.dark){ - if(control.highlighted){ - return Qt.rgba(1,1,1,0.06) - } - if(control.hovered){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) - }else{ - if(control.highlighted){ - return Qt.rgba(0,0,0,0.06) - } - if(control.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(control.highlighted){ + return FluTheme.itemCheckColor } + if(control.hovered){ + return FluTheme.itemHoverColor + } + return FluTheme.itemNormalColor } } } diff --git a/src/Qt5/imports/FluentUI/Controls/FluMenuItem.qml b/src/Qt5/imports/FluentUI/Controls/FluMenuItem.qml index 58046db9..f06be1b1 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluMenuItem.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluMenuItem.qml @@ -98,17 +98,10 @@ T.MenuItem { anchors.margins: 3 radius: 4 color:{ - if(FluTheme.dark){ - if(control.highlighted){ - return Qt.rgba(1,1,1,0.06) - } - return Qt.rgba(0,0,0,0) - }else{ - if(control.highlighted){ - return Qt.rgba(0,0,0,0.06) - } - return Qt.rgba(0,0,0,0) + if(control.highlighted){ + return FluTheme.itemCheckColor } + return FluTheme.itemNormalColor } } } diff --git a/src/Qt5/imports/FluentUI/Controls/FluMultilineTextBox.qml b/src/Qt5/imports/FluentUI/Controls/FluMultilineTextBox.qml index aacbef50..6b796011 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluMultilineTextBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluMultilineTextBox.qml @@ -24,7 +24,7 @@ TextArea{ leftPadding: padding+4 renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering selectedTextColor: color - selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) placeholderTextColor: { if(!enabled){ return placeholderDisableColor diff --git a/src/Qt5/imports/FluentUI/Controls/FluNavigationView.qml b/src/Qt5/imports/FluentUI/Controls/FluNavigationView.qml index b27f5607..3772e4f7 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluNavigationView.qml @@ -239,7 +239,7 @@ Item { width: 3 height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor visible: { if(!model){ return false @@ -291,25 +291,15 @@ Item { } color: { if(!item_control.enabled){ - return Qt.rgba(0,0,0,0) + return FluTheme.itemNormalColor } - if(FluTheme.dark){ - if((nav_list.currentIndex === _idx)&&type===0){ - return Qt.rgba(1,1,1,0.06) - } - if(item_control.hovered){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) - }else{ - if(nav_list.currentIndex === _idx&&type===0){ - return Qt.rgba(0,0,0,0.06) - } - if(item_control.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(nav_list.currentIndex === _idx&&type===0){ + return FluTheme.itemCheckColor } + if(item_control.hovered){ + return FluTheme.itemHoverColor + } + return FluTheme.itemNormalColor } Component{ id:com_icon @@ -513,37 +503,21 @@ Item { anchors.fill: parent color: { if(!item_control.enabled){ - return Qt.rgba(0,0,0,0) + return FluTheme.itemNormalColor } - if(FluTheme.dark){ - if(type===0){ - if(nav_list.currentIndex === _idx){ - return Qt.rgba(1,1,1,0.06) - } - }else{ - if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){ - return Qt.rgba(1,1,1,0.06) - } + if(type===0){ + if(nav_list.currentIndex === _idx){ + return FluTheme.itemCheckColor } - if(item_control.hovered){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) }else{ - if(type===0){ - if(nav_list.currentIndex === _idx){ - return Qt.rgba(0,0,0,0.06) - } - }else{ - if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){ - return Qt.rgba(0,0,0,0.06) - } + if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){ + return FluTheme.itemCheckColor } - if(item_control.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) } + if(item_control.hovered){ + return FluTheme.itemHoverColor + } + return FluTheme.itemNormalColor } Component{ id:com_icon @@ -953,9 +927,6 @@ Item { } FluIconButton{ visible:d.isCompactAndNotPanel - hoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - pressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) width:38 height:34 x:6 @@ -1004,7 +975,7 @@ Item { Rectangle{ height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor width: 3 anchors{ verticalCenter: parent.verticalCenter @@ -1062,7 +1033,7 @@ Item { Rectangle{ height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor width: 3 anchors{ verticalCenter: parent.verticalCenter @@ -1126,17 +1097,10 @@ Item { focusPolicy:Qt.TabFocus background: Rectangle{ color: { - if(FluTheme.dark){ - if(item_button.hovered){ - return Qt.rgba(1,1,1,0.06) - } - return Qt.rgba(0,0,0,0) - }else{ - if(item_button.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(item_button.hovered){ + return FluTheme.itemHoverColor } + return FluTheme.itemNormalColor } FluFocusRectangle{ visible: item_button.activeFocus diff --git a/src/Qt5/imports/FluentUI/Controls/FluPasswordBox.qml b/src/Qt5/imports/FluentUI/Controls/FluPasswordBox.qml index 0fe5ce91..8de49ee4 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluPasswordBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluPasswordBox.qml @@ -25,7 +25,7 @@ TextField{ leftPadding: padding+4 echoMode:btn_reveal.pressed ? TextField.Normal : TextField.Password renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering - selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) selectedTextColor: color placeholderTextColor: { if(!enabled){ diff --git a/src/Qt5/imports/FluentUI/Controls/FluPivot.qml b/src/Qt5/imports/FluentUI/Controls/FluPivot.qml index 52b87c57..1fac4100 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluPivot.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluPivot.qml @@ -36,7 +36,7 @@ Page { Rectangle{ height: 3 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor width: nav_list.currentItem ? nav_list.currentItem.width : 0 y:d.tabY Behavior on width { diff --git a/src/Qt5/imports/FluentUI/Controls/FluProgressBar.qml b/src/Qt5/imports/FluentUI/Controls/FluProgressBar.qml index 9e8265c2..72f18fed 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluProgressBar.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluProgressBar.qml @@ -5,7 +5,7 @@ import FluentUI 1.0 ProgressBar{ property real strokeWidth: 6 property bool progressVisible: false - property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color color: FluTheme.primaryColor property color backgroundColor : FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1) id:control indeterminate : true diff --git a/src/Qt5/imports/FluentUI/Controls/FluProgressButton.qml b/src/Qt5/imports/FluentUI/Controls/FluProgressButton.qml index 67fec864..d2f87df4 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluProgressButton.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluProgressButton.qml @@ -12,7 +12,7 @@ Button { } property color normalColor: { if(d.checked){ - return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + return FluTheme.primaryColor }else{ return FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1) } @@ -66,7 +66,7 @@ Button { width: parent.width * control.progress height: control.progress === 1 ? background.height : 3 visible: !d.checked - color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + color: FluTheme.primaryColor anchors.bottom: parent.bottom Behavior on height{ enabled: control.progress !== 1 diff --git a/src/Qt5/imports/FluentUI/Controls/FluProgressRing.qml b/src/Qt5/imports/FluentUI/Controls/FluProgressRing.qml index 63e7a9cb..6cf7b62e 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluProgressRing.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluProgressRing.qml @@ -6,7 +6,7 @@ import FluentUI 1.0 ProgressBar{ property real strokeWidth: 6 property bool progressVisible: false - property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color color: FluTheme.primaryColor property color backgroundColor : FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1) id:control indeterminate : true diff --git a/src/Qt5/imports/FluentUI/Controls/FluRadioButton.qml b/src/Qt5/imports/FluentUI/Controls/FluRadioButton.qml index bb5b0f15..b23f5f06 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluRadioButton.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluRadioButton.qml @@ -6,7 +6,7 @@ import FluentUI 1.0 Button { property string contentDescription: "" property bool disabled: false - property color borderNormalColor: checked ? FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark : FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1) + property color borderNormalColor: checked ? FluTheme.primaryColor : FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1) property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(198/255,198/255,198/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) property color hoverColor: checked ? FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1) diff --git a/src/Qt5/imports/FluentUI/Controls/FluRangeSlider.qml b/src/Qt5/imports/FluentUI/Controls/FluRangeSlider.qml index e6fc7e69..7c58f905 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluRangeSlider.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluRangeSlider.qml @@ -41,7 +41,7 @@ T.RangeSlider { } return control.first.hovered ? 1.2 : 1 } - iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + iconColor: FluTheme.primaryColor anchors.centerIn: parent Behavior on scale{ NumberAnimation{ @@ -72,7 +72,7 @@ T.RangeSlider { } return control.second.hovered ? 1.2 : 1 } - iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + iconColor: FluTheme.primaryColor anchors.centerIn: parent Behavior on scale{ NumberAnimation{ @@ -101,7 +101,7 @@ T.RangeSlider { y: control.horizontal ? 0 : control.second.visualPosition * parent.height + 3 width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 6 : 6 height: control.horizontal ? 6 : control.second.position * parent.height - control.first.position * parent.height - 6 - color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + color: FluTheme.primaryColor } } FluTooltip{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluRatingControl.qml b/src/Qt5/imports/FluentUI/Controls/FluRatingControl.qml index 3ad13411..ce76186c 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluRatingControl.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluRatingControl.qml @@ -32,7 +32,7 @@ Item { } iconSize: control.size iconSource: isSelected ? FluentIcons.FavoriteStarFill : FluentIcons.FavoriteStar - iconColor: isSelected ? FluTheme.primaryColor.dark : (FluTheme.dark ? "#FFFFFF" : "#000000") + iconColor: isSelected ? FluTheme.primaryColor : (FluTheme.dark ? "#FFFFFF" : "#000000") anchors.centerIn: parent } } diff --git a/src/Qt5/imports/FluentUI/Controls/FluScreenshot.qml b/src/Qt5/imports/FluentUI/Controls/FluScreenshot.qml index 1c036953..47bd2751 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluScreenshot.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluScreenshot.qml @@ -11,7 +11,7 @@ Item{ property int dotSize: 5 property int borderSize: 1 property var saveFolder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0] - property color borderColor: FluTheme.primaryColor.dark + property color borderColor: FluTheme.primaryColor signal captrueCompleted(var captrue) QtObject{ id:d @@ -508,7 +508,7 @@ Item{ } FluIconButton{ iconSource: FluentIcons.AcceptMedium - iconColor: FluTheme.primaryColor.dark + iconColor: FluTheme.primaryColor onClicked: { screenshot_background.capture(screenshot.start,screenshot.end) } diff --git a/src/Qt5/imports/FluentUI/Controls/FluSlider.qml b/src/Qt5/imports/FluentUI/Controls/FluSlider.qml index f5e911ff..7cf14706 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluSlider.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluSlider.qml @@ -39,7 +39,7 @@ T.Slider { } return control.hovered ? 1.2 : 1 } - iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + iconColor: FluTheme.primaryColor anchors.centerIn: parent } } @@ -62,7 +62,7 @@ T.Slider { width: control.horizontal ? control.position * parent.width : 6 height: control.horizontal ? 6 : control.position * parent.height radius: 3 - color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + color: FluTheme.primaryColor } } FluTooltip{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluSpinBox.qml b/src/Qt5/imports/FluentUI/Controls/FluSpinBox.qml index 253cc6a5..f478386d 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluSpinBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluSpinBox.qml @@ -39,7 +39,7 @@ T.SpinBox { } return normalColor } - selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) selectedTextColor: color horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter @@ -52,10 +52,13 @@ T.SpinBox { anchors.bottom: parent.bottom visible: contentItem.enabled color: { + if(contentItem.activeFocus){ + return FluTheme.primaryColor + } if(FluTheme.dark){ - contentItem.activeFocus ? FluTheme.primaryColor.lighter : Qt.rgba(166/255,166/255,166/255,1) + return Qt.rgba(166/255,166/255,166/255,1) }else{ - return contentItem.activeFocus ? FluTheme.primaryColor.dark : Qt.rgba(183/255,183/255,183/255,1) + return Qt.rgba(183/255,183/255,183/255,1) } } Behavior on height{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluTabView.qml b/src/Qt5/imports/FluentUI/Controls/FluTabView.qml index 898c0c08..507152fe 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTabView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTabView.qml @@ -189,23 +189,13 @@ Item { anchors.fill: parent radius: [6,6,0,0] color: { - if(FluTheme.dark){ - if(item_mouse_hove.containsMouse || item_btn_close.hovered){ - return Qt.rgba(1,1,1,0.03) - } - if(tab_nav.currentIndex === index){ - return Qt.rgba(1,1,1,0.06) - } - return Qt.rgba(0,0,0,0) - }else{ - if(item_mouse_hove.containsMouse || item_btn_close.hovered){ - return Qt.rgba(0,0,0,0.03) - } - if(tab_nav.currentIndex === index){ - return Qt.rgba(0,0,0,0.06) - } - return Qt.rgba(0,0,0,0) + if(item_mouse_hove.containsMouse || item_btn_close.hovered){ + return FluTheme.itemHoverColor } + if(tab_nav.currentIndex === index){ + return FluTheme.itemCheckColor + } + return FluTheme.itemNormalColor } } RowLayout{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluTableView.qml b/src/Qt5/imports/FluentUI/Controls/FluTableView.qml index 682cd154..deb060c9 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTableView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTableView.qml @@ -269,7 +269,7 @@ Rectangle { Rectangle{ height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor width: 3 visible: d.currentRow === table_model.getRow(row).__index && column === 0 anchors{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluText.qml b/src/Qt5/imports/FluentUI/Controls/FluText.qml index 414f1e06..029c6d2d 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluText.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluText.qml @@ -3,7 +3,7 @@ import QtQuick.Controls 2.15 import FluentUI 1.0 Text { - property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220 + property color textColor: FluTheme.fontPrimaryColor id:text color: textColor renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering diff --git a/src/Qt5/imports/FluentUI/Controls/FluTextBox.qml b/src/Qt5/imports/FluentUI/Controls/FluTextBox.qml index 0e71ef0b..3ed69afc 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTextBox.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTextBox.qml @@ -25,7 +25,7 @@ TextField{ } font:FluTextStyle.Body renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering - selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) selectedTextColor: color placeholderTextColor: { if(!enabled){ diff --git a/src/Qt5/imports/FluentUI/Controls/FluTextBoxBackground.qml b/src/Qt5/imports/FluentUI/Controls/FluTextBoxBackground.qml index eda41756..4a031606 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTextBoxBackground.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTextBoxBackground.qml @@ -36,10 +36,13 @@ FluClip{ anchors.bottom: parent.bottom visible: !inputItem.disabled color: { + if(inputItem.activeFocus){ + return FluTheme.primaryColor + } if(FluTheme.dark){ - return inputItem.activeFocus ? FluTheme.primaryColor.lighter : Qt.rgba(166/255,166/255,166/255,1) + return Qt.rgba(166/255,166/255,166/255,1) }else{ - return inputItem.activeFocus ? FluTheme.primaryColor.dark : Qt.rgba(134/255,134/255,134/255,1) + return Qt.rgba(134/255,134/255,134/255,1) } } Behavior on height{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluTextButton.qml b/src/Qt5/imports/FluentUI/Controls/FluTextButton.qml index e61bdf39..5d07ad90 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTextButton.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTextButton.qml @@ -5,14 +5,14 @@ import FluentUI 1.0 Button { property bool disabled: false property string contentDescription: "" - property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color normalColor: FluTheme.primaryColor property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.15) : Qt.lighter(normalColor,1.15) property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.3) : Qt.lighter(normalColor,1.3) property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1) - property color backgroundHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - property color backgroundPressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) - property color backgroundNormalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) - property color backgroundDisableColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) + property color backgroundHoverColor: FluTheme.itemHoverColor + property color backgroundPressedColor: FluTheme.itemPressColor + property color backgroundNormalColor: FluTheme.itemNormalColor + property color backgroundDisableColor: FluTheme.itemNormalColor property bool textBold: true property color textColor: { if(!enabled){ diff --git a/src/Qt5/imports/FluentUI/Controls/FluTimePicker.qml b/src/Qt5/imports/FluentUI/Controls/FluTimePicker.qml index a9a442b9..b17e89d8 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTimePicker.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTimePicker.qml @@ -184,11 +184,7 @@ Rectangle { anchors.rightMargin: 5 color: { if(getListView().currentIndex === position){ - if(FluTheme.dark){ - return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor.lighter,1.1) : FluTheme.primaryColor.lighter - }else{ - return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor.dark,1.1): FluTheme.primaryColor.dark - } + return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor,1.1) : FluTheme.primaryColor } if(item_mouse.containsMouse){ return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) diff --git a/src/Qt5/imports/FluentUI/Controls/FluTimeline.qml b/src/Qt5/imports/FluentUI/Controls/FluTimeline.qml index 8d0863a6..92b1f954 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTimeline.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTimeline.qml @@ -82,7 +82,7 @@ Item{ radius: 8 border.width: 4 color:FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) - border.color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + border.color: FluTheme.primaryColor } } @@ -92,7 +92,7 @@ Item{ wrapMode: Text.WrapAnywhere horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft text: modelData.lable - color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + color: FluTheme.primaryColor } } diff --git a/src/Qt5/imports/FluentUI/Controls/FluToggleButton.qml b/src/Qt5/imports/FluentUI/Controls/FluToggleButton.qml index 9e60a194..356d6f28 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluToggleButton.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluToggleButton.qml @@ -7,7 +7,7 @@ Button { property string contentDescription: "" property color normalColor: { if(checked){ - return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + return FluTheme.primaryColor }else{ return FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1) } diff --git a/src/Qt5/imports/FluentUI/Controls/FluToggleSwitch.qml b/src/Qt5/imports/FluentUI/Controls/FluToggleSwitch.qml index be55bee5..522e87ea 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluToggleSwitch.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluToggleSwitch.qml @@ -7,11 +7,11 @@ Button { property bool disabled: false property string contentDescription: "" property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(233/255,233/255,233/255,1) - property color checkColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color checkColor: FluTheme.primaryColor property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(240/255,240/255,240/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1) property color borderNormalColor: FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1) - property color borderCheckColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color borderCheckColor: FluTheme.primaryColor property color borderDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(200/255,200/255,200/255,1) property color dotNormalColor: FluTheme.dark ? Qt.rgba(208/255,208/255,208/255,1) : Qt.rgba(93/255,93/255,93/255,1) property color dotCheckColor: FluTheme.dark ? Qt.rgba(0/255,0/255,0/255,1) : Qt.rgba(255/255,255/255,255/255,1) diff --git a/src/Qt5/imports/FluentUI/Controls/FluTreeView.qml b/src/Qt5/imports/FluentUI/Controls/FluTreeView.qml index ee9be523..0d4a8151 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluTreeView.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluTreeView.qml @@ -22,7 +22,7 @@ Item { property int dropIndex: -1 property bool isDropTopArea: false property int dragIndex: -1 - property color hitColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color hitColor: FluTheme.primaryColor } onDataSourceChanged: { tree_model.setDataSource(dataSource) @@ -138,7 +138,7 @@ Item { width: 3 height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor visible: isCurrent anchors{ left: parent.left @@ -322,29 +322,16 @@ Item { border.color: d.hitColor border.width: d.dragIndex === rowIndex ? 1 : 0 color: { - if(FluTheme.dark){ - if(isCurrent){ - return Qt.rgba(1,1,1,0.06) - } - if(item_mouse.containsMouse || item_check_box.hovered){ - return Qt.rgba(1,1,1,0.03) - } - if(item_loader_expand.item && item_loader_expand.item.hovered){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) - }else{ - if(isCurrent){ - return Qt.rgba(0,0,0,0.06) - } - if(item_mouse.containsMouse || item_check_box.hovered){ - return Qt.rgba(0,0,0,0.03) - } - if(item_loader_expand.item && item_loader_expand.item.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(isCurrent){ + return FluTheme.itemCheckColor } + if(item_mouse.containsMouse || item_check_box.hovered){ + return FluTheme.itemHoverColor + } + if(item_loader_expand.item && item_loader_expand.item.hovered){ + return FluTheme.itemHoverColor + } + return FluTheme.itemNormalColor } } RowLayout{ diff --git a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml index e6695099..4923d123 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluWindow.qml @@ -16,9 +16,9 @@ Window { property var appBar: com_app_bar property color backgroundColor: { if(active){ - return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(243/255,243/255,243/255,1) + return FluTheme.windowActiveBackgroundColor } - return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(237/255,237/255,237/255,1) + return FluTheme.windowBackgroundColor } property bool stayTop: false property var _pageRegister diff --git a/src/Qt6/imports/FluentUI/Controls/FluAppBar.qml b/src/Qt6/imports/FluentUI/Controls/FluAppBar.qml index deed553f..93f42672 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluAppBar.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluAppBar.qml @@ -14,12 +14,12 @@ Rectangle{ property string stayTopText : "置顶" property string stayTopCancelText : "取消置顶" property color textColor: FluTheme.dark ? "#FFFFFF" : "#000000" - property color minimizeNormalColor: Qt.rgba(0,0,0,0) - property color minimizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - property color minimizePressColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) - property color maximizeNormalColor: Qt.rgba(0,0,0,0) - property color maximizeHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - property color maximizePressColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) + property color minimizeNormalColor: FluTheme.itemNormalColor + property color minimizeHoverColor: FluTheme.itemHoverColor + property color minimizePressColor: FluTheme.itemPressColor + property color maximizeNormalColor: FluTheme.itemNormalColor + property color maximizeHoverColor: FluTheme.itemHoverColor + property color maximizePressColor: FluTheme.itemPressColor property color closeNormalColor: Qt.rgba(0,0,0,0) property color closeHoverColor: Qt.rgba(251/255,115/255,115/255,1) property color closePressColor: Qt.rgba(251/255,115/255,115/255,0.8) @@ -32,7 +32,7 @@ Rectangle{ property url icon property int iconSize: 20 property bool isMac: FluTools.isMacos() - property color borerlessColor : FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color borerlessColor : FluTheme.primaryColor property var maxClickListener : function(){ if (d.win.visibility === Window.Maximized) d.win.visibility = Window.Windowed @@ -135,7 +135,7 @@ Rectangle{ } text:d.stayTop ? control.stayTopCancelText : control.stayTopText radius: 0 - iconColor: d.stayTop ? (FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark) : control.textColor + iconColor: d.stayTop ? FluTheme.primaryColor : control.textColor onClicked: stayTopClickListener() } FluIconButton{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluCalendarView.qml b/src/Qt6/imports/FluentUI/Controls/FluCalendarView.qml index 5bec4ec2..63bdcd52 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluCalendarView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluCalendarView.qml @@ -65,7 +65,7 @@ Item { height: 50 radius: 25 visible: isYear - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor } FluText{ text:date.getFullYear() @@ -124,7 +124,7 @@ Item { height: 50 radius: 25 visible: isMonth - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor } FluText{ text:(date.getMonth()+1)+"月" @@ -184,7 +184,7 @@ Item { radius: 18 color:"#00000000" visible: isDay - border.color: FluTheme.primaryColor.dark + border.color: FluTheme.primaryColor border.width: 1 } Rectangle{ @@ -194,7 +194,7 @@ Item { height: 30 radius: 15 visible: isToDay - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor } FluText{ text:date.getDate() diff --git a/src/Qt6/imports/FluentUI/Controls/FluCarousel.qml b/src/Qt6/imports/FluentUI/Controls/FluCarousel.qml index 2e6fdcee..454c8c4a 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluCarousel.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluCarousel.qml @@ -124,9 +124,9 @@ Item { radius: 4 } scale: checked ? 1.2 : 1 - color: checked ? FluTheme.primaryColor.dark : Qt.rgba(1,1,1,0.7) + color: checked ? FluTheme.primaryColor : Qt.rgba(1,1,1,0.7) border.width: mouse_item.containsMouse ? 1 : 0 - border.color: FluTheme.primaryColor.dark + border.color: FluTheme.primaryColor MouseArea{ id:mouse_item hoverEnabled: true diff --git a/src/Qt6/imports/FluentUI/Controls/FluCheckBox.qml b/src/Qt6/imports/FluentUI/Controls/FluCheckBox.qml index c4ab6610..47c95ee1 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluCheckBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluCheckBox.qml @@ -1,6 +1,5 @@ import QtQuick import QtQuick.Controls -import QtQuick.Controls.Basic import QtQuick.Layouts import FluentUI @@ -8,12 +7,12 @@ Button { property bool disabled: false property string contentDescription: "" property color borderNormalColor: FluTheme.dark ? Qt.rgba(160/255,160/255,160/255,1) : Qt.rgba(136/255,136/255,136/255,1) - property color bordercheckedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color bordercheckedColor: FluTheme.primaryColor property color borderHoverColor: FluTheme.dark ? Qt.rgba(167/255,167/255,167/255,1) : Qt.rgba(135/255,135/255,135/255,1) property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1) property color borderPressedColor: FluTheme.dark ? Qt.rgba(90/255,90/255,90/255,1) : Qt.rgba(191/255,191/255,191/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(45/255,45/255,45/255,1) : Qt.rgba(247/255,247/255,247/255,1) - property color checkedColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color checkedColor: FluTheme.primaryColor property color hoverColor: FluTheme.dark ? Qt.rgba(72/255,72/255,72/255,1) : Qt.rgba(236/255,236/255,236/255,1) property color checkedHoverColor: FluTheme.dark ? Qt.darker(checkedColor,1.15) : Qt.lighter(checkedColor,1.15) property color checkedPreesedColor: FluTheme.dark ? Qt.darker(checkedColor,1.3) : Qt.lighter(checkedColor,1.3) @@ -31,6 +30,11 @@ Button { id:control enabled: !disabled onClicked: clickListener() + onCheckableChanged: { + if(checkable){ + checkable = false + } + } background: Item{ FluFocusRectangle{ radius: 4 diff --git a/src/Qt6/imports/FluentUI/Controls/FluColorPicker.qml b/src/Qt6/imports/FluentUI/Controls/FluColorPicker.qml index c696a185..88141f13 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluColorPicker.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluColorPicker.qml @@ -1,6 +1,5 @@ import QtQuick import QtQuick.Controls -import QtQuick.Controls.Basic import QtQuick.Layouts import QtQuick.Window import FluentUI @@ -20,7 +19,7 @@ Button{ color:"#00000000" border.color: { if(hovered) - return FluTheme.primaryColor.light + return FluTheme.primaryColor return FluTheme.dark ? Qt.rgba(100/255,100/255,100/255,1) : Qt.rgba(200/255,200/255,200/255,1) } border.width: 1 @@ -31,6 +30,7 @@ Button{ radius: 5 color: control.colorValue } + } Item{ id: d diff --git a/src/Qt6/imports/FluentUI/Controls/FluComboBox.qml b/src/Qt6/imports/FluentUI/Controls/FluComboBox.qml index d05b792a..f36adb5f 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluComboBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluComboBox.qml @@ -45,7 +45,7 @@ T.ComboBox { topPadding: 6 - control.padding bottomPadding: 6 - control.padding renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering - selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) selectedTextColor: color text: control.editable ? control.editText : control.displayText enabled: control.editable diff --git a/src/Qt6/imports/FluentUI/Controls/FluCopyableText.qml b/src/Qt6/imports/FluentUI/Controls/FluCopyableText.qml index 215683bf..9b6346d5 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluCopyableText.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluCopyableText.qml @@ -17,7 +17,7 @@ TextEdit { selectByMouse: true selectedTextColor: color bottomPadding: 0 - selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) font:FluTextStyle.Body onSelectedTextChanged: { control.forceActiveFocus() diff --git a/src/Qt6/imports/FluentUI/Controls/FluDatePicker.qml b/src/Qt6/imports/FluentUI/Controls/FluDatePicker.qml index 48b890c7..95f08830 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluDatePicker.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluDatePicker.qml @@ -169,11 +169,7 @@ Rectangle { anchors.rightMargin: 5 color: { if(getListView().currentIndex === position){ - if(FluTheme.dark){ - return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor.lighter,1.1) : FluTheme.primaryColor.lighter - }else{ - return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor.dark,1.1): FluTheme.primaryColor.dark - } + return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor,1.1): FluTheme.primaryColor } if(item_mouse.containsMouse){ return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) diff --git a/src/Qt6/imports/FluentUI/Controls/FluFilledButton.qml b/src/Qt6/imports/FluentUI/Controls/FluFilledButton.qml index 1ac2a787..62aaa8f3 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluFilledButton.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluFilledButton.qml @@ -6,7 +6,7 @@ import FluentUI Button { property bool disabled: false property string contentDescription: "" - property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color normalColor: FluTheme.primaryColor property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.1) : Qt.lighter(normalColor,1.1) property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1) property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.2) : Qt.lighter(normalColor,1.2) diff --git a/src/Qt6/imports/FluentUI/Controls/FluIconButton.qml b/src/Qt6/imports/FluentUI/Controls/FluIconButton.qml index 1f973082..316badc1 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluIconButton.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluIconButton.qml @@ -11,10 +11,10 @@ Button { property bool disabled: false property int radius:4 property string contentDescription: "" - property color hoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - property color pressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) - property color normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) - property color disableColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) + property color hoverColor: FluTheme.itemHoverColor + property color pressedColor: FluTheme.itemPressColor + property color normalColor: FluTheme.itemNormalColor + property color disableColor: FluTheme.itemNormalColor property Component iconDelegate: com_icon property color color: { if(!enabled){ diff --git a/src/Qt6/imports/FluentUI/Controls/FluImage.qml b/src/Qt6/imports/FluentUI/Controls/FluImage.qml index 79b83376..4b02185a 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluImage.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluImage.qml @@ -26,7 +26,7 @@ Image { Component{ id:com_loading Rectangle{ - color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) + color: FluTheme.itemHoverColor FluProgressRing{ anchors.centerIn: parent visible: control.status === Image.Loading @@ -36,7 +36,7 @@ Image { Component{ id:com_error Rectangle{ - color: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) + color: FluTheme.itemHoverColor FluFilledButton{ text: control.errorButtonText anchors.centerIn: parent diff --git a/src/Qt6/imports/FluentUI/Controls/FluInfoBar.qml b/src/Qt6/imports/FluentUI/Controls/FluInfoBar.qml index 85dedeb5..4633cde0 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluInfoBar.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluInfoBar.qml @@ -170,7 +170,7 @@ FluObject { switch(_super.type){ case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1); case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1); - case mcontrol.const_info: return FluTheme.primaryColor.lighter; + case mcontrol.const_info: return FluTheme.primaryColor; case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1); } return "#FFFFFF" @@ -213,7 +213,7 @@ FluObject { switch(_super.type){ case mcontrol.const_success: return Qt.rgba(108/255,203/255,95/255,1); case mcontrol.const_warning: return Qt.rgba(252/255,225/255,0/255,1); - case mcontrol.const_info: return FluTheme.primaryColor.lighter; + case mcontrol.const_info: return FluTheme.primaryColor; case mcontrol.const_error: return Qt.rgba(255/255,153/255,164/255,1); } return "#FFFFFF" diff --git a/src/Qt6/imports/FluentUI/Controls/FluMenuBarItem.qml b/src/Qt6/imports/FluentUI/Controls/FluMenuBarItem.qml index 4dc5b79b..b7e9e175 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluMenuBarItem.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluMenuBarItem.qml @@ -48,23 +48,14 @@ T.MenuBarItem { implicitHeight: 30 radius: 3 color: { - if(FluTheme.dark){ - if(control.highlighted){ - return Qt.rgba(1,1,1,0.06) - } - if(control.hovered){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) - }else{ - if(control.highlighted){ - return Qt.rgba(0,0,0,0.06) - } - if(control.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(control.highlighted){ + return FluTheme.itemCheckColor } + if(control.hovered){ + return FluTheme.itemHoverColor + } + return FluTheme.itemNormalColor } } } + diff --git a/src/Qt6/imports/FluentUI/Controls/FluMenuItem.qml b/src/Qt6/imports/FluentUI/Controls/FluMenuItem.qml index 3ceef5c7..57b7d8c2 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluMenuItem.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluMenuItem.qml @@ -99,17 +99,10 @@ T.MenuItem { anchors.margins: 3 radius: 4 color:{ - if(FluTheme.dark){ - if(control.highlighted){ - return Qt.rgba(1,1,1,0.06) - } - return Qt.rgba(0,0,0,0) - }else{ - if(control.highlighted){ - return Qt.rgba(0,0,0,0.06) - } - return Qt.rgba(0,0,0,0) + if(control.highlighted){ + return FluTheme.itemCheckColor } + return FluTheme.itemNormalColor } } } diff --git a/src/Qt6/imports/FluentUI/Controls/FluMultilineTextBox.qml b/src/Qt6/imports/FluentUI/Controls/FluMultilineTextBox.qml index 3117f618..9b17689a 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluMultilineTextBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluMultilineTextBox.qml @@ -25,7 +25,7 @@ TextArea{ leftPadding: padding+4 renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering selectedTextColor: color - selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) placeholderTextColor: { if(!enabled){ return placeholderDisableColor diff --git a/src/Qt6/imports/FluentUI/Controls/FluNavigationView.qml b/src/Qt6/imports/FluentUI/Controls/FluNavigationView.qml index 153993ad..962d9f34 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluNavigationView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluNavigationView.qml @@ -240,7 +240,7 @@ Item { width: 3 height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor visible: { if(!model){ return false @@ -292,25 +292,15 @@ Item { } color: { if(!item_control.enabled){ - return Qt.rgba(0,0,0,0) + return FluTheme.itemNormalColor } - if(FluTheme.dark){ - if((nav_list.currentIndex === _idx)&&type===0){ - return Qt.rgba(1,1,1,0.06) - } - if(item_control.hovered){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) - }else{ - if(nav_list.currentIndex === _idx&&type===0){ - return Qt.rgba(0,0,0,0.06) - } - if(item_control.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(nav_list.currentIndex === _idx&&type===0){ + return FluTheme.itemCheckColor } + if(item_control.hovered){ + return FluTheme.itemHoverColor + } + return FluTheme.itemNormalColor } Component{ id:com_icon @@ -514,37 +504,21 @@ Item { anchors.fill: parent color: { if(!item_control.enabled){ - return Qt.rgba(0,0,0,0) + return FluTheme.itemNormalColor } - if(FluTheme.dark){ - if(type===0){ - if(nav_list.currentIndex === _idx){ - return Qt.rgba(1,1,1,0.06) - } - }else{ - if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){ - return Qt.rgba(1,1,1,0.06) - } + if(type===0){ + if(nav_list.currentIndex === _idx){ + return FluTheme.itemCheckColor } - if(item_control.hovered){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) }else{ - if(type===0){ - if(nav_list.currentIndex === _idx){ - return Qt.rgba(0,0,0,0.06) - } - }else{ - if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){ - return Qt.rgba(0,0,0,0.06) - } + if(nav_list.currentIndex === (nav_list.count-layout_footer.count+_idx)){ + return FluTheme.itemCheckColor } - if(item_control.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) } + if(item_control.hovered){ + return FluTheme.itemHoverColor + } + return FluTheme.itemNormalColor } Component{ id:com_icon @@ -954,9 +928,6 @@ Item { } FluIconButton{ visible:d.isCompactAndNotPanel - hoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - pressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - normalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) width:38 height:34 x:6 @@ -1005,7 +976,7 @@ Item { Rectangle{ height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor width: 3 anchors{ verticalCenter: parent.verticalCenter @@ -1063,7 +1034,7 @@ Item { Rectangle{ height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor width: 3 anchors{ verticalCenter: parent.verticalCenter @@ -1127,17 +1098,10 @@ Item { focusPolicy:Qt.TabFocus background: Rectangle{ color: { - if(FluTheme.dark){ - if(item_button.hovered){ - return Qt.rgba(1,1,1,0.06) - } - return Qt.rgba(0,0,0,0) - }else{ - if(item_button.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(item_button.hovered){ + return FluTheme.itemHoverColor } + return FluTheme.itemNormalColor } FluFocusRectangle{ visible: item_button.activeFocus diff --git a/src/Qt6/imports/FluentUI/Controls/FluPasswordBox.qml b/src/Qt6/imports/FluentUI/Controls/FluPasswordBox.qml index 12971300..f1476554 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluPasswordBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluPasswordBox.qml @@ -26,7 +26,7 @@ TextField{ leftPadding: padding+4 echoMode:btn_reveal.pressed ? TextField.Normal : TextField.Password renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering - selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) selectedTextColor: color placeholderTextColor: { if(!enabled){ diff --git a/src/Qt6/imports/FluentUI/Controls/FluPivot.qml b/src/Qt6/imports/FluentUI/Controls/FluPivot.qml index 26bbc280..e2a10f63 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluPivot.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluPivot.qml @@ -36,7 +36,7 @@ Page { Rectangle{ height: 3 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor width: nav_list.currentItem ? nav_list.currentItem.width : 0 y:d.tabY Behavior on width { diff --git a/src/Qt6/imports/FluentUI/Controls/FluProgressBar.qml b/src/Qt6/imports/FluentUI/Controls/FluProgressBar.qml index b80a8cf1..bca37cea 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluProgressBar.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluProgressBar.qml @@ -7,7 +7,7 @@ ProgressBar{ property int duration: 888 property real strokeWidth: 6 property bool progressVisible: false - property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color color: FluTheme.primaryColor property color backgroundColor : FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1) id:control indeterminate : true diff --git a/src/Qt6/imports/FluentUI/Controls/FluProgressButton.qml b/src/Qt6/imports/FluentUI/Controls/FluProgressButton.qml index 869cefdc..955653d8 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluProgressButton.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluProgressButton.qml @@ -13,7 +13,7 @@ Button { } property color normalColor: { if(d.checked){ - return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + return FluTheme.primaryColor }else{ return FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1) } @@ -67,7 +67,7 @@ Button { width: parent.width * control.progress height: control.progress === 1 ? background.height : 3 visible: !d.checked - color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + color: FluTheme.primaryColor anchors.bottom: parent.bottom Behavior on height{ enabled: control.progress === 1 diff --git a/src/Qt6/imports/FluentUI/Controls/FluProgressRing.qml b/src/Qt6/imports/FluentUI/Controls/FluProgressRing.qml index a956d359..730a027f 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluProgressRing.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluProgressRing.qml @@ -7,7 +7,7 @@ ProgressBar{ property int duration: 888 property real strokeWidth: 6 property bool progressVisible: false - property color color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color color: FluTheme.primaryColor property color backgroundColor : FluTheme.dark ? Qt.rgba(99/255,99/255,99/255,1) : Qt.rgba(214/255,214/255,214/255,1) id:control indeterminate : true diff --git a/src/Qt6/imports/FluentUI/Controls/FluRadioButton.qml b/src/Qt6/imports/FluentUI/Controls/FluRadioButton.qml index 2e96ad29..ac67b5ee 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluRadioButton.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluRadioButton.qml @@ -7,7 +7,7 @@ import FluentUI Button { property string contentDescription: "" property bool disabled: false - property color borderNormalColor: checked ? FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark : FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1) + property color borderNormalColor: checked ? FluTheme.primaryColor : FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1) property color borderDisableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(198/255,198/255,198/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) property color hoverColor: checked ? FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(1,1,1,1) : FluTheme.dark ? Qt.rgba(43/255,43/255,43/255,1) : Qt.rgba(222/255,222/255,222/255,1) diff --git a/src/Qt6/imports/FluentUI/Controls/FluRangeSlider.qml b/src/Qt6/imports/FluentUI/Controls/FluRangeSlider.qml index 0e39b38e..dd6c82cb 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluRangeSlider.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluRangeSlider.qml @@ -42,7 +42,7 @@ T.RangeSlider { } return control.first.hovered ? 1.2 : 1 } - iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + iconColor: FluTheme.primaryColor anchors.centerIn: parent Behavior on scale{ NumberAnimation{ @@ -73,7 +73,7 @@ T.RangeSlider { } return control.second.hovered ? 1.2 : 1 } - iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + iconColor: FluTheme.primaryColor anchors.centerIn: parent Behavior on scale{ NumberAnimation{ @@ -102,7 +102,7 @@ T.RangeSlider { y: control.horizontal ? 0 : control.second.visualPosition * parent.height + 3 width: control.horizontal ? control.second.position * parent.width - control.first.position * parent.width - 6 : 6 height: control.horizontal ? 6 : control.second.position * parent.height - control.first.position * parent.height - 6 - color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + color: FluTheme.primaryColor } } FluTooltip{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluRatingControl.qml b/src/Qt6/imports/FluentUI/Controls/FluRatingControl.qml index fdfcd859..153b470e 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluRatingControl.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluRatingControl.qml @@ -32,7 +32,7 @@ Item { } iconSize: control.size iconSource: isSelected ? FluentIcons.FavoriteStarFill : FluentIcons.FavoriteStar - iconColor: isSelected ? FluTheme.primaryColor.dark : (FluTheme.dark ? "#FFFFFF" : "#000000") + iconColor: isSelected ? FluTheme.primaryColor : (FluTheme.dark ? "#FFFFFF" : "#000000") anchors.centerIn: parent } } diff --git a/src/Qt6/imports/FluentUI/Controls/FluScreenshot.qml b/src/Qt6/imports/FluentUI/Controls/FluScreenshot.qml index ca49deeb..7407e04d 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluScreenshot.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluScreenshot.qml @@ -11,7 +11,7 @@ Item{ property int dotSize: 5 property int borderSize: 1 property var saveFolder: StandardPaths.standardLocations(StandardPaths.PicturesLocation)[0] - property color borderColor: FluTheme.primaryColor.dark + property color borderColor: FluTheme.primaryColor signal captrueCompleted(var captrue) QtObject{ id:d @@ -508,7 +508,7 @@ Item{ } FluIconButton{ iconSource: FluentIcons.AcceptMedium - iconColor: FluTheme.primaryColor.dark + iconColor: FluTheme.primaryColor onClicked: { screenshot_background.capture(screenshot.start,screenshot.end) } diff --git a/src/Qt6/imports/FluentUI/Controls/FluSlider.qml b/src/Qt6/imports/FluentUI/Controls/FluSlider.qml index 1b8829d2..fa32c591 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluSlider.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluSlider.qml @@ -40,7 +40,7 @@ T.Slider { } return control.hovered ? 1.2 : 1 } - iconColor:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + iconColor: FluTheme.primaryColor anchors.centerIn: parent } } @@ -63,7 +63,7 @@ T.Slider { width: control.horizontal ? control.position * parent.width : 6 height: control.horizontal ? 6 : control.position * parent.height radius: 3 - color:FluTheme.dark ? FluTheme.primaryColor.lighter :FluTheme.primaryColor.dark + color: FluTheme.primaryColor } } FluTooltip{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluSpinBox.qml b/src/Qt6/imports/FluentUI/Controls/FluSpinBox.qml index 4cf99c06..161b18d6 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluSpinBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluSpinBox.qml @@ -40,7 +40,7 @@ T.SpinBox { } return normalColor } - selectionColor: Qt.alpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) selectedTextColor: color horizontalAlignment: Qt.AlignHCenter verticalAlignment: Qt.AlignVCenter @@ -53,10 +53,13 @@ T.SpinBox { anchors.bottom: parent.bottom visible: contentItem.enabled color: { + if(contentItem.activeFocus){ + return FluTheme.primaryColor + } if(FluTheme.dark){ - contentItem.activeFocus ? FluTheme.primaryColor.lighter : Qt.rgba(166/255,166/255,166/255,1) + return Qt.rgba(166/255,166/255,166/255,1) }else{ - return contentItem.activeFocus ? FluTheme.primaryColor.dark : Qt.rgba(183/255,183/255,183/255,1) + return Qt.rgba(183/255,183/255,183/255,1) } } Behavior on height{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluTabView.qml b/src/Qt6/imports/FluentUI/Controls/FluTabView.qml index f0532028..9f905e71 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTabView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTabView.qml @@ -189,23 +189,13 @@ Item { anchors.fill: parent radius: [6,6,0,0] color: { - if(FluTheme.dark){ - if(item_mouse_hove.containsMouse || item_btn_close.hovered){ - return Qt.rgba(1,1,1,0.03) - } - if(tab_nav.currentIndex === index){ - return Qt.rgba(1,1,1,0.06) - } - return Qt.rgba(0,0,0,0) - }else{ - if(item_mouse_hove.containsMouse || item_btn_close.hovered){ - return Qt.rgba(0,0,0,0.03) - } - if(tab_nav.currentIndex === index){ - return Qt.rgba(0,0,0,0.06) - } - return Qt.rgba(0,0,0,0) + if(item_mouse_hove.containsMouse || item_btn_close.hovered){ + return FluTheme.itemHoverColor } + if(tab_nav.currentIndex === index){ + return FluTheme.itemCheckColor + } + return FluTheme.itemNormalColor } } RowLayout{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluTableView.qml b/src/Qt6/imports/FluentUI/Controls/FluTableView.qml index b19e406f..8e3543e5 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTableView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTableView.qml @@ -270,7 +270,7 @@ Rectangle { Rectangle{ height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor width: 3 visible: d.currentRow === table_model.getRow(row).__index && column === 0 anchors{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluText.qml b/src/Qt6/imports/FluentUI/Controls/FluText.qml index 86dfa5b7..40c65009 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluText.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluText.qml @@ -3,7 +3,7 @@ import QtQuick.Controls import FluentUI Text { - property color textColor: FluTheme.dark ? FluColors.White : FluColors.Grey220 + property color textColor: FluTheme.fontPrimaryColor id:text color: textColor renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering diff --git a/src/Qt6/imports/FluentUI/Controls/FluTextBox.qml b/src/Qt6/imports/FluentUI/Controls/FluTextBox.qml index 9d72915f..02b43853 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTextBox.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTextBox.qml @@ -26,7 +26,7 @@ TextField{ } font:FluTextStyle.Body renderType: FluTheme.nativeText ? Text.NativeRendering : Text.QtRendering - selectionColor: FluTools.colorAlpha(FluTheme.primaryColor.lightest,0.6) + selectionColor: FluTools.colorAlpha(FluTheme.primaryColor,0.25) selectedTextColor: color placeholderTextColor: { if(!enabled){ diff --git a/src/Qt6/imports/FluentUI/Controls/FluTextBoxBackground.qml b/src/Qt6/imports/FluentUI/Controls/FluTextBoxBackground.qml index f81ed2bd..31f09307 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTextBoxBackground.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTextBoxBackground.qml @@ -36,10 +36,13 @@ FluClip{ anchors.bottom: parent.bottom visible: !inputItem.disabled color: { + if(inputItem.activeFocus){ + return FluTheme.primaryColor + } if(FluTheme.dark){ - return inputItem.activeFocus ? FluTheme.primaryColor.lighter : Qt.rgba(166/255,166/255,166/255,1) + return Qt.rgba(166/255,166/255,166/255,1) }else{ - return inputItem.activeFocus ? FluTheme.primaryColor.dark : Qt.rgba(134/255,134/255,134/255,1) + return Qt.rgba(134/255,134/255,134/255,1) } } Behavior on height{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluTextButton.qml b/src/Qt6/imports/FluentUI/Controls/FluTextButton.qml index d111e138..68d98129 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTextButton.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTextButton.qml @@ -6,14 +6,14 @@ import FluentUI Button { property bool disabled: false property string contentDescription: "" - property color normalColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color normalColor: FluTheme.primaryColor property color hoverColor: FluTheme.dark ? Qt.darker(normalColor,1.15) : Qt.lighter(normalColor,1.15) property color pressedColor: FluTheme.dark ? Qt.darker(normalColor,1.3) : Qt.lighter(normalColor,1.3) property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(199/255,199/255,199/255,1) - property color backgroundHoverColor: FluTheme.dark ? Qt.rgba(1,1,1,0.03) : Qt.rgba(0,0,0,0.03) - property color backgroundPressedColor: FluTheme.dark ? Qt.rgba(1,1,1,0.06) : Qt.rgba(0,0,0,0.06) - property color backgroundNormalColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) - property color backgroundDisableColor: FluTheme.dark ? Qt.rgba(0,0,0,0) : Qt.rgba(0,0,0,0) + property color backgroundHoverColor: FluTheme.itemHoverColor + property color backgroundPressedColor: FluTheme.itemPressColor + property color backgroundNormalColor: FluTheme.itemNormalColor + property color backgroundDisableColor: FluTheme.itemNormalColor property bool textBold: true property color textColor: { if(!enabled){ diff --git a/src/Qt6/imports/FluentUI/Controls/FluTimePicker.qml b/src/Qt6/imports/FluentUI/Controls/FluTimePicker.qml index 810153d2..3116dc1e 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTimePicker.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTimePicker.qml @@ -184,11 +184,7 @@ Rectangle { anchors.rightMargin: 5 color: { if(getListView().currentIndex === position){ - if(FluTheme.dark){ - return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor.lighter,1.1) : FluTheme.primaryColor.lighter - }else{ - return item_mouse.containsMouse ? Qt.lighter(FluTheme.primaryColor.dark,1.1): FluTheme.primaryColor.dark - } + return item_mouse.containsMouse ? Qt.darker(FluTheme.primaryColor,1.1) : FluTheme.primaryColor } if(item_mouse.containsMouse){ return FluTheme.dark ? Qt.rgba(63/255,60/255,61/255,1) : Qt.rgba(237/255,237/255,242/255,1) diff --git a/src/Qt6/imports/FluentUI/Controls/FluTimeline.qml b/src/Qt6/imports/FluentUI/Controls/FluTimeline.qml index 01c9e017..37f69e94 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTimeline.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTimeline.qml @@ -82,7 +82,7 @@ Item{ radius: 8 border.width: 4 color:FluTheme.dark ? Qt.rgba(0,0,0,1) : Qt.rgba(1,1,1,1) - border.color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + border.color: FluTheme.primaryColor } } @@ -92,7 +92,7 @@ Item{ wrapMode: Text.WrapAnywhere horizontalAlignment: isRight ? Qt.AlignRight : Qt.AlignLeft text: modelData.lable - color: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + color: FluTheme.primaryColor } } diff --git a/src/Qt6/imports/FluentUI/Controls/FluToggleButton.qml b/src/Qt6/imports/FluentUI/Controls/FluToggleButton.qml index 9d03b3b4..e4580dac 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluToggleButton.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluToggleButton.qml @@ -8,7 +8,7 @@ Button { property string contentDescription: "" property color normalColor: { if(checked){ - return FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + return FluTheme.primaryColor }else{ return FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(254/255,254/255,254/255,1) } diff --git a/src/Qt6/imports/FluentUI/Controls/FluToggleSwitch.qml b/src/Qt6/imports/FluentUI/Controls/FluToggleSwitch.qml index 5dbfdb2c..005ff6c7 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluToggleSwitch.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluToggleSwitch.qml @@ -8,11 +8,11 @@ Button { property bool disabled: false property string contentDescription: "" property color disableColor: FluTheme.dark ? Qt.rgba(82/255,82/255,82/255,1) : Qt.rgba(233/255,233/255,233/255,1) - property color checkColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color checkColor: FluTheme.primaryColor property color hoverColor: FluTheme.dark ? Qt.rgba(62/255,62/255,62/255,1) : Qt.rgba(240/255,240/255,240/255,1) property color normalColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(253/255,253/255,253/255,1) property color borderNormalColor: FluTheme.dark ? Qt.rgba(161/255,161/255,161/255,1) : Qt.rgba(141/255,141/255,141/255,1) - property color borderCheckColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color borderCheckColor: FluTheme.primaryColor property color borderDisableColor: FluTheme.dark ? Qt.rgba(50/255,50/255,50/255,1) : Qt.rgba(200/255,200/255,200/255,1) property color dotNormalColor: FluTheme.dark ? Qt.rgba(208/255,208/255,208/255,1) : Qt.rgba(93/255,93/255,93/255,1) property color dotCheckColor: FluTheme.dark ? Qt.rgba(0/255,0/255,0/255,1) : Qt.rgba(255/255,255/255,255/255,1) diff --git a/src/Qt6/imports/FluentUI/Controls/FluTreeView.qml b/src/Qt6/imports/FluentUI/Controls/FluTreeView.qml index b999fd73..de2bd0fe 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluTreeView.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluTreeView.qml @@ -22,7 +22,7 @@ Item { property int dropIndex: -1 property bool isDropTopArea: false property int dragIndex: -1 - property color hitColor: FluTheme.dark ? FluTheme.primaryColor.lighter : FluTheme.primaryColor.dark + property color hitColor: FluTheme.primaryColor } onDataSourceChanged: { tree_model.setDataSource(dataSource) @@ -138,7 +138,7 @@ Item { width: 3 height: 18 radius: 1.5 - color: FluTheme.primaryColor.dark + color: FluTheme.primaryColor visible: isCurrent anchors{ left: parent.left @@ -322,29 +322,16 @@ Item { border.color: d.hitColor border.width: d.dragIndex === rowIndex ? 1 : 0 color: { - if(FluTheme.dark){ - if(isCurrent){ - return Qt.rgba(1,1,1,0.06) - } - if(item_mouse.containsMouse || item_check_box.hovered){ - return Qt.rgba(1,1,1,0.03) - } - if(item_loader_expand.item && item_loader_expand.item.hovered){ - return Qt.rgba(1,1,1,0.03) - } - return Qt.rgba(0,0,0,0) - }else{ - if(isCurrent){ - return Qt.rgba(0,0,0,0.06) - } - if(item_mouse.containsMouse || item_check_box.hovered){ - return Qt.rgba(0,0,0,0.03) - } - if(item_loader_expand.item && item_loader_expand.item.hovered){ - return Qt.rgba(0,0,0,0.03) - } - return Qt.rgba(0,0,0,0) + if(isCurrent){ + return FluTheme.itemCheckColor } + if(item_mouse.containsMouse || item_check_box.hovered){ + return FluTheme.itemHoverColor + } + if(item_loader_expand.item && item_loader_expand.item.hovered){ + return FluTheme.itemHoverColor + } + return FluTheme.itemNormalColor } } RowLayout{ diff --git a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml index 5f455836..ab157809 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluWindow.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluWindow.qml @@ -15,9 +15,9 @@ Window { property var appBar: com_app_bar property color backgroundColor: { if(active){ - return FluTheme.dark ? Qt.rgba(26/255,34/255,40/255,1) : Qt.rgba(243/255,243/255,243/255,1) + return FluTheme.windowActiveBackgroundColor } - return FluTheme.dark ? Qt.rgba(32/255,32/255,32/255,1) : Qt.rgba(237/255,237/255,237/255,1) + return FluTheme.windowBackgroundColor } property bool stayTop: false property var _pageRegister