[RAPPS] Merge CMainToolbar::Show/HideButtonCaption() into one single function.

This commit is contained in:
Hermès Bélusca-Maïto 2024-03-22 21:58:35 +01:00
parent e8cf32cf15
commit 385274e2dd
No known key found for this signature in database
GPG key ID: 3B2539C65E7B93D0
2 changed files with 10 additions and 16 deletions

View file

@ -157,18 +157,14 @@ CMainToolbar::Create(HWND hwndParent)
return m_hWnd;
}
VOID
CMainToolbar::HideButtonCaption()
void
CMainToolbar::ShowButtonCaption(bool bShow)
{
DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
SendMessageW(TB_SETEXTENDEDSTYLE, 0, dCurrentExStyle | TBSTYLE_EX_MIXEDBUTTONS);
}
VOID
CMainToolbar::ShowButtonCaption()
{
DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
SendMessageW(TB_SETEXTENDEDSTYLE, 0, dCurrentExStyle & ~TBSTYLE_EX_MIXEDBUTTONS);
if (bShow)
SendMessageW(TB_SETEXTENDEDSTYLE, 0, dCurrentExStyle & ~TBSTYLE_EX_MIXEDBUTTONS);
else
SendMessageW(TB_SETEXTENDEDSTYLE, 0, dCurrentExStyle | TBSTYLE_EX_MIXEDBUTTONS);
}
DWORD
@ -1737,11 +1733,11 @@ CApplicationView::OnSize(HWND hwnd, WPARAM wParam, LPARAM lParam)
if (dSearchbarMargin > dToolbarTreshold)
{
m_Toolbar->ShowButtonCaption();
m_Toolbar->ShowButtonCaption(true);
}
else if (dSearchbarMargin < dToolbarTreshold)
{
m_Toolbar->HideButtonCaption();
m_Toolbar->ShowButtonCaption(false);
}
RECT r = {0, 0, LOWORD(lParam), HIWORD(lParam)};

View file

@ -293,10 +293,8 @@ class CMainToolbar : public CUiWindow<CToolbar<>>
HWND
Create(HWND hwndParent);
VOID
HideButtonCaption();
VOID
ShowButtonCaption();
void
ShowButtonCaption(bool bShow);
DWORD
GetMaxButtonsWidth() const;