Skip to content

Commit 06cc9c2

Browse files
author
Noel Grandin
committed
MenuButton::SetDelayMenu is unused
since commit d925df3 Author: Michael Weghorn <m.weghorn@posteo.de> Date: Sat Jul 26 10:11:50 2025 +0200 tdf#130857 weld: Drop unused weld::MenuToggleButton Change-Id: I82003551b0c8f61cb3d4e930935fa675ef770eb5 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/190576 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
1 parent 8c2c571 commit 06cc9c2

File tree

2 files changed

+5
-38
lines changed

2 files changed

+5
-38
lines changed

include/vcl/toolkit/MenuButton.hxx

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ private:
4343
sal_uInt16 mnCurItemId;
4444
// whether the MenuButton is the owner of mpMenu
4545
bool mbOwnPopupMenu = false;
46-
bool mbDelayMenu;
4746
bool mbStartingMenu;
4847
Link<MenuButton*,void> maActivateHdl;
4948
Link<MenuButton*,void> maSelectHdl;
@@ -74,14 +73,6 @@ public:
7473
bool InPopupMode() const;
7574
void CancelMenu();
7675

77-
//if false then the whole button launches the menu
78-
//if true, then the button has a separator
79-
//where the right portion launches the menu immediately
80-
//where the left portion activates the underlying Button handlers
81-
//before launching the menu in an idle, allowing it to be cancelled
82-
//before being shown
83-
void SetDelayMenu(bool bDelay) { mbDelayMenu = bDelay; }
84-
8576
void SetPopupMenu(PopupMenu* pNewMenu, bool bTakeOwnership);
8677
PopupMenu* GetPopupMenu() const { return mpMenu; }
8778

vcl/source/control/MenuButton.cxx

Lines changed: 5 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,6 @@ bool MenuButton::InPopupMode() const
150150
MenuButton::MenuButton( vcl::Window* pParent, WinBits nWinBits )
151151
: PushButton(WindowType::MENUBUTTON)
152152
, mnCurItemId(0)
153-
, mbDelayMenu(false)
154153
, mbStartingMenu(false)
155154
{
156155
mnDDStyle = PushButtonDropdownStyle::MenuButton;
@@ -185,33 +184,11 @@ IMPL_LINK_NOARG(MenuButton, ImplMenuTimeoutHdl, Timer *, void)
185184

186185
void MenuButton::MouseButtonDown( const MouseEvent& rMEvt )
187186
{
188-
bool bExecute = true;
189-
if (mbDelayMenu)
187+
if ( PushButton::ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) )
190188
{
191-
// If the separated dropdown symbol is not hit, delay the popup execution
192-
if( rMEvt.GetPosPixel().X() <= ImplGetSeparatorX() )
193-
{
194-
if ( !mpMenuTimer )
195-
{
196-
mpMenuTimer.reset(new Timer("MenuTimer"));
197-
mpMenuTimer->SetInvokeHandler( LINK( this, MenuButton, ImplMenuTimeoutHdl ) );
198-
}
199-
200-
mpMenuTimer->SetTimeout( MouseSettings::GetActionDelay() );
201-
mpMenuTimer->Start();
202-
203-
PushButton::MouseButtonDown( rMEvt );
204-
bExecute = false;
205-
}
206-
}
207-
if( bExecute )
208-
{
209-
if ( PushButton::ImplHitTestPushButton( this, rMEvt.GetPosPixel() ) )
210-
{
211-
if ( !(GetStyle() & WB_NOPOINTERFOCUS) )
212-
GrabFocus();
213-
ExecuteMenu();
214-
}
189+
if ( !(GetStyle() & WB_NOPOINTERFOCUS) )
190+
GrabFocus();
191+
ExecuteMenu();
215192
}
216193
}
217194

@@ -221,8 +198,7 @@ void MenuButton::KeyInput( const KeyEvent& rKEvt )
221198
sal_uInt16 nCode = aKeyCode.GetCode();
222199
if ( (nCode == KEY_DOWN) && aKeyCode.IsMod2() )
223200
ExecuteMenu();
224-
else if ( !mbDelayMenu &&
225-
!aKeyCode.GetModifier() &&
201+
else if ( !aKeyCode.GetModifier() &&
226202
((nCode == KEY_RETURN) || (nCode == KEY_SPACE)) )
227203
ExecuteMenu();
228204
else

0 commit comments

Comments
 (0)