From 8778021bcfe119c51192ce4924e5faaf6a428a17 Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Tue, 15 Aug 2023 15:00:19 +0800 Subject: [PATCH] Make accent colour of NCTabButton in file details follow user accent colour Signed-off-by: Claudio Cambra --- src/gui/filedetails/FileDetailsPage.qml | 3 +++ src/gui/filedetails/FileDetailsView.qml | 1 + src/gui/filedetails/NCTabButton.qml | 3 ++- src/gui/tray/Window.qml | 1 + 4 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/filedetails/FileDetailsPage.qml b/src/gui/filedetails/FileDetailsPage.qml index 2868ad67b..45f871414 100644 --- a/src/gui/filedetails/FileDetailsPage.qml +++ b/src/gui/filedetails/FileDetailsPage.qml @@ -38,6 +38,7 @@ Page { property StackView rootStackView: StackView {} property bool showCloseButton: false property bool backgroundsVisible: true + property color accentColor: Style.ncBlue property FileDetails fileDetails: FileDetails { id: fileDetails @@ -227,6 +228,7 @@ Page { NCTabButton { svgCustomColorSource: "image://svgimage-custom-color/activity.svg" text: qsTr("Activity") + accentColor: root.accentColor checked: swipeView.currentIndex === fileActivityView.swipeIndex onClicked: swipeView.currentIndex = fileActivityView.swipeIndex } @@ -236,6 +238,7 @@ Page { height: visible ? implicitHeight : 0 svgCustomColorSource: "image://svgimage-custom-color/share.svg" text: qsTr("Sharing") + accentColor: root.accentColor checked: swipeView.currentIndex === shareViewLoader.swipeIndex onClicked: swipeView.currentIndex = shareViewLoader.swipeIndex visible: root.fileDetails.sharingAvailable diff --git a/src/gui/filedetails/FileDetailsView.qml b/src/gui/filedetails/FileDetailsView.qml index 93e130e05..5fae863d4 100644 --- a/src/gui/filedetails/FileDetailsView.qml +++ b/src/gui/filedetails/FileDetailsView.qml @@ -27,6 +27,7 @@ StackView { property alias accountState: fileDetailsPage.accountState property alias localPath: fileDetailsPage.localPath property alias showCloseButton: fileDetailsPage.showCloseButton + property alias accentColor: fileDetailsPage.accentColor property bool backgroundsVisible: true background: Rectangle { diff --git a/src/gui/filedetails/NCTabButton.qml b/src/gui/filedetails/NCTabButton.qml index dfd31faaf..8c6c7426f 100644 --- a/src/gui/filedetails/NCTabButton.qml +++ b/src/gui/filedetails/NCTabButton.qml @@ -25,6 +25,7 @@ TabButton { id: tabButton property string svgCustomColorSource: "" + property color accentColor: Style.ncBlue padding: Style.smallSpacing background: Rectangle { @@ -82,7 +83,7 @@ TabButton { implicitWidth: textWidth + Style.standardSpacing * 2 implicitHeight: 2 - color: tabButton.checked ? Style.ncBlue : tabButton.hovered ? palette.highlight : "transparent" + color: tabButton.checked ? tabButton.accentColor : tabButton.hovered ? palette.highlight : "transparent" } } } diff --git a/src/gui/tray/Window.qml b/src/gui/tray/Window.qml index 60ec7748e..adbf1480f 100644 --- a/src/gui/tray/Window.qml +++ b/src/gui/tray/Window.qml @@ -231,6 +231,7 @@ ApplicationWindow { height: parent.height backgroundsVisible: false + accentColor: Style.currentUserHeaderColor accountState: fileDetailsDrawer.folderAccountState localPath: fileDetailsDrawer.fileLocalPath showCloseButton: true -- 2.30.2