From 91ffccb1a8454d9500f024dd3d35ab6c2246704a Mon Sep 17 00:00:00 2001 From: Claudio Cambra Date: Mon, 25 Nov 2024 16:42:39 +0800 Subject: [PATCH] Use Style.darkMode instead of Theme.darkMode This way we avoid the computation that happens in Theme::darkMode each time the property is accessed Signed-off-by: Claudio Cambra --- src/gui/tray/ActivityItemContent.qml | 2 +- src/gui/tray/CallNotificationDialog.qml | 2 +- src/gui/tray/UnifiedSearchResultListItem.qml | 6 +++--- src/gui/tray/UserLine.qml | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gui/tray/ActivityItemContent.qml b/src/gui/tray/ActivityItemContent.qml index cc56103e4..98ea3c227 100644 --- a/src/gui/tray/ActivityItemContent.qml +++ b/src/gui/tray/ActivityItemContent.qml @@ -104,7 +104,7 @@ RowLayout { cache: true fillMode: Image.PreserveAspectFit - source: Theme.darkMode ? model.darkIcon : model.lightIcon + source: Style.darkMode ? model.darkIcon : model.lightIcon sourceSize.height: 64 sourceSize.width: 64 mipmap: true // Addresses grainy downscale diff --git a/src/gui/tray/CallNotificationDialog.qml b/src/gui/tray/CallNotificationDialog.qml index 22f11da71..3ebe3bd65 100644 --- a/src/gui/tray/CallNotificationDialog.qml +++ b/src/gui/tray/CallNotificationDialog.qml @@ -163,7 +163,7 @@ ApplicationWindow { cache: true source: root.usingUserAvatar ? root.talkNotificationData.userAvatar : - Theme.darkMode ? root.talkIcon + palette.windowText : root.talkIcon + Style.ncBlue + Style.darkMode ? root.talkIcon + palette.windowText : root.talkIcon + Style.ncBlue sourceSize.width: Style.accountAvatarSize sourceSize.height: Style.accountAvatarSize diff --git a/src/gui/tray/UnifiedSearchResultListItem.qml b/src/gui/tray/UnifiedSearchResultListItem.qml index bc3588e6e..97092b23c 100644 --- a/src/gui/tray/UnifiedSearchResultListItem.qml +++ b/src/gui/tray/UnifiedSearchResultListItem.qml @@ -56,9 +56,9 @@ MouseArea { anchors.fill: parent title: model.resultTitle subline: model.subline - icons: Theme.darkMode ? model.darkIcons : model.lightIcons - iconsIsThumbnail: Theme.darkMode ? model.darkIconsIsThumbnail : model.lightIconsIsThumbnail - iconPlaceholder: Theme.darkMode ? model.darkImagePlaceholder : model.lightImagePlaceholder + icons: Style.darkMode ? model.darkIcons : model.lightIcons + iconsIsThumbnail: Style.darkMode ? model.darkIconsIsThumbnail : model.lightIconsIsThumbnail + iconPlaceholder: Style.darkMode ? model.darkImagePlaceholder : model.lightImagePlaceholder isRounded: model.isRounded && iconsIsThumbnail } } diff --git a/src/gui/tray/UserLine.qml b/src/gui/tray/UserLine.qml index 6502817e9..010a9391b 100644 --- a/src/gui/tray/UserLine.qml +++ b/src/gui/tray/UserLine.qml @@ -41,7 +41,7 @@ AbstractButton { Layout.leftMargin: Style.accountIconsMenuMargin verticalAlignment: Qt.AlignCenter cache: false - source: model.avatar !== "" ? model.avatar : Theme.darkMode ? "image://avatars/fallbackWhite" : "image://avatars/fallbackBlack" + source: model.avatar !== "" ? model.avatar : Style.darkMode ? "image://avatars/fallbackWhite" : "image://avatars/fallbackBlack" Layout.preferredHeight: Style.accountAvatarSize Layout.preferredWidth: Style.accountAvatarSize -- 2.30.2