• R/O
  • SSH
  • HTTPS

tortoisesvn: Commit


Commit MetaInfo

Revision28201 (tree)
Time2018-04-21 21:29:02
Authorstefankueng

Log Message

Make the toolbar icons size up for high dpi monitors.

Change Summary

Incremental Difference

--- trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28200)
+++ trunk/src/TortoiseProc/LogDialog/LogDlg.cpp (revision 28201)
@@ -64,6 +64,7 @@
6464 #include "RenameDlg.h"
6565 #include "..\..\ext\snarl\SnarlInterface.h"
6666 #include "ToastNotifications.h"
67+#include "DPIAware.h"
6768 #include <tlhelp32.h>
6869 #include <shlwapi.h>
6970 #include <fstream>
@@ -7729,12 +7730,14 @@
77297730 #define MONITORMODE_TOOLBARBUTTONCOUNT 10
77307731 TBBUTTON tbb[MONITORMODE_TOOLBARBUTTONCOUNT] = { 0 };
77317732 // create an image list containing the icons for the toolbar
7732- if (!m_toolbarImages.Create(24, 24, ILC_COLOR32 | ILC_MASK, MONITORMODE_TOOLBARBUTTONCOUNT, 4))
7733+ const int iconSizeX = int(24 * CDPIAware::Instance().ScaleFactorX());
7734+ const int iconSizeY = int(24 * CDPIAware::Instance().ScaleFactorX());
7735+ if (!m_toolbarImages.Create(iconSizeX, iconSizeY, ILC_COLOR32 | ILC_MASK, MONITORMODE_TOOLBARBUTTONCOUNT, 4))
77337736 return false;
77347737 auto iString = ::SendMessage(m_hwndToolbar, TB_ADDSTRING,
77357738 (WPARAM)AfxGetResourceHandle(), (LPARAM)IDS_MONITOR_TOOLBARTEXTS);
77367739 int index = 0;
7737- HICON hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_GETALL, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7740+ HICON hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_GETALL, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77387741 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77397742 tbb[index].idCommand = ID_LOGDLG_MONITOR_CHECKREPOSITORIESNOW;
77407743 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
@@ -7749,7 +7752,7 @@
77497752 tbb[index].dwData = 0;
77507753 tbb[index++].iString = 0;
77517754
7752- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_ADD, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7755+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_ADD, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77537756 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77547757 tbb[index].idCommand = ID_LOGDLG_MONITOR_ADDPROJECT;
77557758 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
@@ -7757,7 +7760,7 @@
77577760 tbb[index].dwData = 0;
77587761 tbb[index++].iString = iString++;
77597762
7760- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_EDIT, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7763+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_EDIT, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77617764 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77627765 tbb[index].idCommand = ID_LOGDLG_MONITOR_EDIT;
77637766 tbb[index].fsState = BTNS_SHOWTEXT;
@@ -7765,7 +7768,7 @@
77657768 tbb[index].dwData = 0;
77667769 tbb[index++].iString = iString++;
77677770
7768- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_REMOVE, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7771+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_REMOVE, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77697772 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77707773 tbb[index].idCommand = ID_LOGDLG_MONITOR_REMOVE;
77717774 tbb[index].fsState = BTNS_SHOWTEXT;
@@ -7780,7 +7783,7 @@
77807783 tbb[index].dwData = 0;
77817784 tbb[index++].iString = 0;
77827785
7783- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_MARKALLASREAD, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7786+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_MARKALLASREAD, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77847787 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77857788 tbb[index].idCommand = ID_MISC_MARKALLASREAD;
77867789 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
@@ -7788,7 +7791,7 @@
77887791 tbb[index].dwData = 0;
77897792 tbb[index++].iString = iString++;
77907793
7791- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_UPDATE, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7794+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_UPDATE, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
77927795 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
77937796 tbb[index].idCommand = ID_MISC_UPDATE;
77947797 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
@@ -7803,7 +7806,7 @@
78037806 tbb[index].dwData = 0;
78047807 tbb[index++].iString = 0;
78057808
7806- hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_OPTIONS, 0, 0, LR_VGACOLOR | LR_DEFAULTSIZE | LR_LOADTRANSPARENT);
7809+ hIcon = CCommonAppUtils::LoadIconEx(IDI_MONITOR_OPTIONS, iconSizeX, iconSizeY, LR_VGACOLOR | LR_LOADTRANSPARENT);
78077810 tbb[index].iBitmap = m_toolbarImages.Add(hIcon);
78087811 tbb[index].idCommand = ID_MISC_OPTIONS;
78097812 tbb[index].fsState = TBSTATE_ENABLED | BTNS_SHOWTEXT;
--- trunk/src/Changelog.txt (revision 28200)
+++ trunk/src/Changelog.txt (revision 28201)
@@ -5,6 +5,8 @@
55 an error. (Stefan)
66 - BUG: Crash when trying to unshelve from
77 an outdated or corrupted working copy. (Stefan)
8+- CHG: Improved project monitor toolbar for
9+ high dpi monitors. (Stefan)
810
911 Version 1.10.0
1012 See the release notes here:
Show on old repository browser