mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-21 12:27:27 +03:00
Pass action to IconButton constructor
This removes the need for a separate setAction method. The default action is the empty action, which does nothing. However, a touch event on a button with the empty action is no longer considered handled. Menu::btnContextMenu was changed from a unique_ptr to a plain data member.
This commit is contained in:
@@ -15,9 +15,8 @@ class Touchscreen;
|
||||
class IconButton {
|
||||
public:
|
||||
IconButton(GMenu2X *gmenu2x, Touchscreen &ts,
|
||||
const std::string &icon, const std::string &label = "");
|
||||
|
||||
void setAction(function_t action);
|
||||
const std::string &icon, const std::string &label = "",
|
||||
function_t action = nullptr);
|
||||
|
||||
SDL_Rect getRect() { return rect; }
|
||||
void setPosition(int x, int y);
|
||||
|
||||
Reference in New Issue
Block a user