From d75ecfeca718ed1cb8754bd10ec3dda28e6c5c45 Mon Sep 17 00:00:00 2001 From: lucky9loogn Date: Mon, 25 Nov 2024 09:50:05 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20FluPivot=20=E7=9A=84=20hea?= =?UTF-8?q?der=20=E9=80=89=E4=B8=AD=E9=A1=B9=E6=9C=AA=E9=AB=98=E4=BA=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Qt5/imports/FluentUI/Controls/FluPivot.qml | 13 +++++++++---- src/Qt6/imports/FluentUI/Controls/FluPivot.qml | 13 +++++++++---- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Qt5/imports/FluentUI/Controls/FluPivot.qml b/src/Qt5/imports/FluentUI/Controls/FluPivot.qml index 866af6b6..ce45429a 100644 --- a/src/Qt5/imports/FluentUI/Controls/FluPivot.qml +++ b/src/Qt5/imports/FluentUI/Controls/FluPivot.qml @@ -5,8 +5,9 @@ import FluentUI 1.0 Page { default property alias content: d.children property alias currentIndex: nav_list.currentIndex + property color textHighlightColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black property color textNormalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120 - property color textHoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black + property color textHoverColor: FluTheme.dark ? FluColors.Grey80 : FluColors.Grey150 property int textSpacing: 10 property int headerSpacing: 20 property int headerHeight: 40 @@ -66,9 +67,13 @@ Page { anchors.centerIn: parent font: control.font color: { - if(item_button.hovered) - return textHoverColor - return textNormalColor + if(nav_list.currentIndex === index) { + return textHighlightColor; + } + if (item_button.hovered) { + return textHoverColor; + } + return textNormalColor; } } } diff --git a/src/Qt6/imports/FluentUI/Controls/FluPivot.qml b/src/Qt6/imports/FluentUI/Controls/FluPivot.qml index 38a19f04..7c0a9681 100644 --- a/src/Qt6/imports/FluentUI/Controls/FluPivot.qml +++ b/src/Qt6/imports/FluentUI/Controls/FluPivot.qml @@ -6,8 +6,9 @@ import FluentUI Page { default property alias content: d.children property alias currentIndex: nav_list.currentIndex + property color textHighlightColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black property color textNormalColor: FluTheme.dark ? FluColors.Grey120 : FluColors.Grey120 - property color textHoverColor: FluTheme.dark ? FluColors.Grey10 : FluColors.Black + property color textHoverColor: FluTheme.dark ? FluColors.Grey80 : FluColors.Grey150 property int textSpacing: 10 property int headerSpacing: 20 property int headerHeight: 40 @@ -67,9 +68,13 @@ Page { anchors.centerIn: parent font: control.font color: { - if(item_button.hovered) - return textHoverColor - return textNormalColor + if(nav_list.currentIndex === index) { + return textHighlightColor; + } + if (item_button.hovered) { + return textHoverColor; + } + return textNormalColor; } } }