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/sidebar.cpp | |
parent | 3726509beeceda60e3e34d2d41db1f05c5dc46a7 (diff) |
tabSRMM: get rid of manual bit operations
Diffstat (limited to 'plugins/TabSRMM/src/sidebar.cpp')
-rw-r--r-- | plugins/TabSRMM/src/sidebar.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/TabSRMM/src/sidebar.cpp b/plugins/TabSRMM/src/sidebar.cpp index 2943b6c801..a244a616a1 100644 --- a/plugins/TabSRMM/src/sidebar.cpp +++ b/plugins/TabSRMM/src/sidebar.cpp @@ -148,7 +148,7 @@ const SIZE& CSideBarButton::measureItem() ::GetTextExtentPoint32(dc, tszLabel, (int)mir_wstrlen(tszLabel), &sz);
sz.cx += 28;
- if (m_dat->m_pContainer->m_dwFlagsEx & TCF_CLOSEBUTTON)
+ if (m_dat->m_pContainer->m_flagsEx.m_bTabCloseButton)
sz.cx += 20;
if (m_sideBarLayout->dwFlags & CSideBar::SIDEBARLAYOUT_VERTICALORIENTATION)
@@ -255,7 +255,7 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const if (m_dat && pContainer) {
hIcon = m_dat->m_cache->getIcon(iSize);
- if (!m_dat->m_bCanFlashTab || (m_dat->m_bCanFlashTab == TRUE && m_dat->m_bTabFlash) || !(pContainer->m_dwFlagsEx & TCF_FLASHICON)) {
+ if (!m_dat->m_bCanFlashTab || (m_dat->m_bCanFlashTab == TRUE && m_dat->m_bTabFlash) || !pContainer->m_flagsEx.m_bTabFlashIcon) {
DWORD ix = rc.left + 4;
DWORD iy = (rc.bottom + rc.top - iSize) / 2;
if (m_dat->m_dwFlagsEx & MWF_SHOW_ISIDLE && PluginConfig.m_bIdleDetect)
@@ -269,7 +269,7 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const /*
* draw the close button if enabled
*/
- if (m_sideBar->getContainer()->m_dwFlagsEx & TCF_CLOSEBUTTON) {
+ if (m_sideBar->getContainer()->m_flagsEx.m_bTabCloseButton) {
if (m_sideBar->getHoveredClose() != this)
CSkin::m_default_bf.SourceConstantAlpha = 150;
@@ -281,7 +281,7 @@ void CSideBarButton::renderIconAndNick(const HDC hdc, const RECT *rcItem) const ::SetBkMode(hdc, TRANSPARENT);
- if (!m_dat->m_bCanFlashTab || (m_dat->m_bCanFlashTab == TRUE && m_dat->m_bTabFlash) || !(pContainer->m_dwFlagsEx & TCF_FLASHLABEL)) {
+ if (!m_dat->m_bCanFlashTab || (m_dat->m_bCanFlashTab == TRUE && m_dat->m_bTabFlash) || !pContainer->m_flagsEx.m_bTabFlashLabel) {
bool fIsActive = (m_sideBar->getActiveItem() == this ? true : false);
COLORREF clr = 0;
dwTextFlags |= DT_WORD_ELLIPSIS;
@@ -307,7 +307,7 @@ int CSideBarButton::testCloseButton() const if (m_id == IDC_SIDEBARUP || m_id == IDC_SIDEBARDOWN) // scroller buttons don't have a close button
return -1;
- if (m_sideBar->getContainer()->m_dwFlagsEx & TCF_CLOSEBUTTON && !(getLayout()->dwFlags & CSideBar::SIDEBARLAYOUT_NOCLOSEBUTTONS)) {
+ if (m_sideBar->getContainer()->m_flagsEx.m_bTabCloseButton && !(getLayout()->dwFlags & CSideBar::SIDEBARLAYOUT_NOCLOSEBUTTONS)) {
POINT pt;
::GetCursorPos(&pt);
::ScreenToClient(m_hwnd, &pt);
@@ -379,17 +379,17 @@ void CSideBar::Init() m_firstVisibleOffset = 0;
m_totalItemHeight = 0;
- m_uLayout = (m_pContainer->m_dwFlagsEx & 0xff000000) >> 24;
+ m_uLayout = (m_pContainer->m_flagsEx.dw & 0xff000000) >> 24;
m_uLayout = ((m_uLayout < NR_LAYOUTS) ? m_uLayout : 0);
m_currentLayout = &m_layouts[m_uLayout];
m_dwFlags = m_currentLayout->dwFlags;
- m_dwFlags = (m_pContainer->m_dwFlagsEx & TCF_SBARLEFT ? m_dwFlags | SIDEBARORIENTATION_LEFT : m_dwFlags & ~SIDEBARORIENTATION_LEFT);
- m_dwFlags = (m_pContainer->m_dwFlagsEx & TCF_SBARRIGHT ? m_dwFlags | SIDEBARORIENTATION_RIGHT : m_dwFlags & ~SIDEBARORIENTATION_RIGHT);
+ m_dwFlags = (m_pContainer->m_flagsEx.m_bTabSBarLeft ? m_dwFlags | SIDEBARORIENTATION_LEFT : m_dwFlags & ~SIDEBARORIENTATION_LEFT);
+ m_dwFlags = (m_pContainer->m_flagsEx.m_bTabSBarRight ? m_dwFlags | SIDEBARORIENTATION_RIGHT : m_dwFlags & ~SIDEBARORIENTATION_RIGHT);
- if (m_pContainer->m_dwFlags & CNT_SIDEBAR) {
+ if (m_pContainer->m_flags.m_bSideBar) {
if (m_hwndScrollWnd == nullptr)
m_hwndScrollWnd = ::CreateWindowEx(0, L"TS_SideBarClass", L"", WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_VISIBLE | WS_CHILD,
0, 0, m_width, 40, m_pContainer->m_hwnd, reinterpret_cast<HMENU>(5000), g_plugin.getInst(), this);
|