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:
@@ -27,7 +27,6 @@
|
||||
|
||||
using std::string;
|
||||
using std::unique_ptr;
|
||||
using std::move;
|
||||
|
||||
MenuSettingFile::MenuSettingFile(
|
||||
GMenu2X *gmenu2x, Touchscreen &ts_,
|
||||
@@ -37,15 +36,15 @@ MenuSettingFile::MenuSettingFile(
|
||||
, ts(ts_)
|
||||
, filter(filter_)
|
||||
{
|
||||
unique_ptr<IconButton> btnClear(new IconButton(
|
||||
gmenu2x, ts, "skin:imgs/buttons/cancel.png", gmenu2x->tr["Clear"]));
|
||||
btnClear->setAction(BIND(&MenuSettingFile::clear));
|
||||
buttonBox.add(move(btnClear));
|
||||
buttonBox.add(unique_ptr<IconButton>(new IconButton(
|
||||
gmenu2x, ts, "skin:imgs/buttons/cancel.png",
|
||||
gmenu2x->tr["Clear"],
|
||||
BIND(&MenuSettingFile::clear))));
|
||||
|
||||
unique_ptr<IconButton> btnSelect(new IconButton(
|
||||
gmenu2x, ts, "skin:imgs/buttons/accept.png", gmenu2x->tr["Select"]));
|
||||
btnSelect->setAction(BIND(&MenuSettingFile::edit));
|
||||
buttonBox.add(move(btnSelect));
|
||||
buttonBox.add(unique_ptr<IconButton>(new IconButton(
|
||||
gmenu2x, ts, "skin:imgs/buttons/accept.png",
|
||||
gmenu2x->tr["Select"],
|
||||
BIND(&MenuSettingFile::edit))));
|
||||
}
|
||||
|
||||
void MenuSettingFile::edit()
|
||||
|
||||
Reference in New Issue
Block a user