diff options
author | George Hazan <ghazan@miranda.im> | 2019-10-29 15:27:58 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2019-10-29 15:27:58 +0300 |
commit | 386efd14b629c5d9cf383653936cce5861e6c7a9 (patch) | |
tree | 1c3e456a58afe9f2e9fc745382a7b0f97d9d3f59 /plugins/TabSRMM/src/tabctrl.cpp | |
parent | 3726509beeceda60e3e34d2d41db1f05c5dc46a7 (diff) |
tabSRMM: get rid of manual bit operations
Diffstat (limited to 'plugins/TabSRMM/src/tabctrl.cpp')
-rw-r--r-- | plugins/TabSRMM/src/tabctrl.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/plugins/TabSRMM/src/tabctrl.cpp b/plugins/TabSRMM/src/tabctrl.cpp index 714ddc826e..1356f16061 100644 --- a/plugins/TabSRMM/src/tabctrl.cpp +++ b/plugins/TabSRMM/src/tabctrl.cpp @@ -194,7 +194,7 @@ static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, in hIcon = dat->m_hTabIcon;
}
- if (!dat->m_bCanFlashTab || (dat->m_bCanFlashTab == TRUE && dat->m_bTabFlash) || !(dat->m_pContainer->m_dwFlagsEx & TCF_FLASHICON)) {
+ if (!dat->m_bCanFlashTab || (dat->m_bCanFlashTab == TRUE && dat->m_bTabFlash) || !dat->m_pContainer->m_flagsEx.m_bTabFlashIcon) {
DWORD ix = rcItem->left + tabdat->xpad - 1;
DWORD iy = (rcItem->bottom + rcItem->top - iSize) / 2;
if (dat->m_dwFlagsEx & MWF_SHOW_ISIDLE && PluginConfig.m_bIdleDetect)
@@ -216,7 +216,7 @@ static void DrawItem(TabControlData *tabdat, HDC dc, RECT *rcItem, int nHint, in CSkin::m_default_bf.SourceConstantAlpha = 255;
}
- if (!dat->m_bCanFlashTab || (dat->m_bCanFlashTab == TRUE && dat->m_bTabFlash) || !(dat->m_pContainer->m_dwFlagsEx & TCF_FLASHLABEL)) {
+ if (!dat->m_bCanFlashTab || (dat->m_bCanFlashTab == TRUE && dat->m_bTabFlash) || !dat->m_pContainer->m_flagsEx.m_bTabFlashLabel) {
DWORD dwTextFlags = DT_SINGLELINE | DT_VCENTER;
HFONT oldFont = (HFONT)SelectObject(dc, (HFONT)SendMessage(tabdat->hwnd, WM_GETFONT, 0, 0));
if (tabdat->dwStyle & TCS_BUTTONS || !(tabdat->dwStyle & TCS_MULTILINE)) {
@@ -610,7 +610,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) tabdat->iHoveredTabIndex = hotItem;
tabdat->bAeroTabs = CSkin::m_fAeroSkinsValid && (isAero || PluginConfig.m_fillColor);
- tabdat->bCloseButton = (tabdat->pContainer->m_dwFlagsEx & TCF_CLOSEBUTTON) != 0;
+ tabdat->bCloseButton = tabdat->pContainer->m_flagsEx.m_bTabCloseButton;
tabdat->helperDat = nullptr;
if (tabdat->bAeroTabs) {
@@ -631,7 +631,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) // switchbar is active, don't paint a single pixel, the tab control won't be visible at all
// same when we have only ONE tab and do not want it to be visible because of the container
// option "Show tab bar only when needed".
- if ((tabdat->pContainer->m_dwFlags & CNT_SIDEBAR) || (nCount == 1 && tabdat->pContainer->m_dwFlags & CNT_HIDETABS)) {
+ if ((tabdat->pContainer->m_flags.m_bSideBar) || (nCount == 1 && tabdat->pContainer->m_flags.m_bHideTabs)) {
if (nCount == 0)
FillRect(hdcreal, &ps.rcPaint, GetSysColorBrush(COLOR_3DFACE)); // avoid flickering/ugly black background during container creation
EndPaint(hwnd, &ps);
@@ -660,7 +660,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) bmpOld = (HBITMAP)SelectObject(hdc, bmpMem);
}
- if (nCount == 1 && tabdat->pContainer->m_dwFlags & CNT_HIDETABS)
+ if (nCount == 1 && tabdat->pContainer->m_flags.m_bHideTabs)
rctClip = rctPage;
if (CSkin::m_skinEnabled)
@@ -692,7 +692,7 @@ static void PaintWorker(HWND hwnd, TabControlData *tabdat) }
}
- if (nCount > 1 || !(tabdat->pContainer->m_dwFlags & CNT_HIDETABS)) {
+ if (nCount > 1 || !(tabdat->pContainer->m_flags.m_bHideTabs)) {
rctClip = rctPage;
InflateRect(&rctClip, -tabdat->pContainer->m_tBorder, -tabdat->pContainer->m_tBorder);
}
@@ -820,7 +820,7 @@ page_done: pt.y = rcLog.bottom;
pt.x = rcLog.left;
ScreenToClient(hwnd, &pt);
- rcPage.top = pt.y + ((nCount > 1 || !(tabdat->helperDat->m_pContainer->m_dwFlags & CNT_HIDETABS)) ? tabdat->helperDat->m_pContainer->m_tBorder : 0);
+ rcPage.top = pt.y + ((nCount > 1 || !(tabdat->helperDat->m_pContainer->m_flags.m_bHideTabs)) ? tabdat->helperDat->m_pContainer->m_tBorder : 0);
FillRect(hdc, &rcPage, CSkin::m_BrushBack);
rcPage.top = 0;
}
@@ -1043,7 +1043,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara tabdat->bTipActive = false;
}
KillTimer(hwnd, TIMERID_HOVER_T);
- if (tabdat->pContainer && (!tabdat->pContainer->m_pSideBar->isActive() && (TabCtrl_GetItemCount(hwnd) > 1 || !(tabdat->pContainer->m_dwFlags & CNT_HIDETABS))))
+ if (tabdat->pContainer && (!tabdat->pContainer->m_pSideBar->isActive() && (TabCtrl_GetItemCount(hwnd) > 1 || !(tabdat->pContainer->m_flags.m_bHideTabs))))
SetTimer(hwnd, TIMERID_HOVER_T, 750, nullptr);
break;
@@ -1052,7 +1052,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara int iTabs = TabCtrl_GetItemCount(hwnd);
if (!(tabdat->dwStyle & TCS_MULTILINE)) {
- if (iTabs > (tabdat->pContainer->m_dwFlags & CNT_HIDETABS ? 1 : 0)) {
+ if (iTabs > (tabdat->pContainer->m_flags.m_bHideTabs ? 1 : 0)) {
RECT rcClient, rc;
GetClientRect(hwnd, &rcClient);
TabCtrl_GetItemRect(hwnd, iTabs - 1, &rc);
@@ -1080,7 +1080,7 @@ static LRESULT CALLBACK TabControlSubclassProc(HWND hwnd, UINT msg, WPARAM wPara break;
case WM_LBUTTONDBLCLK:
- if (!(tabdat->pContainer->m_pSettings->dwFlagsEx & TCF_CLOSEBUTTON)) {
+ if (!tabdat->pContainer->m_pSettings->flagsEx.m_bTabCloseButton) {
GetCursorPos(&pt);
tabdat->pContainer->CloseTabByMouse(&pt);
}
|