[vlc-commits] [Git][videolan/vlc][master] 2 commits: qt: refactor icon condition

Felix Paul Kühne (@fkuehne) gitlab at videolan.org
Fri Dec 29 11:47:33 UTC 2023



Felix Paul Kühne pushed to branch master at VideoLAN / VLC


Commits:
efb0c30b by Prince Gupta at 2023-12-29T11:26:59+00:00
qt: refactor icon condition

- - - - -
20240de9 by Prince Gupta at 2023-12-29T11:26:59+00:00
qml: use correct cone

- - - - -


3 changed files:

- modules/gui/qt/maininterface/mainctx.cpp
- modules/gui/qt/maininterface/mainctx.hpp
- modules/gui/qt/widgets/qml/BannerCone.qml


Changes:

=====================================
modules/gui/qt/maininterface/mainctx.cpp
=====================================
@@ -609,7 +609,7 @@ VideoSurfaceProvider* MainCtx::getVideoSurfaceProvider() const
 void MainCtx::createSystray()
 {
     QIcon iconVLC;
-    if( QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY && var_InheritBool( p_intf, "qt-icon-change" ) )
+    if( useXmasCone() )
         iconVLC = QIcon::fromTheme( "vlc-xmas", QIcon( ":/logo/vlc128-xmas.png" ) );
     else
         iconVLC = QIcon::fromTheme( "vlc", QIcon( ":/logo/vlc256.png" ) );
@@ -926,6 +926,12 @@ double MainCtx::dp(const double px) const
     return dp(px, m_intfScaleFactor);
 }
 
+bool MainCtx::useXmasCone() const
+{
+    return (QDate::currentDate().dayOfYear() >= QT_XMAS_JOKE_DAY)
+            && var_InheritBool( p_intf, "qt-icon-change" );
+}
+
 bool WindowStateHolder::holdFullscreen(QWindow *window, Source source, bool hold)
 {
     QVariant prop = window->property("__windowFullScreen");


=====================================
modules/gui/qt/maininterface/mainctx.hpp
=====================================
@@ -257,6 +257,8 @@ public:
     Q_INVOKABLE static double dp(const double px, const double scale);
     Q_INVOKABLE double dp(const double px) const;
 
+    Q_INVOKABLE bool useXmasCone() const;
+
 protected:
     /* Systray */
     void createSystray();


=====================================
modules/gui/qt/widgets/qml/BannerCone.qml
=====================================
@@ -31,9 +31,10 @@ Image {
 
     sourceSize.width: VLCStyle.icon_normal
     sourceSize.height: VLCStyle.icon_normal
-    source: SVGColorImage.colorize("qrc:///misc/cone.svg")
-                    .accent(root.color)
-                    .uri()
+
+    mipmap: MainCtx.useXmasCone()
+    source: MainCtx.useXmasCone() ? "qrc:///logo/vlc48-xmas.png" // TODO: new xmas cone for designs?
+                                  : SVGColorImage.colorize("qrc:///misc/cone.svg").accent(root.color).uri()
 
     focus: false
 



View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a601be4340222186ebdaaa67d0c5ae69e1910578...20240de902628d8b2cea4f1fe60a516d1338dce5

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/compare/a601be4340222186ebdaaa67d0c5ae69e1910578...20240de902628d8b2cea4f1fe60a516d1338dce5
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list