33ad4d8acf
Replaces libinterface's ToolButton, a custom button that can display a pop-up menu on click (along with a custom image). It didn't scale well with different themes and font-sizes compared to BButtons― which ToolButton is supposed to look like to begin with. A BButton-derived class is used instead, so these buttons look more in-place among other buttons.
31 lines
620 B
C++
31 lines
620 B
C++
/*
|
|
* Copyright 2021, Jaidyn Levesque <jadedctrl@teknik.io>
|
|
* All rights reserved. Distributed under the terms of the MIT license.
|
|
*/
|
|
#ifndef _MENU_BUTTON_H
|
|
#define _MENU_BUTTON_H
|
|
|
|
#include <Button.h>
|
|
|
|
class BPopUpMenu;
|
|
|
|
|
|
class MenuButton : public BButton {
|
|
public:
|
|
MenuButton(const char* name, const char* label,
|
|
BMessage* message);
|
|
|
|
virtual void MouseDown(BPoint where);
|
|
virtual void MouseUp(BPoint where);
|
|
virtual void MouseMoved(BPoint where, uint32 code, const BMessage* dragMsg);
|
|
|
|
BPopUpMenu* Menu();
|
|
void SetMenu(BPopUpMenu* menu);
|
|
|
|
private:
|
|
BPopUpMenu* fMenu;
|
|
|
|
};
|
|
|
|
#endif // _MENU_BUTTON_H
|