Use Style.darkMode instead of Theme.darkMode
authorClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 25 Nov 2024 08:42:39 +0000 (16:42 +0800)
committerClaudio Cambra <claudio.cambra@nextcloud.com>
Mon, 25 Nov 2024 08:42:39 +0000 (16:42 +0800)
This way we avoid the computation that happens in Theme::darkMode each
time the property is accessed

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
src/gui/tray/ActivityItemContent.qml
src/gui/tray/CallNotificationDialog.qml
src/gui/tray/UnifiedSearchResultListItem.qml
src/gui/tray/UserLine.qml

index cc56103e4019405f285affb8d161a0778a64dc81..98ea3c2277f0400329d8c57200a6fdb961ff72dc 100644 (file)
@@ -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
index 22f11da71fb5e277d6fdd125fb691da92407e1b8..3ebe3bd65c2f6216e5127aecbee11be73355e377 100644 (file)
@@ -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
 
index bc3588e6e527f61e5abf74e5e92e2a6c0b82f2ec..97092b23c6f0030162dbf19a9f6a8e75255af409 100644 (file)
@@ -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
         }
     }
index 6502817e9f135a6a19670ac24af864091b060099..010a9391b08b9363f98df2f5290e9fdfa53c34b3 100644 (file)
@@ -41,7 +41,7 @@ AbstractButton {
             Layout.leftMargin: Style.accountIconsMenuMargin\r
             verticalAlignment: Qt.AlignCenter\r
             cache: false\r
-            source: model.avatar !== "" ? model.avatar : Theme.darkMode ? "image://avatars/fallbackWhite" : "image://avatars/fallbackBlack"\r
+            source: model.avatar !== "" ? model.avatar : Style.darkMode ? "image://avatars/fallbackWhite" : "image://avatars/fallbackBlack"\r
             Layout.preferredHeight: Style.accountAvatarSize\r
             Layout.preferredWidth: Style.accountAvatarSize\r
 \r