From 386efd14b629c5d9cf383653936cce5861e6c7a9 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 29 Oct 2019 15:27:58 +0300 Subject: tabSRMM: get rid of manual bit operations --- plugins/TabSRMM/src/sidebar.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'plugins/TabSRMM/src/sidebar.cpp') 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(5000), g_plugin.getInst(), this); -- cgit v1.2.3