[vlc-commits] [Git][videolan/vlc][master] qml/Player: Remove theme switching based on cover luminance
    Hugo Beauzée-Luyssen (@chouquette) 
    gitlab at videolan.org
       
    Sun Oct 10 16:43:48 UTC 2021
    
    
  
Hugo Beauzée-Luyssen pushed to branch master at VideoLAN / VLC
Commits:
a9581488 by Benjamin Arnaud at 2021-10-10T12:40:05+00:00
qml/Player: Remove theme switching based on cover luminance
And remove the 'dayColors' property in VLCColors.
Fix #26024
- - - - -
2 changed files:
- modules/gui/qt/player/qml/Player.qml
- modules/gui/qt/style/VLCStyle.qml
Changes:
=====================================
modules/gui/qt/player/qml/Player.qml
=====================================
@@ -44,8 +44,10 @@ FocusScope {
     readonly property string coverSource: (mainPlaylistController.currentItem.artwork && mainPlaylistController.currentItem.artwork.toString())
                                           ? mainPlaylistController.currentItem.artwork
                                           : VLCStyle.noArtCover
-    readonly property VLCColors colors: (mainInterface.hasEmbededVideo || (coverLuminance.luminance < 140))
-                                        ? VLCStyle.nightColors : VLCStyle.dayColors
+
+    // NOTE: We force the night theme when playing a video.
+    readonly property VLCColors colors: (mainInterface.hasEmbededVideo) ? VLCStyle.nightColors
+                                                                        : VLCStyle.colors
 
     Keys.priority: Keys.AfterItem
     Keys.onPressed: {
@@ -105,13 +107,6 @@ FocusScope {
         }
     }
 
-    ImageLuminanceExtractor {
-        id: coverLuminance
-
-        enabled: !rootPlayer.hasEmbededVideo
-        source: rootPlayer.coverSource
-    }
-
     VideoSurface {
         id: videoSurface
 
=====================================
modules/gui/qt/style/VLCStyle.qml
=====================================
@@ -39,7 +39,6 @@ QtObject {
     // When trying to force night/dark theme colors for items,
     // this can be used:
     readonly property VLCColors nightColors: VLCColors { state: "night" }
-    readonly property VLCColors dayColors: VLCColors { state: "day" }
 
     // Sizes
     readonly property double margin_xxxsmall: dp(2, scale);
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a9581488bc666579f3a859541d92ae2e7fc66c0d
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/a9581488bc666579f3a859541d92ae2e7fc66c0d
You're receiving this email because of your account on code.videolan.org.
    
    
More information about the vlc-commits
mailing list