mirror of
git://projects.qi-hardware.com/gmenu2x.git
synced 2025-04-21 12:27:27 +03:00
Removed "delegate.h"
The abstraction it provided was so thin that I think it is simpler to just have the code use std::bind directly.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
#ifndef ICONBUTTON_H
|
||||
#define ICONBUTTON_H
|
||||
|
||||
#include "delegate.h"
|
||||
#include "gmenu2x.h"
|
||||
|
||||
#include <SDL.h>
|
||||
|
||||
#include <functional>
|
||||
#include <string>
|
||||
|
||||
class OffscreenSurface;
|
||||
@@ -14,9 +15,11 @@ class Touchscreen;
|
||||
|
||||
class IconButton {
|
||||
public:
|
||||
typedef std::function<void(void)> Action;
|
||||
|
||||
IconButton(GMenu2X *gmenu2x, Touchscreen &ts,
|
||||
const std::string &icon, const std::string &label = "",
|
||||
function_t action = nullptr);
|
||||
Action action = nullptr);
|
||||
|
||||
SDL_Rect getRect() { return rect; }
|
||||
void setPosition(int x, int y);
|
||||
@@ -31,7 +34,7 @@ private:
|
||||
GMenu2X *gmenu2x;
|
||||
Touchscreen &ts;
|
||||
std::string icon, label;
|
||||
function_t action;
|
||||
Action action;
|
||||
|
||||
SDL_Rect rect, iconRect, labelRect;
|
||||
OffscreenSurface *iconSurface;
|
||||
|
||||
Reference in New Issue
Block a user