https://git.reactos.org/?p=reactos.git;a=commitdiff;h=385274e2dd0309bba84955d9f67dcbcb07bba066

commit 385274e2dd0309bba84955d9f67dcbcb07bba066
Author:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
AuthorDate: Fri Mar 22 21:58:35 2024 +0100
Commit:     Hermès Bélusca-Maïto <hermes.belusca-ma...@reactos.org>
CommitDate: Wed Sep 18 12:31:41 2024 +0200

    [RAPPS] Merge CMainToolbar::Show/HideButtonCaption() into one single 
function.
---
 base/applications/rapps/appview.cpp       | 20 ++++++++------------
 base/applications/rapps/include/appview.h |  6 ++----
 2 files changed, 10 insertions(+), 16 deletions(-)

diff --git a/base/applications/rapps/appview.cpp 
b/base/applications/rapps/appview.cpp
index e16c0929a92..fb7515d5cfc 100644
--- a/base/applications/rapps/appview.cpp
+++ b/base/applications/rapps/appview.cpp
@@ -157,18 +157,14 @@ CMainToolbar::Create(HWND hwndParent)
     return m_hWnd;
 }
 
-VOID
-CMainToolbar::HideButtonCaption()
-{
-    DWORD dCurrentExStyle = (DWORD)SendMessageW(TB_GETEXTENDEDSTYLE, 0, 0);
-    SendMessageW(TB_SETEXTENDEDSTYLE, 0, dCurrentExStyle | 
TBSTYLE_EX_MIXEDBUTTONS);
-}
-
-VOID
-CMainToolbar::ShowButtonCaption()
+void
+CMainToolbar::ShowButtonCaption(bool bShow)
 {
     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)};
diff --git a/base/applications/rapps/include/appview.h 
b/base/applications/rapps/include/appview.h
index debc0b2c1bb..46a3a583092 100644
--- a/base/applications/rapps/include/appview.h
+++ b/base/applications/rapps/include/appview.h
@@ -293,10 +293,8 @@ class CMainToolbar : public CUiWindow<CToolbar<>>
     HWND
     Create(HWND hwndParent);
 
-    VOID
-    HideButtonCaption();
-    VOID
-    ShowButtonCaption();
+    void
+    ShowButtonCaption(bool bShow);
 
     DWORD
     GetMaxButtonsWidth() const;

Reply via email to