1
0
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:
Maarten ter Huurne
2014-08-16 06:35:27 +02:00
parent 428a316bc1
commit 7e308879c1
13 changed files with 93 additions and 113 deletions

View File

@@ -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);