[vlc-commits] qt: win32 intf: Fix task bar icon display

Hugo Beauzée-Luyssen git at videolan.org
Mon Aug 7 14:12:24 CEST 2017


vlc | branch: master | Hugo Beauzée-Luyssen <hugo at beauzee.fr> | Mon Aug  7 13:31:37 2017 +0200| [60ec2eb971fb1596069d196d016806b3f7f9e030] | committer: Hugo Beauzée-Luyssen

qt: win32 intf: Fix task bar icon display

refs #18650

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=60ec2eb971fb1596069d196d016806b3f7f9e030
---

 modules/gui/qt/main_interface_win32.cpp | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/modules/gui/qt/main_interface_win32.cpp b/modules/gui/qt/main_interface_win32.cpp
index f1dcadf466..e5f0629511 100644
--- a/modules/gui/qt/main_interface_win32.cpp
+++ b/modules/gui/qt/main_interface_win32.cpp
@@ -157,7 +157,9 @@ void MainInterfaceWin32::createTaskBarButtons()
     p_taskbl = (ITaskbarList3 *)pv;
     p_taskbl->HrInit();
 
-    himl = ImageList_Create( 16 /*cx*/, 16 /*cy*/, ILC_COLOR32 /*flags*/,
+    int iconX = GetSystemMetrics(SM_CXSMICON);
+    int iconY = GetSystemMetrics(SM_CYSMICON);
+    himl = ImageList_Create( iconX /*cx*/, iconY /*cy*/, ILC_COLOR32 /*flags*/,
                              4 /*cInitial*/, 0 /*cGrow*/);
     if( himl == NULL )
     {
@@ -167,10 +169,10 @@ void MainInterfaceWin32::createTaskBarButtons()
         return;
     }
 
-    QPixmap img   = QPixmap(":/win7/prev");
-    QPixmap img2  = QPixmap(":/win7/pause");
-    QPixmap img3  = QPixmap(":/win7/play");
-    QPixmap img4  = QPixmap(":/win7/next");
+    QPixmap img   = QPixmap(":/win7/prev").scaled( iconX, iconY );
+    QPixmap img2  = QPixmap(":/win7/pause").scaled( iconX, iconY );
+    QPixmap img3  = QPixmap(":/win7/play").scaled( iconX, iconY );
+    QPixmap img4  = QPixmap(":/win7/next").scaled( iconX, iconY );
     QBitmap mask  = img.createMaskFromColor(Qt::transparent);
     QBitmap mask2 = img2.createMaskFromColor(Qt::transparent);
     QBitmap mask3 = img3.createMaskFromColor(Qt::transparent);



More information about the vlc-commits mailing list