From 1a51b71e37450078a43bb26eec5c11123f788224 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Fri, 3 Nov 2023 17:15:21 +0300 Subject: Popup+: let boolean variables be boolean --- plugins/Popup/src/avatars_gif.cpp | 4 +- plugins/Popup/src/avatars_simple.cpp | 4 +- plugins/Popup/src/common.h | 2 +- plugins/Popup/src/config.cpp | 13 ++-- plugins/Popup/src/config.h | 115 +++++++++++++++++------------- plugins/Popup/src/history.cpp | 8 +-- plugins/Popup/src/main.cpp | 4 +- plugins/Popup/src/opt_adv.cpp | 124 ++++++++++++++++----------------- plugins/Popup/src/opt_gen.cpp | 131 ++++++++++++++++++----------------- plugins/Popup/src/opt_skins.cpp | 66 +++++++++--------- plugins/Popup/src/popup_thread.cpp | 6 +- plugins/Popup/src/popup_wnd2.cpp | 50 ++++++------- plugins/Popup/src/services.cpp | 2 +- plugins/Popup/src/skin.cpp | 6 +- 14 files changed, 278 insertions(+), 257 deletions(-) (limited to 'plugins/Popup') diff --git a/plugins/Popup/src/avatars_gif.cpp b/plugins/Popup/src/avatars_gif.cpp index 29c4926606..5c4b296f3b 100644 --- a/plugins/Popup/src/avatars_gif.cpp +++ b/plugins/Popup/src/avatars_gif.cpp @@ -94,7 +94,7 @@ void GifAvatar::draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *op bf.AlphaFormat = AC_SRC_ALPHA; AlphaBlend(bmp->getDC(), x, y, w, h, hdcTmp, frameSize.cx*activeFrame, 0, frameSize.cx, frameSize.cy, bf); - if (options->avatarBorders && options->avatarPNGBorders) { + if (options->bAvatarBorders && options->bAvatarPNGBorders) { HBRUSH hbr = CreateSolidBrush(fonts.clAvatarBorder); bmp->saveAlpha(x, y, w, h); FrameRgn(bmp->getDC(), rgn, hbr, 1, 1); @@ -105,7 +105,7 @@ void GifAvatar::draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS *op else { bmp->saveAlpha(x, y, w, h); StretchBlt(bmp->getDC(), x, y, w, h, hdcTmp, frameSize.cx*activeFrame, 0, frameSize.cx, frameSize.cy, SRCCOPY); - if (options->avatarBorders) { + if (options->bAvatarBorders) { HBRUSH hbr = CreateSolidBrush(fonts.clAvatarBorder); FrameRgn(bmp->getDC(), rgn, hbr, 1, 1); DeleteObject(hbr); diff --git a/plugins/Popup/src/avatars_simple.cpp b/plugins/Popup/src/avatars_simple.cpp index b32c05dc35..1edc7263c4 100644 --- a/plugins/Popup/src/avatars_simple.cpp +++ b/plugins/Popup/src/avatars_simple.cpp @@ -100,7 +100,7 @@ void SimpleAvatar::draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS bf.AlphaFormat = AC_SRC_ALPHA; AlphaBlend(bmp->getDC(), x, y, w, h, hdcTmp, 0, 0, av->bmWidth, av->bmHeight, bf); - if (options->avatarBorders && options->avatarPNGBorders) { + if (options->bAvatarBorders && options->bAvatarPNGBorders) { HBRUSH hbr = CreateSolidBrush(fonts.clAvatarBorder); bmp->saveAlpha(x, y, w, h); FrameRgn(bmp->getDC(), rgn, hbr, 1, 1); @@ -111,7 +111,7 @@ void SimpleAvatar::draw(MyBitmap *bmp, int x, int y, int w, int h, POPUPOPTIONS else { bmp->saveAlpha(x, y, w, h); StretchBlt(bmp->getDC(), x, y, w, h, hdcTmp, 0, 0, av->bmWidth, av->bmHeight, SRCCOPY); - if (options->avatarBorders) { + if (options->bAvatarBorders) { HBRUSH hbr = CreateSolidBrush(fonts.clAvatarBorder); FrameRgn(bmp->getDC(), rgn, hbr, 1, 1); DeleteObject(hbr); diff --git a/plugins/Popup/src/common.h b/plugins/Popup/src/common.h index fbcfc88af7..8853abf951 100644 --- a/plugins/Popup/src/common.h +++ b/plugins/Popup/src/common.h @@ -41,7 +41,7 @@ inline void GetBmpSize(HBITMAP hbm, SIZE *sz) } inline void DebugMsg(LPTSTR msg){ - if (PopupOptions.debug){ + if (PopupOptions.bDebug){ MessageBox(nullptr, msg, L"debug", MB_OK); } } diff --git a/plugins/Popup/src/config.cpp b/plugins/Popup/src/config.cpp index 0f1a3ad934..6b95c4dd12 100644 --- a/plugins/Popup/src/config.cpp +++ b/plugins/Popup/src/config.cpp @@ -45,7 +45,7 @@ void LoadOptions() { memset(&PopupOptions, 0, sizeof(PopupOptions)); #if defined(_DEBUG) - PopupOptions.debug = g_plugin.getByte("debug", FALSE); + PopupOptions.bDebug = g_plugin.getByte("debug", FALSE); #endif // Load Popup Options @@ -78,7 +78,7 @@ void PopupPreview() ppd.szText.w = lptzText1Eng; ppd.lchIcon = Skin_LoadIcon(SKINICON_EVENT_MESSAGE); CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY); - if (PopupOptions.UseAnimations || PopupOptions.UseEffect) + if (PopupOptions.bUseAnimations || PopupOptions.bUseEffect) Sleep((ANIM_TIME * 2) / 3); // Pause memset(&ppd, 0, sizeof(ppd)); @@ -90,13 +90,16 @@ void PopupPreview() ppd.hbmAvatar = hbmNoAvatar; CallService(MS_POPUP_ADDPOPUP2, (WPARAM)&ppd, APF_NO_HISTORY); - if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME * 2) / 3); // Pause + if (PopupOptions.bUseAnimations || PopupOptions.bUseEffect) + Sleep((ANIM_TIME * 2) / 3); // Pause PUShowMessageW(TranslateT("This is a notification message"), (uint32_t)SM_NOTIFY | 0x80000000); - if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME * 2) / 3); // Pause + if (PopupOptions.bUseAnimations || PopupOptions.bUseEffect) + Sleep((ANIM_TIME * 2) / 3); // Pause PUShowMessageW(TranslateT("This is a warning message"), (uint32_t)SM_WARNING | 0x80000000); - if (PopupOptions.UseAnimations || PopupOptions.UseEffect) Sleep((ANIM_TIME * 2) / 3); // Pause + if (PopupOptions.bUseAnimations || PopupOptions.bUseEffect) + Sleep((ANIM_TIME * 2) / 3); // Pause PUShowMessageW(TranslateT("This is an error message"), (uint32_t)SM_ERROR | 0x80000000); } diff --git a/plugins/Popup/src/config.h b/plugins/Popup/src/config.h index a38ccb1bc0..9495a41bbc 100644 --- a/plugins/Popup/src/config.h +++ b/plugins/Popup/src/config.h @@ -24,73 +24,88 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #ifndef __config_h__ #define __config_h__ -typedef struct tagPOPUPOPTIONS { - //==Page General==== - //Timeout - uint8_t InfiniteDelay; - int Seconds; - uint8_t LeaveHovered; - //Size&Position - uint8_t DynamicResize; - uint8_t UseMinimumWidth; - uint16_t MinimumWidth; - uint8_t UseMaximumWidth; - uint16_t MaximumWidth; - int Position; - int Spreading; - //position Popup +struct POPUPOPTIONS +{ + // ==Page General==== + // Timeout + bool bInfiniteDelay; + int Seconds; + bool bLeaveHovered; + + // Size & Position + bool bDynamicResize; + bool bUseMinimumWidth; + int MinimumWidth; + bool bUseMaximumWidth; + int MaximumWidth; + int Position; + int Spreading; + + // position Popup int gapTop; int gapBottom; int gapLeft; int gapRight; int spacing; - //Miscellaneous - uint8_t ReorderPopups; - uint8_t ReorderPopupsWarning; - //Disable when - uint8_t DisableWhenFullscreen; - //others - uint8_t debug; + + // Miscellaneous + bool bReorderPopups; + bool bReorderPopupsWarning; + + // Disable when + bool bDisableWhenFullscreen; + + // others + uint8_t bDebug; + //==Page Skins==== LPTSTR SkinPack; - uint8_t DisplayTime; - uint8_t DropShadow; - uint8_t EnableFreeformShadows; - uint8_t EnableAeroGlass; - uint8_t UseWinColors; - uint8_t UseMText; + bool bDisplayTime; + bool bDropShadow; + bool bEnableFreeformShadows; + bool bEnableAeroGlass; + bool bUseWinColors; + bool bUseMText; + //==Page Actions==== uint32_t actions; - //Mouse Override + + // Mouse Override int overrideLeft; int overrideRight; int overrideMiddle; + //==Page Advanced==== - //History - uint8_t EnableHistory; - uint16_t HistorySize; - uint8_t UseHppHistoryLog; - //Avatars - uint8_t avatarBorders; - uint8_t avatarPNGBorders; - uint8_t avatarRadius; - uint16_t avatarSize; - uint8_t EnableAvatarUpdates; - //Monitor + // History + bool bEnableHistory; + int HistorySize; + bool bUseHppHistoryLog; + + // Avatars + bool bAvatarBorders; + bool bAvatarPNGBorders; + int avatarRadius; + int avatarSize; + bool bEnableAvatarUpdates; + + // Monitor uint8_t Monitor; - //Transparency - uint8_t UseTransparency; - uint8_t Alpha; - uint8_t OpaqueOnHover; - //Effect - uint8_t UseAnimations; - uint8_t UseEffect; + + // Transparency + bool bUseTransparency; + int Alpha; + bool bOpaqueOnHover; + + // Effect + bool bUseAnimations; + bool bUseEffect; LPTSTR Effect; uint32_t FadeIn; uint32_t FadeOut; - //Others - uint16_t MaxPopups; -} POPUPOPTIONS; + + // Others + int MaxPopups; +}; //===== User wnd class ===== struct GLOBAL_WND_CLASSES{ diff --git a/plugins/Popup/src/history.cpp b/plugins/Popup/src/history.cpp index d079bc1ac4..deb2592539 100644 --- a/plugins/Popup/src/history.cpp +++ b/plugins/Popup/src/history.cpp @@ -68,7 +68,7 @@ void PopupHistoryUnload() void PopupHistoryAdd(POPUPDATA2 *ppdNew) { - if (!PopupOptions.EnableHistory) + if (!PopupOptions.bEnableHistory) return; POPUPDATA2 *ppd = (POPUPDATA2*)mir_alloc(sizeof(POPUPDATA2)); @@ -97,7 +97,7 @@ void PopupHistoryAdd(POPUPDATA2 *ppdNew) void PopupHistoryShow() { - if (!PopupOptions.EnableHistory) { + if (!PopupOptions.bEnableHistory) { MessageBox(nullptr, TranslateT("Popup history is disabled"), TranslateT("Popup history message"), MB_OK); return; } @@ -134,7 +134,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara Window_SetIcon_IcoLib(hwnd, g_plugin.getIconHandle(IDI_HISTORY)); - if (gbHppInstalled && PopupOptions.UseHppHistoryLog) { + if (gbHppInstalled && PopupOptions.bUseHppHistoryLog) { logType = LOG_HPP; ShowWindow(GetDlgItem(hwnd, IDC_POPUP_LIST), SW_HIDE); @@ -229,7 +229,7 @@ static INT_PTR CALLBACK HistoryDlgProc(HWND hwnd, UINT msg, WPARAM, LPARAM lPara return FALSE; POPUPOPTIONS customOptions = PopupOptions; - customOptions.DynamicResize = FALSE; + customOptions.bDynamicResize = FALSE; customOptions.MinimumWidth = customOptions.MaximumWidth = rc.right - rc.left - 30; POPUPDATA2 *ppd = arPopupHistory[lpdis->itemID]; diff --git a/plugins/Popup/src/main.cpp b/plugins/Popup/src/main.cpp index a4be8a5395..dd43336ecb 100644 --- a/plugins/Popup/src/main.cpp +++ b/plugins/Popup/src/main.cpp @@ -307,9 +307,9 @@ static int OnShutdown(WPARAM, LPARAM) int CMPlugin::Load() { #if defined(_DEBUG) - PopupOptions.debug = g_plugin.getByte("debug", FALSE); + PopupOptions.bDebug = g_plugin.getByte("debug", FALSE); #else - PopupOptions.debug = false; + PopupOptions.bDebug = false; #endif LoadGDIPlus(); diff --git a/plugins/Popup/src/opt_adv.cpp b/plugins/Popup/src/opt_adv.cpp index 8ea71bd4b8..776fa2b6b2 100644 --- a/plugins/Popup/src/opt_adv.cpp +++ b/plugins/Popup/src/opt_adv.cpp @@ -46,28 +46,28 @@ void OptAdv_UnregisterVfx() void LoadOption_AdvOpts() { // History - PopupOptions.EnableHistory = g_plugin.getByte("EnableHistory", TRUE); + PopupOptions.bEnableHistory = g_plugin.getBool("EnableHistory", true); PopupOptions.HistorySize = g_plugin.getWord("HistorySize", SETTING_HISTORYSIZE_DEFAULT); - PopupOptions.UseHppHistoryLog = g_plugin.getByte("UseHppHistoryLog", TRUE); + PopupOptions.bUseHppHistoryLog = g_plugin.getBool("UseHppHistoryLog", true); // Avatars - PopupOptions.avatarBorders = g_plugin.getByte("AvatarBorders", TRUE); - PopupOptions.avatarPNGBorders = g_plugin.getByte("AvatarPNGBorders", FALSE); + PopupOptions.bAvatarBorders = g_plugin.getBool("AvatarBorders", true); + PopupOptions.bAvatarPNGBorders = g_plugin.getBool("AvatarPNGBorders", false); PopupOptions.avatarRadius = g_plugin.getByte("AvatarRadius", 2); PopupOptions.avatarSize = g_plugin.getWord("AvatarSize", SETTING_AVTSIZE_DEFAULT); - PopupOptions.EnableAvatarUpdates = g_plugin.getByte("EnableAvatarUpdates", FALSE); + PopupOptions.bEnableAvatarUpdates = g_plugin.getBool("EnableAvatarUpdates", false); // Monitor PopupOptions.Monitor = g_plugin.getByte("Monitor", SETTING_MONITOR_DEFAULT); // Transparency - PopupOptions.UseTransparency = g_plugin.getByte("UseTransparency", TRUE); + PopupOptions.bUseTransparency = g_plugin.getBool("UseTransparency", true); PopupOptions.Alpha = g_plugin.getByte("Alpha", SETTING_ALPHA_DEFAULT); - PopupOptions.OpaqueOnHover = g_plugin.getByte("OpaqueOnHover", TRUE); + PopupOptions.bOpaqueOnHover = g_plugin.getBool("OpaqueOnHover", true); // Effects - PopupOptions.UseAnimations = g_plugin.getByte("UseAnimations", TRUE); - PopupOptions.UseEffect = g_plugin.getByte("Fade", TRUE); + PopupOptions.bUseAnimations = g_plugin.getBool("UseAnimations", true); + PopupOptions.bUseEffect = g_plugin.getBool("Fade", true); PopupOptions.Effect = (LPTSTR)DBGetContactSettingStringX(0, MODULENAME, "Effect", "", DBVT_WCHAR); PopupOptions.FadeIn = g_plugin.getDword("FadeInTime", SETTING_FADEINTIME_DEFAULT); PopupOptions.FadeOut = g_plugin.getDword("FadeOutTime", SETTING_FADEOUTTIME_DEFAULT); @@ -103,30 +103,30 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM } // Group: History { - CheckDlgButton(hwnd, IDC_ENABLE_HISTORY, PopupOptions.EnableHistory ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_ENABLE_HISTORY, PopupOptions.bEnableHistory ? BST_CHECKED : BST_UNCHECKED); SetDlgItemInt(hwnd, IDC_HISTORYSIZE, PopupOptions.HistorySize, FALSE); SendDlgItemMessage(hwnd, IDC_HISTORYSIZE_SPIN, UDM_SETBUDDY, (WPARAM)GetDlgItem(hwnd, IDC_HISTORYSIZE), 0); SendDlgItemMessage(hwnd, IDC_HISTORYSIZE_SPIN, UDM_SETRANGE, 0, MAKELONG(SETTING_HISTORYSIZE_MAX, 1)); - CheckDlgButton(hwnd, IDC_HPPLOG, PopupOptions.UseHppHistoryLog ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_HPPLOG, PopupOptions.bUseHppHistoryLog ? BST_CHECKED : BST_UNCHECKED); HWND hCtrl = GetDlgItem(hwnd, IDC_SHOWHISTORY); SendMessage(hCtrl, BUTTONSETASFLATBTN, TRUE, 0); SendMessage(hCtrl, BUTTONADDTOOLTIP, (WPARAM)Translate("Popup history"), 0); SendMessage(hCtrl, BM_SETIMAGE, IMAGE_ICON, (LPARAM)g_plugin.getIcon(IDI_HISTORY)); - EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE_SPIN), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopupOptions.EnableHistory && gbHppInstalled); + EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE_SPIN), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopupOptions.bEnableHistory && gbHppInstalled); } // Group: Avatars { // Borders - CheckDlgButton(hwnd, IDC_AVT_BORDER, PopupOptions.avatarBorders ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwnd, IDC_AVT_PNGBORDER, PopupOptions.avatarPNGBorders ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopupOptions.avatarBorders); + CheckDlgButton(hwnd, IDC_AVT_BORDER, PopupOptions.bAvatarBorders ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_AVT_PNGBORDER, PopupOptions.bAvatarPNGBorders ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopupOptions.bAvatarBorders); // Radius SetDlgItemInt(hwnd, IDC_AVT_RADIUS, PopupOptions.avatarRadius, FALSE); SendDlgItemMessage(hwnd, IDC_AVT_RADIUS_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG((PopupOptions.avatarSize / 2), 0)); @@ -139,7 +139,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM max(PopupOptions.avatarSize, SETTING_AVTSIZE_MIN)); SetDlgItemInt(hwnd, IDC_AVT_SIZE, PopupOptions.avatarSize, FALSE); // Request avatars - CheckDlgButton(hwnd, IDC_AVT_REQUEST, PopupOptions.EnableAvatarUpdates ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_AVT_REQUEST, PopupOptions.bEnableAvatarUpdates ? BST_CHECKED : BST_UNCHECKED); } // Group: Monitor { @@ -157,28 +157,28 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM // Group: Transparency { // win2k+ - CheckDlgButton(hwnd, IDC_TRANS, PopupOptions.UseTransparency ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TRANS, PopupOptions.bUseTransparency ? BST_CHECKED : BST_UNCHECKED); SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETRANGE, FALSE, MAKELONG(1, 255)); SendDlgItemMessage(hwnd, IDC_TRANS_SLIDER, TBM_SETPOS, TRUE, PopupOptions.Alpha); mir_subclassWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), AlphaTrackBarWndProc); mir_snwprintf(tstr, L"%d%%", Byte2Percentile(PopupOptions.Alpha)); SetDlgItemText(hwnd, IDC_TRANS_PERCENT, tstr); - CheckDlgButton(hwnd, IDC_TRANS_OPAQUEONHOVER, PopupOptions.OpaqueOnHover ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_TRANS_OPAQUEONHOVER, PopupOptions.bOpaqueOnHover ? BST_CHECKED : BST_UNCHECKED); { BOOL how = TRUE; EnableWindow(GetDlgItem(hwnd, IDC_TRANS), how); - EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1), how && PopupOptions.UseTransparency); - EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), how && PopupOptions.UseTransparency); - EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT), how && PopupOptions.UseTransparency); - EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER), how && PopupOptions.UseTransparency); + EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1), how && PopupOptions.bUseTransparency); + EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), how && PopupOptions.bUseTransparency); + EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT), how && PopupOptions.bUseTransparency); + EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER), how && PopupOptions.bUseTransparency); } ShowWindow(GetDlgItem(hwnd, IDC_TRANS), SW_SHOW); } // Group: Effects { // Use Animations - CheckDlgButton(hwnd, IDC_USEANIMATIONS, PopupOptions.UseAnimations ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_USEANIMATIONS, PopupOptions.bUseAnimations ? BST_CHECKED : BST_UNCHECKED); // Fade SetDlgItemInt(hwnd, IDC_FADEIN, PopupOptions.FadeIn, FALSE); SetDlgItemInt(hwnd, IDC_FADEOUT, PopupOptions.FadeOut, FALSE); @@ -188,7 +188,7 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwnd, IDC_FADEOUT_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_FADEOUTTIME_MAX, SETTING_FADEOUTTIME_MIN)); SendDlgItemMessage(hwnd, IDC_FADEOUT_SPIN, UDM_SETACCEL, (WPARAM)_countof(aAccels), (LPARAM)&aAccels); - BOOL how = PopupOptions.UseAnimations || PopupOptions.UseEffect; + BOOL how = PopupOptions.bUseAnimations || PopupOptions.bUseEffect; EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), how); EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), how); EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), how); @@ -206,11 +206,11 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM HWND hCtrl = GetDlgItem(hwnd, IDC_EFFECT); ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("No effect")), -2); ComboBox_SetItemData(hCtrl, ComboBox_AddString(hCtrl, TranslateT("Fade in/out")), -1); - uint32_t dwActiveItem = (uint32_t)PopupOptions.UseEffect; + uint32_t dwActiveItem = (uint32_t)PopupOptions.bUseEffect; for (int i = 0; i < g_lstPopupVfx.getCount(); ++i) { uint32_t dwItem = ComboBox_AddString(hCtrl, TranslateW(g_lstPopupVfx[i])); ComboBox_SetItemData(hCtrl, dwItem, i); - if (PopupOptions.UseEffect && !mir_wstrcmp(g_lstPopupVfx[i], PopupOptions.Effect)) + if (PopupOptions.bUseEffect && !mir_wstrcmp(g_lstPopupVfx[i], PopupOptions.Effect)) dwActiveItem = dwItem; } SendDlgItemMessage(hwnd, IDC_EFFECT, CB_SETCURSEL, dwActiveItem, 0); @@ -249,13 +249,13 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case BN_CLICKED: // Button controls switch (idCtrl) { case IDC_ENABLE_HISTORY: - PopupOptions.EnableHistory = !PopupOptions.EnableHistory; - EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE_SPIN), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopupOptions.EnableHistory); - EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopupOptions.EnableHistory && gbHppInstalled); + PopupOptions.bEnableHistory = !PopupOptions.bEnableHistory; + EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC1), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_HISTORYSIZE_SPIN), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_HISTORY_STATIC2), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_SHOWHISTORY), PopupOptions.bEnableHistory); + EnableWindow(GetDlgItem(hwnd, IDC_HPPLOG), PopupOptions.bEnableHistory && gbHppInstalled); SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; @@ -264,23 +264,23 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case IDC_HPPLOG: - PopupOptions.UseHppHistoryLog = !PopupOptions.UseHppHistoryLog; + PopupOptions.bUseHppHistoryLog = !PopupOptions.bUseHppHistoryLog; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case IDC_AVT_BORDER: - PopupOptions.avatarBorders = !PopupOptions.avatarBorders; - EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopupOptions.avatarBorders); + PopupOptions.bAvatarBorders = !PopupOptions.bAvatarBorders; + EnableWindow(GetDlgItem(hwnd, IDC_AVT_PNGBORDER), PopupOptions.bAvatarBorders); SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case IDC_AVT_PNGBORDER: - PopupOptions.avatarPNGBorders = !PopupOptions.avatarPNGBorders; + PopupOptions.bAvatarPNGBorders = !PopupOptions.bAvatarPNGBorders; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case IDC_AVT_REQUEST: - PopupOptions.EnableAvatarUpdates = !PopupOptions.EnableAvatarUpdates; + PopupOptions.bEnableAvatarUpdates = !PopupOptions.bEnableAvatarUpdates; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; @@ -295,26 +295,26 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case IDC_TRANS: - PopupOptions.UseTransparency = !PopupOptions.UseTransparency; + PopupOptions.bUseTransparency = !PopupOptions.bUseTransparency; { BOOL how = TRUE; - EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1), how && PopupOptions.UseTransparency); - EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), how && PopupOptions.UseTransparency); - EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT), how && PopupOptions.UseTransparency); - EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER), how && PopupOptions.UseTransparency); + EnableWindow(GetDlgItem(hwnd, IDC_TRANS_TXT1), how && PopupOptions.bUseTransparency); + EnableWindow(GetDlgItem(hwnd, IDC_TRANS_SLIDER), how && PopupOptions.bUseTransparency); + EnableWindow(GetDlgItem(hwnd, IDC_TRANS_PERCENT), how && PopupOptions.bUseTransparency); + EnableWindow(GetDlgItem(hwnd, IDC_TRANS_OPAQUEONHOVER), how && PopupOptions.bUseTransparency); SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); } break; case IDC_TRANS_OPAQUEONHOVER: - PopupOptions.OpaqueOnHover = !PopupOptions.OpaqueOnHover; + PopupOptions.bOpaqueOnHover = !PopupOptions.bOpaqueOnHover; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case IDC_USEANIMATIONS: - PopupOptions.UseAnimations = !PopupOptions.UseAnimations; + PopupOptions.bUseAnimations = !PopupOptions.bUseAnimations; { - BOOL enable = PopupOptions.UseAnimations || PopupOptions.UseEffect; + BOOL enable = PopupOptions.bUseAnimations || PopupOptions.bUseEffect; EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable); EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), enable); EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), enable); @@ -339,11 +339,11 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case IDC_EFFECT: { int iEffect = ComboBox_GetItemData((HWND)lParam, ComboBox_GetCurSel((HWND)lParam)); - PopupOptions.UseEffect = (iEffect != -2) ? TRUE : FALSE; + PopupOptions.bUseEffect = (iEffect != -2); mir_free(PopupOptions.Effect); PopupOptions.Effect = mir_wstrdup((iEffect >= 0) ? g_lstPopupVfx[iEffect] : L""); - BOOL enable = PopupOptions.UseAnimations || PopupOptions.UseEffect; + BOOL enable = PopupOptions.bUseAnimations || PopupOptions.bUseEffect; EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_TXT1), enable); EnableWindow(GetDlgItem(hwnd, IDC_FADEIN), enable); EnableWindow(GetDlgItem(hwnd, IDC_FADEIN_SPIN), enable); @@ -492,26 +492,26 @@ INT_PTR CALLBACK DlgProcPopupAdvOpts(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case PSN_APPLY: // History - g_plugin.setByte("EnableHistory", (uint8_t)PopupOptions.EnableHistory); + g_plugin.setByte("EnableHistory", (uint8_t)PopupOptions.bEnableHistory); g_plugin.setWord("HistorySize", PopupOptions.HistorySize); PopupHistoryResize(); - g_plugin.setByte("UseHppHistoryLog", PopupOptions.UseHppHistoryLog); + g_plugin.setByte("UseHppHistoryLog", PopupOptions.bUseHppHistoryLog); // Avatars - g_plugin.setByte("AvatarBorders", PopupOptions.avatarBorders); - g_plugin.setByte("AvatarPNGBorders", PopupOptions.avatarPNGBorders); + g_plugin.setByte("AvatarBorders", PopupOptions.bAvatarBorders); + g_plugin.setByte("AvatarPNGBorders", PopupOptions.bAvatarPNGBorders); g_plugin.setByte("AvatarRadius", PopupOptions.avatarRadius); g_plugin.setWord("AvatarSize", PopupOptions.avatarSize); - g_plugin.setByte("EnableAvatarUpdates", PopupOptions.EnableAvatarUpdates); + g_plugin.setByte("EnableAvatarUpdates", PopupOptions.bEnableAvatarUpdates); // Monitor g_plugin.setByte("Monitor", PopupOptions.Monitor); // Transparency - g_plugin.setByte("UseTransparency", PopupOptions.UseTransparency); + g_plugin.setByte("UseTransparency", PopupOptions.bUseTransparency); g_plugin.setByte("Alpha", PopupOptions.Alpha); - g_plugin.setByte("OpaqueOnHover", PopupOptions.OpaqueOnHover); + g_plugin.setByte("OpaqueOnHover", PopupOptions.bOpaqueOnHover); // Effects - g_plugin.setByte("UseAnimations", PopupOptions.UseAnimations); - g_plugin.setByte("Fade", PopupOptions.UseEffect); + g_plugin.setByte("UseAnimations", PopupOptions.bUseAnimations); + g_plugin.setByte("Fade", PopupOptions.bUseEffect); g_plugin.setWString("Effect", PopupOptions.Effect); g_plugin.setDword("FadeInTime", PopupOptions.FadeIn); g_plugin.setDword("FadeOutTime", PopupOptions.FadeOut); diff --git a/plugins/Popup/src/opt_gen.cpp b/plugins/Popup/src/opt_gen.cpp index ca491e23af..2aa7de96d2 100644 --- a/plugins/Popup/src/opt_gen.cpp +++ b/plugins/Popup/src/opt_gen.cpp @@ -83,16 +83,16 @@ int AddStatusModes(OPTTREE_OPTION *options, int pos, LPTSTR prefix, uint32_t fla void LoadOption_General() { // Seconds - PopupOptions.InfiniteDelay = g_plugin.getByte("InfiniteDelay", FALSE); + PopupOptions.bInfiniteDelay = g_plugin.getByte("InfiniteDelay", FALSE); PopupOptions.Seconds = DBGetContactSettingRangedWord(0, MODULENAME, "Seconds", SETTING_LIFETIME_DEFAULT, SETTING_LIFETIME_MIN, SETTING_LIFETIME_MAX); - PopupOptions.LeaveHovered = g_plugin.getByte("LeaveHovered", TRUE); + PopupOptions.bLeaveHovered = g_plugin.getByte("LeaveHovered", TRUE); // Dynamic Resize - PopupOptions.DynamicResize = g_plugin.getByte("DynamicResize", FALSE); - PopupOptions.UseMinimumWidth = g_plugin.getByte("UseMinimumWidth", TRUE); + PopupOptions.bDynamicResize = g_plugin.getByte("DynamicResize", FALSE); + PopupOptions.bUseMinimumWidth = g_plugin.getByte("UseMinimumWidth", TRUE); PopupOptions.MinimumWidth = g_plugin.getWord("MinimumWidth", 160); - PopupOptions.UseMaximumWidth = g_plugin.getByte("UseMaximumWidth", TRUE); + PopupOptions.bUseMaximumWidth = g_plugin.getByte("UseMaximumWidth", TRUE); PopupOptions.MaximumWidth = g_plugin.getWord("MaximumWidth", 300); // Position @@ -111,11 +111,11 @@ void LoadOption_General() DBGetContactSettingRangedByte(0, MODULENAME, "Spreading", SPREADING_VERTICAL, SPREADING_MINVALUE, SPREADING_MAXVALUE); // miscellaneous - PopupOptions.ReorderPopups = g_plugin.getByte("ReorderPopups", TRUE); - PopupOptions.ReorderPopupsWarning = g_plugin.getByte("ReorderPopupsWarning", TRUE); + PopupOptions.bReorderPopups = g_plugin.getByte("ReorderPopups", TRUE); + PopupOptions.bReorderPopupsWarning = g_plugin.getByte("ReorderPopupsWarning", TRUE); // disable When - PopupOptions.DisableWhenFullscreen = g_plugin.getByte("DisableWhenFullscreen", TRUE); + PopupOptions.bDisableWhenFullscreen = g_plugin.getByte("DisableWhenFullscreen", TRUE); } INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam) @@ -133,33 +133,33 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM switch (msg) { case WM_INITDIALOG: // Seconds of delay - CheckDlgButton(hwnd, IDC_INFINITEDELAY, PopupOptions.InfiniteDelay ? BST_CHECKED : BST_UNCHECKED); - CheckDlgButton(hwnd, IDC_LEAVEHOVERED, PopupOptions.LeaveHovered ? BST_CHECKED : BST_UNCHECKED); - EnableWindow(GetDlgItem(hwnd, IDC_SECONDS), !PopupOptions.InfiniteDelay); - EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC1), !PopupOptions.InfiniteDelay); - EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC2), !PopupOptions.InfiniteDelay); - EnableWindow(GetDlgItem(hwnd, IDC_LEAVEHOVERED), !PopupOptions.InfiniteDelay); + CheckDlgButton(hwnd, IDC_INFINITEDELAY, PopupOptions.bInfiniteDelay ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_LEAVEHOVERED, PopupOptions.bLeaveHovered ? BST_CHECKED : BST_UNCHECKED); + EnableWindow(GetDlgItem(hwnd, IDC_SECONDS), !PopupOptions.bInfiniteDelay); + EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC1), !PopupOptions.bInfiniteDelay); + EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC2), !PopupOptions.bInfiniteDelay); + EnableWindow(GetDlgItem(hwnd, IDC_LEAVEHOVERED), !PopupOptions.bInfiniteDelay); SetDlgItemInt(hwnd, IDC_SECONDS, PopupOptions.Seconds, FALSE); SendDlgItemMessage(hwnd, IDC_SECONDS_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_LIFETIME_MAX, SETTING_LIFETIME_MIN)); // Dynamic Resize - CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopupOptions.DynamicResize ? BST_CHECKED : BST_UNCHECKED); - SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? LPGENW("Maximum width") : LPGENW("Width")); + CheckDlgButton(hwnd, IDC_DYNAMICRESIZE, PopupOptions.bDynamicResize ? BST_CHECKED : BST_UNCHECKED); + SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.bDynamicResize ? LPGENW("Maximum width") : LPGENW("Width")); // Minimum Width - CheckDlgButton(hwnd, IDC_USEMINIMUMWIDTH, PopupOptions.UseMinimumWidth ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_USEMINIMUMWIDTH, PopupOptions.bUseMinimumWidth ? BST_CHECKED : BST_UNCHECKED); SendDlgItemMessage(hwnd, IDC_MINIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN)); SetDlgItemInt(hwnd, IDC_MINIMUMWIDTH, PopupOptions.MinimumWidth, FALSE); // Maximum Width - PopupOptions.UseMaximumWidth = PopupOptions.DynamicResize ? PopupOptions.UseMaximumWidth : TRUE; - CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.UseMaximumWidth ? BST_CHECKED : BST_UNCHECKED); + PopupOptions.bUseMaximumWidth = PopupOptions.bDynamicResize ? PopupOptions.bUseMaximumWidth : TRUE; + CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.bUseMaximumWidth ? BST_CHECKED : BST_UNCHECKED); SendDlgItemMessage(hwnd, IDC_MAXIMUMWIDTH_SPIN, UDM_SETRANGE, 0, (LPARAM)MAKELONG(SETTING_MAXIMUMWIDTH_MAX, SETTING_MINIMUMWIDTH_MIN)); SetDlgItemInt(hwnd, IDC_MAXIMUMWIDTH, PopupOptions.MaximumWidth, FALSE); // And finally let's enable/disable them. - EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.DynamicResize); - EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth); - EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth); - EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopupOptions.UseMaximumWidth); - EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.UseMaximumWidth); + EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.bDynamicResize); + EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.bDynamicResize && PopupOptions.bUseMinimumWidth); + EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.bDynamicResize && PopupOptions.bUseMinimumWidth); + EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopupOptions.bUseMaximumWidth); + EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.bUseMaximumWidth); // Position combobox. { @@ -185,13 +185,13 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM SendDlgItemMessage(hwnd, IDC_LAYOUT, CB_SETCURSEL, PopupOptions.Spreading, 0); } // miscellaneous - CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.ReorderPopups ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.bReorderPopups ? BST_CHECKED : BST_UNCHECKED); // Popup enabled { bool bEnabled = Popup_Enabled(); CheckDlgButton(hwnd, IDC_POPUPENABLED, bEnabled ? BST_UNCHECKED : BST_CHECKED); - CheckDlgButton(hwnd, IDC_DISABLEINFS, PopupOptions.DisableWhenFullscreen ? BST_CHECKED : BST_UNCHECKED); + CheckDlgButton(hwnd, IDC_DISABLEINFS, PopupOptions.bDisableWhenFullscreen ? BST_CHECKED : BST_UNCHECKED); EnableWindow(GetDlgItem(hwnd, IDC_DISABLEINFS), bEnabled); EnableWindow(GetDlgItem(hwnd, IDC_STATUSES), bEnabled); } @@ -254,27 +254,27 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case BN_CLICKED: // Button controls switch (LOWORD(wParam)) { case IDC_INFINITEDELAY: - PopupOptions.InfiniteDelay = !PopupOptions.InfiniteDelay; - EnableWindow(GetDlgItem(hwnd, IDC_SECONDS), !PopupOptions.InfiniteDelay); - EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC1), !PopupOptions.InfiniteDelay); - EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC2), !PopupOptions.InfiniteDelay); - EnableWindow(GetDlgItem(hwnd, IDC_LEAVEHOVERED), !PopupOptions.InfiniteDelay); + PopupOptions.bInfiniteDelay = !PopupOptions.bInfiniteDelay; + EnableWindow(GetDlgItem(hwnd, IDC_SECONDS), !PopupOptions.bInfiniteDelay); + EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC1), !PopupOptions.bInfiniteDelay); + EnableWindow(GetDlgItem(hwnd, IDC_SECONDS_STATIC2), !PopupOptions.bInfiniteDelay); + EnableWindow(GetDlgItem(hwnd, IDC_LEAVEHOVERED), !PopupOptions.bInfiniteDelay); SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case IDC_LEAVEHOVERED: - PopupOptions.LeaveHovered = !PopupOptions.LeaveHovered; + PopupOptions.bLeaveHovered = !PopupOptions.bLeaveHovered; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case IDC_DYNAMICRESIZE: - PopupOptions.DynamicResize = !PopupOptions.DynamicResize; - EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.DynamicResize); - EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth); - EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.DynamicResize && PopupOptions.UseMinimumWidth); - SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.DynamicResize ? TranslateT("Maximum width") : TranslateT("Width")); - if (!PopupOptions.DynamicResize) { - PopupOptions.UseMaximumWidth = TRUE; + PopupOptions.bDynamicResize = !PopupOptions.bDynamicResize; + EnableWindow(GetDlgItem(hwnd, IDC_USEMINIMUMWIDTH), PopupOptions.bDynamicResize); + EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.bDynamicResize && PopupOptions.bUseMinimumWidth); + EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.bDynamicResize && PopupOptions.bUseMinimumWidth); + SetDlgItemText(hwnd, IDC_USEMAXIMUMWIDTH, PopupOptions.bDynamicResize ? TranslateT("Maximum width") : TranslateT("Width")); + if (!PopupOptions.bDynamicResize) { + PopupOptions.bUseMaximumWidth = TRUE; CheckDlgButton(hwnd, IDC_USEMAXIMUMWIDTH, BST_CHECKED); EnableWindow(GetDlgItem(hwnd, IDC_USEMAXIMUMWIDTH), TRUE); EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), TRUE); @@ -284,20 +284,20 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case IDC_USEMINIMUMWIDTH: - PopupOptions.UseMinimumWidth = !PopupOptions.UseMinimumWidth; - EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.UseMinimumWidth); - EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.UseMinimumWidth); + PopupOptions.bUseMinimumWidth = !PopupOptions.bUseMinimumWidth; + EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH), PopupOptions.bUseMinimumWidth); + EnableWindow(GetDlgItem(hwnd, IDC_MINIMUMWIDTH_SPIN), PopupOptions.bUseMinimumWidth); SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; case IDC_USEMAXIMUMWIDTH: - PopupOptions.UseMaximumWidth = Button_GetCheck((HWND)lParam); - if (!PopupOptions.DynamicResize) { // ugly - set always on if DynamicResize = off + PopupOptions.bUseMaximumWidth = Button_GetCheck((HWND)lParam); + if (!PopupOptions.bDynamicResize) { // ugly - set always on if bDynamicResize = off CheckDlgButton(hwnd, LOWORD(wParam), BST_CHECKED); - PopupOptions.UseMaximumWidth = TRUE; + PopupOptions.bUseMaximumWidth = TRUE; } - EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopupOptions.UseMaximumWidth); - EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.UseMaximumWidth); + EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH), PopupOptions.bUseMaximumWidth); + EnableWindow(GetDlgItem(hwnd, IDC_MAXIMUMWIDTH_SPIN), PopupOptions.bUseMaximumWidth); SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; @@ -330,8 +330,8 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case IDC_REORDERPOPUPS: - PopupOptions.ReorderPopups = !PopupOptions.ReorderPopups; - PopupOptions.ReorderPopupsWarning = PopupOptions.ReorderPopups ? g_plugin.getByte("ReorderPopupsWarning", TRUE) : TRUE; + PopupOptions.bReorderPopups = !PopupOptions.bReorderPopups; + PopupOptions.bReorderPopupsWarning = PopupOptions.bReorderPopups ? g_plugin.getByte("ReorderPopupsWarning", TRUE) : TRUE; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; @@ -348,7 +348,7 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM break; case IDC_DISABLEINFS: - PopupOptions.DisableWhenFullscreen = !PopupOptions.DisableWhenFullscreen; + PopupOptions.bDisableWhenFullscreen = !PopupOptions.bDisableWhenFullscreen; SendMessage(GetParent(hwnd), PSM_CHANGED, 0, 0); break; @@ -483,15 +483,15 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM case PSN_APPLY: // Seconds - g_plugin.setByte("InfiniteDelay", PopupOptions.InfiniteDelay); + g_plugin.setByte("InfiniteDelay", PopupOptions.bInfiniteDelay); g_plugin.setWord("Seconds", (uint16_t)PopupOptions.Seconds); - g_plugin.setByte("LeaveHovered", PopupOptions.LeaveHovered); + g_plugin.setByte("LeaveHovered", PopupOptions.bLeaveHovered); // Dynamic Resize - g_plugin.setByte("DynamicResize", PopupOptions.DynamicResize); - g_plugin.setByte("UseMinimumWidth", PopupOptions.UseMinimumWidth); + g_plugin.setByte("DynamicResize", PopupOptions.bDynamicResize); + g_plugin.setByte("UseMinimumWidth", PopupOptions.bUseMinimumWidth); g_plugin.setWord("MinimumWidth", PopupOptions.MinimumWidth); - g_plugin.setByte("UseMaximumWidth", PopupOptions.UseMaximumWidth); + g_plugin.setByte("UseMaximumWidth", PopupOptions.bUseMaximumWidth); g_plugin.setWord("MaximumWidth", PopupOptions.MaximumWidth); // Position @@ -508,10 +508,10 @@ INT_PTR CALLBACK DlgProcPopupGeneral(HWND hwnd, UINT msg, WPARAM wParam, LPARAM g_plugin.setByte("Spreading", (uint8_t)PopupOptions.Spreading); // miscellaneous - Check_ReorderPopups(hwnd); // this save also PopupOptions.ReorderPopups + Check_ReorderPopups(hwnd); // this save also PopupOptions.bReorderPopups // disable When - g_plugin.setByte("DisableWhenFullscreen", PopupOptions.DisableWhenFullscreen); + g_plugin.setByte("DisableWhenFullscreen", PopupOptions.bDisableWhenFullscreen); // new status options for (auto &pa : Accounts()) @@ -577,28 +577,29 @@ void ErrorMSG(int minValue, int maxValue) void Check_ReorderPopups(HWND hwnd) { - if (!PopupOptions.ReorderPopups && PopupOptions.ReorderPopupsWarning) { + if (!PopupOptions.bReorderPopups && PopupOptions.bReorderPopupsWarning) { int res = MessageBox(hwnd, TranslateT("'Reorder popups' option is currently disabled.\r\nThis may cause misaligned popups when used with\r\navatars and text replacement (mainly NewXstatusNotify).\r\n\r\nDo you want to enable popup reordering now?\r\n"), TranslateT("Popup plus warning"), MB_ICONEXCLAMATION | MB_YESNOCANCEL); switch (res) { case IDYES: - PopupOptions.ReorderPopups = TRUE; + PopupOptions.bReorderPopups = TRUE; // Reset warning for next option change !!! - PopupOptions.ReorderPopupsWarning = TRUE; + PopupOptions.bReorderPopupsWarning = TRUE; break; case IDNO: - PopupOptions.ReorderPopups = FALSE; - PopupOptions.ReorderPopupsWarning = FALSE; + PopupOptions.bReorderPopups = FALSE; + PopupOptions.bReorderPopupsWarning = FALSE; break; default: return; } } - g_plugin.setByte("ReorderPopups", PopupOptions.ReorderPopups); - g_plugin.setByte("ReorderPopupsWarning", PopupOptions.ReorderPopupsWarning); - if (hwnd) CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.ReorderPopups ? BST_CHECKED : BST_UNCHECKED); + g_plugin.setByte("ReorderPopups", PopupOptions.bReorderPopups); + g_plugin.setByte("ReorderPopupsWarning", PopupOptions.bReorderPopupsWarning); + if (hwnd) + CheckDlgButton(hwnd, IDC_REORDERPOPUPS, PopupOptions.bReorderPopups ? BST_CHECKED : BST_UNCHECKED); } INT_PTR CALLBACK PositionBoxDlgProc(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM) diff --git a/plugins/Popup/src/opt_skins.cpp b/plugins/Popup/src/opt_skins.cpp index 6d75d9e863..40cd94de39 100644 --- a/plugins/Popup/src/opt_skins.cpp +++ b/plugins/Popup/src/opt_skins.cpp @@ -67,7 +67,7 @@ static void updatePreviewImage(HWND hwndBox) ppd.szText.w = TranslateT("Just take a look at this skin... ;)"); POPUPOPTIONS customOptions = PopupOptions; - customOptions.DynamicResize = FALSE; + customOptions.bDynamicResize = FALSE; customOptions.MinimumWidth = customOptions.MaximumWidth = 250; if (wndPreview) delete wndPreview; @@ -201,30 +201,30 @@ int SkinOptionList_AddMain(OPTTREE_OPTION* &options, int *OptionsCount, int pos, BOOL bCheck = 0; switch (i) { case 0: - *dwGlobalOptions |= PopupOptions.DisplayTime ? (1 << i) : 0; - bCheck = PopupOptions.DisplayTime; + *dwGlobalOptions |= PopupOptions.bDisplayTime ? (1 << i) : 0; + bCheck = PopupOptions.bDisplayTime; break; case 1: - *dwGlobalOptions |= PopupOptions.DropShadow ? (1 << i) : 0; - bCheck = PopupOptions.DropShadow; + *dwGlobalOptions |= PopupOptions.bDropShadow ? (1 << i) : 0; + bCheck = PopupOptions.bDropShadow; break; case 2: - *dwGlobalOptions |= PopupOptions.EnableFreeformShadows ? (1 << i) : 0; - bCheck = PopupOptions.EnableFreeformShadows; + *dwGlobalOptions |= PopupOptions.bEnableFreeformShadows ? (1 << i) : 0; + bCheck = PopupOptions.bEnableFreeformShadows; break; case 3: if (!MyDwmEnableBlurBehindWindow) continue; - *dwGlobalOptions |= PopupOptions.EnableAeroGlass ? (1 << i) : 0; - bCheck = PopupOptions.EnableAeroGlass; + *dwGlobalOptions |= PopupOptions.bEnableAeroGlass ? (1 << i) : 0; + bCheck = PopupOptions.bEnableAeroGlass; break; case 4: - *dwGlobalOptions |= PopupOptions.UseWinColors ? (1 << i) : 0; - bCheck = PopupOptions.UseWinColors; + *dwGlobalOptions |= PopupOptions.bUseWinColors ? (1 << i) : 0; + bCheck = PopupOptions.bUseWinColors; break; case 5: if (!(htuText&&htuTitle)) continue; - *dwGlobalOptions |= PopupOptions.UseMText ? (1 << i) : 0; - bCheck = PopupOptions.UseMText; + *dwGlobalOptions |= PopupOptions.bUseMText ? (1 << i) : 0; + bCheck = PopupOptions.bUseMText; break; } *OptionsCount += 1; @@ -278,16 +278,18 @@ bool SkinOptionList_Update(OPTTREE_OPTION* &options, int *OptionsCount, HWND hwn return true; } -void LoadOption_Skins() { +void LoadOption_Skins() +{ // skin pack PopupOptions.SkinPack = (LPTSTR)DBGetContactSettingStringX(0, MODULENAME, "SkinPack", "* Popup Classic", DBVT_WCHAR); + // more Skin options - PopupOptions.DisplayTime = g_plugin.getByte("DisplayTime", TRUE); - PopupOptions.DropShadow = g_plugin.getByte("DropShadow", TRUE); - PopupOptions.EnableFreeformShadows = g_plugin.getByte("EnableShadowRegion", 1); - PopupOptions.EnableAeroGlass = g_plugin.getByte("EnableAeroGlass", 1); - PopupOptions.UseWinColors = g_plugin.getByte("UseWinColors", FALSE); - PopupOptions.UseMText = g_plugin.getByte("UseMText", TRUE); + PopupOptions.bDisplayTime = g_plugin.getBool("DisplayTime", true); + PopupOptions.bDropShadow = g_plugin.getBool("DropShadow", true); + PopupOptions.bEnableFreeformShadows = g_plugin.getBool("EnableShadowRegion", true); + PopupOptions.bEnableAeroGlass = g_plugin.getBool("EnableAeroGlass", true); + PopupOptions.bUseWinColors = g_plugin.getBool("UseWinColors", true); + PopupOptions.bUseMText = g_plugin.getBool("UseMText", true); } INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -310,22 +312,22 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR else if (mir_wstrcmp(skinOptions[index].pszSettingName, L"Global settings") == 0) { switch (skinOptions[index].dwFlag) { case (1 << 0) : - PopupOptions.DisplayTime = skinOptions[index].bState; + PopupOptions.bDisplayTime = skinOptions[index].bState; break; case (1 << 1) : - PopupOptions.DropShadow = skinOptions[index].bState; + PopupOptions.bDropShadow = skinOptions[index].bState; break; case (1 << 2) : - PopupOptions.EnableFreeformShadows = skinOptions[index].bState; + PopupOptions.bEnableFreeformShadows = skinOptions[index].bState; break; case (1 << 3) : - PopupOptions.EnableAeroGlass = skinOptions[index].bState; + PopupOptions.bEnableAeroGlass = skinOptions[index].bState; break; case (1 << 4) : - PopupOptions.UseWinColors = skinOptions[index].bState; + PopupOptions.bUseWinColors = skinOptions[index].bState; break; case (1 << 5) : - PopupOptions.UseMText = skinOptions[index].bState; + PopupOptions.bUseMText = skinOptions[index].bState; break; } } @@ -471,12 +473,12 @@ INT_PTR CALLBACK DlgProcPopSkinsOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPAR skin->saveOpts(); skins.freeAllButActive(); // more Skin options - g_plugin.setByte("DisplayTime", PopupOptions.DisplayTime); - g_plugin.setByte("DropShadow", PopupOptions.DropShadow); - g_plugin.setByte("EnableShadowRegion", PopupOptions.EnableFreeformShadows); - g_plugin.setByte("EnableAeroGlass", PopupOptions.EnableAeroGlass); - g_plugin.setByte("UseWinColors", PopupOptions.UseWinColors); - g_plugin.setByte("UseMText", PopupOptions.UseMText); + g_plugin.setByte("DisplayTime", PopupOptions.bDisplayTime); + g_plugin.setByte("DropShadow", PopupOptions.bDropShadow); + g_plugin.setByte("EnableShadowRegion", PopupOptions.bEnableFreeformShadows); + g_plugin.setByte("EnableAeroGlass", PopupOptions.bEnableAeroGlass); + g_plugin.setByte("UseWinColors", PopupOptions.bUseWinColors); + g_plugin.setByte("UseMText", PopupOptions.bUseMText); }// end PSN_APPLY: return TRUE; }// switch (((LPNMHDR)lParam)->code) diff --git a/plugins/Popup/src/popup_thread.cpp b/plugins/Popup/src/popup_thread.cpp index 01eab8dbeb..04eb8968bb 100644 --- a/plugins/Popup/src/popup_thread.cpp +++ b/plugins/Popup/src/popup_thread.cpp @@ -53,7 +53,7 @@ enum bool UpdatePopupPosition(PopupWnd2 *prev, PopupWnd2 *wnd) { if (!wnd) return false; - if (!PopupOptions.ReorderPopups && wnd->isPositioned()) return false; + if (!PopupOptions.bReorderPopups && wnd->isPositioned()) return false; int POPUP_SPACING = PopupOptions.spacing; @@ -134,7 +134,7 @@ bool UpdatePopupPosition(PopupWnd2 *prev, PopupWnd2 *wnd) void RepositionPopups() { PopupWnd2 *prev = nullptr; - if (PopupOptions.ReorderPopups) { + if (PopupOptions.bReorderPopups) { for (auto &it : popupList) { UpdatePopupPosition(prev, it); prev = it; @@ -172,7 +172,7 @@ static LRESULT CALLBACK PopupThreadManagerWndProc(HWND hwnd, UINT message, WPARA break; case UTM_REQUEST_REMOVE: - if ((PopupOptions.LeaveHovered && gLockCount) || (wnd && wnd->isLocked())) + if ((PopupOptions.bLeaveHovered && gLockCount) || (wnd && wnd->isLocked())) wnd->updateTimer(); else PostMessage(wnd->getHwnd(), WM_CLOSE, 0, 0); diff --git a/plugins/Popup/src/popup_wnd2.cpp b/plugins/Popup/src/popup_wnd2.cpp index 57f77f0121..bcf59cf35f 100644 --- a/plugins/Popup/src/popup_wnd2.cpp +++ b/plugins/Popup/src/popup_wnd2.cpp @@ -161,9 +161,9 @@ void PopupWnd2::create() // Shadows ULONG_PTR style = GetClassLongPtr(m_hwnd, GCL_STYLE); - if (m_options->DropShadow && !(style & CS_DROPSHADOW)) + if (m_options->bDropShadow && !(style & CS_DROPSHADOW)) style |= CS_DROPSHADOW; - else if (!m_options->DropShadow && (style & CS_DROPSHADOW)) + else if (!m_options->bDropShadow && (style & CS_DROPSHADOW)) style &= ~CS_DROPSHADOW; SetClassLongPtr(m_hwnd, GCL_STYLE, style); @@ -209,7 +209,7 @@ SIZE PopupWnd2::measure() return m_sz; MyBitmap bmpTmp(1, 1); - skin->measure(bmpTmp.getDC(), this, m_options->UseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options); + skin->measure(bmpTmp.getDC(), this, m_options->bUseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options); return m_sz; } @@ -231,7 +231,7 @@ void PopupWnd2::update() if (m_bmpBase) delete m_bmpBase; if (m_bmpAnimate) delete m_bmpAnimate; m_bmpBase = new MyBitmap(1, 1); - skin->measure(m_bmpBase->getDC(), this, m_options->UseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options); + skin->measure(m_bmpBase->getDC(), this, m_options->bUseMaximumWidth ? m_options->MaximumWidth : SETTING_MAXIMUMWIDTH_MAX, m_options); // render popup m_bmpBase->allocate(m_sz.cx, m_sz.cy); @@ -270,16 +270,16 @@ void PopupWnd2::animate() } // update layered window if supported - updateLayered((m_options->UseTransparency && !(m_bIsHovered && m_options->OpaqueOnHover)) ? m_options->Alpha : 255); + updateLayered((m_options->bUseTransparency && !(m_bIsHovered && m_options->bOpaqueOnHover)) ? m_options->Alpha : 255); if (m_bReshapeWindow) { m_bReshapeWindow = false; - if (m_hwnd && m_bmp && m_options->DropShadow && PopupOptions.EnableFreeformShadows /*DoWeNeedRegionForThisSkin()*/) + if (m_hwnd && m_bmp && m_options->bDropShadow && PopupOptions.bEnableFreeformShadows /*DoWeNeedRegionForThisSkin()*/) SetWindowRgn(m_hwnd, m_bmp->buildOpaqueRgn(skin->getShadowRegionOpacity()), FALSE); - if (MyDwmEnableBlurBehindWindow && PopupOptions.EnableAeroGlass) { + if (MyDwmEnableBlurBehindWindow && PopupOptions.bEnableAeroGlass) { DWM_BLURBEHIND bb = { 0 }; bb.dwFlags = DWM_BB_ENABLE | DWM_BB_BLURREGION; bb.fEnable = TRUE; @@ -303,15 +303,15 @@ void PopupWnd2::animate() void PopupWnd2::show() { - if ((m_options->UseEffect || (m_options->UseAnimations && !m_customPopup)) && m_options->FadeIn) { + if ((m_options->bUseEffect || (m_options->bUseAnimations && !m_customPopup)) && m_options->FadeIn) { IPopupPlusEffect *effect = nullptr; m_bSlide = m_bFade = false; uint32_t dwTime, dwTime0 = GetTickCount(); uint32_t dwTime1 = dwTime0 + m_options->FadeIn; - if (m_options->UseEffect) { + if (m_options->bUseEffect) { m_bFade = true; m_btAlpha0 = 0; - m_btAlpha1 = m_options->UseTransparency ? m_options->Alpha : 255; + m_btAlpha1 = m_options->bUseTransparency ? m_options->Alpha : 255; updateLayered(m_btAlpha0); if (*PopupOptions.Effect) { @@ -325,9 +325,9 @@ void PopupWnd2::show() } } else { - updateLayered(m_options->UseTransparency ? m_options->Alpha : 255); + updateLayered(m_options->bUseTransparency ? m_options->Alpha : 255); } - if (m_options->UseAnimations && !m_customPopup) { + if (m_options->bUseAnimations && !m_customPopup) { m_bSlide = true; m_ptPosition0 = m_pos; m_ptPosition1 = m_pos; @@ -382,22 +382,22 @@ void PopupWnd2::show() m_bSlide = m_bFade = false; - updateLayered((m_options->UseTransparency && !(m_bIsHovered && m_options->OpaqueOnHover)) ? m_options->Alpha : 255); + updateLayered((m_options->bUseTransparency && !(m_bIsHovered && m_options->bOpaqueOnHover)) ? m_options->Alpha : 255); // updateLayered(m_options->UseTransparency ? m_options->Alpha : 255); SetWindowPos(m_hwnd, nullptr, m_pos.x, m_pos.y, 0, 0, SWP_NOZORDER | SWP_NOSIZE | SWP_NOACTIVATE | SWP_DEFERERASE | SWP_NOSENDCHANGING | SWP_SHOWWINDOW); } void PopupWnd2::hide() { - if ((m_options->UseEffect || (m_options->UseAnimations && !m_customPopup)) && m_options->FadeOut) { + if ((m_options->bUseEffect || (m_options->bUseAnimations && !m_customPopup)) && m_options->FadeOut) { m_bDestroy = true; IPopupPlusEffect *effect = nullptr; m_bFade = m_bSlide = false; uint32_t dwTime, dwTime0 = GetTickCount(); uint32_t dwTime1 = dwTime0 + m_options->FadeOut; - if (m_options->UseEffect) { + if (m_options->bUseEffect) { m_bFade = true; - m_btAlpha0 = m_options->UseTransparency ? m_options->Alpha : 255; + m_btAlpha0 = m_options->bUseTransparency ? m_options->Alpha : 255; m_btAlpha1 = 0; updateLayered(m_btAlpha0); @@ -411,7 +411,7 @@ void PopupWnd2::hide() } } } - if (m_options->UseAnimations && !m_customPopup) { + if (m_options->bUseAnimations && !m_customPopup) { m_bSlide = true; m_ptPosition0 = m_pos; m_ptPosition1 = m_pos; @@ -478,7 +478,7 @@ bool __forceinline isTextEmpty(wchar_t *text) void PopupWnd2::fixDefaults() { - if (m_options->UseWinColors) { + if (m_options->bUseWinColors) { m_clBack = GetSysColor(COLOR_BTNFACE); m_clText = GetSysColor(COLOR_WINDOWTEXT); m_clTitle = GetSysColor(COLOR_WINDOWTEXT); @@ -493,7 +493,7 @@ void PopupWnd2::fixDefaults() else m_clClock = m_clTitle; if (!m_iTimeout) - m_iTimeout = m_options->InfiniteDelay ? -1 : m_options->Seconds; + m_iTimeout = m_options->bInfiniteDelay ? -1 : m_options->Seconds; m_hContactPassed = m_hContact; if (m_hContact) @@ -677,7 +677,7 @@ void PopupWnd2::updateData(POPUPDATAW *ppd) m_PluginData = ppd->PluginData; m_PluginWindowProc = ppd->PluginWindowProc; - if (m_options->DisplayTime) + if (m_options->bDisplayTime) GetTimeFormat(LOCALE_USER_DEFAULT, 0, nullptr, L"HH':'mm", m_time, _countof(m_time)); else m_time[0] = 0; @@ -716,7 +716,7 @@ void PopupWnd2::updateData(POPUPDATA2 *ppd) m_hbmAvatar = ppd->hbmAvatar; m_lpzSkin = mir_a2u(ppd->lpzSkin); - if (m_options->DisplayTime) { + if (m_options->bDisplayTime) { if (ppd->dwTimestamp) TimeZone_ToStringT(ppd->dwTimestamp, L"t", m_time, _countof(m_time)); else @@ -732,7 +732,7 @@ void PopupWnd2::updateData(POPUPDATA2 *ppd) void PopupWnd2::buildMText() { - if (!(htuText && htuTitle && PopupOptions.UseMText)) + if (!(htuText && htuTitle && PopupOptions.bUseMText)) return; if (m_mtText) MTextDestroy(m_mtText); @@ -1142,7 +1142,7 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara _TrackMouseEvent(&tme); if (!m_customPopup) PopupThreadLock(); - if (m_options->OpaqueOnHover) + if (m_options->bOpaqueOnHover) updateLayered(255); m_bIsHovered = true; @@ -1158,8 +1158,8 @@ LRESULT CALLBACK PopupWnd2::WindowProc(UINT message, WPARAM wParam, LPARAM lPara if (!m_bIsHovered) break; - if (m_options->OpaqueOnHover) - updateLayered(m_options->UseTransparency ? m_options->Alpha : 255); + if (m_options->bOpaqueOnHover) + updateLayered(m_options->bUseTransparency ? m_options->Alpha : 255); if (!m_customPopup) PopupThreadUnlock(); m_bIsHovered = false; diff --git a/plugins/Popup/src/services.cpp b/plugins/Popup/src/services.cpp index 527e9c0c64..82701a59cf 100644 --- a/plugins/Popup/src/services.cpp +++ b/plugins/Popup/src/services.cpp @@ -132,7 +132,7 @@ INT_PTR Popup_AddPopup2(WPARAM wParam, LPARAM lParam) if (!Popup_Enabled()) return -1; - if (PopupOptions.DisableWhenFullscreen && (bShowMode != PU_SHOWMODE_FULLSCREEN) && IsFullScreen()) + if (PopupOptions.bDisableWhenFullscreen && (bShowMode != PU_SHOWMODE_FULLSCREEN) && IsFullScreen()) return -1; if (g_plugin.getDword(LPGEN("Global Status"), 0) & Proto_Status2Flag_My(CallService(MS_CLIST_GETSTATUSMODE, 0, 0))) diff --git a/plugins/Popup/src/skin.cpp b/plugins/Popup/src/skin.cpp index 6d16d9bee3..b10868eca2 100644 --- a/plugins/Popup/src/skin.cpp +++ b/plugins/Popup/src/skin.cpp @@ -407,8 +407,8 @@ void PopupSkin::measure(HDC hdc, PopupWnd2 *wnd, int maxw, POPUPOPTIONS *options if (tmp = m_fw.eval(wnd->getArgs())) sz.cx = tmp; if (tmp = m_fh.eval(wnd->getArgs())) sz.cy = tmp; - if (options->DynamicResize) { - if (options->UseMinimumWidth && sz.cx < options->MinimumWidth) + if (options->bDynamicResize) { + if (options->bUseMinimumWidth && sz.cx < options->MinimumWidth) sz.cx = options->MinimumWidth; } else sz.cx = options->MaximumWidth; @@ -655,7 +655,7 @@ void PopupSkin::display(MyBitmap *bmp, PopupWnd2 *wnd, POPUPOPTIONS *options, ui break; case ST_CLOCK: - if (options->DisplayTime) { + if (options->bDisplayTime) { COLORREF back = wnd->getBackColor(); int x = head->fx.eval(wnd->getArgs()); int y = head->fy.eval(wnd->getArgs()); -- cgit v1.2.3