diff options
author | André Nusser <andre.nusser@googlemail.com> | 2017-04-16 12:54:16 +0200 |
---|---|---|
committer | André Nusser <andre.nusser@googlemail.com> | 2017-04-16 12:54:16 +0200 |
commit | 19b9cddf7d5ef3daac5cda481db492f28574d28d (patch) | |
tree | a3ca1d8ab84df69bd01c9bbab6d455c996cc462c /plugingui/button.h | |
parent | f4114b68d903eb5828c93910853ea9fdea004952 (diff) |
Move button functionality to BaseButton. Create TabButton.
Diffstat (limited to 'plugingui/button.h')
-rw-r--r-- | plugingui/button.h | 37 |
1 files changed, 4 insertions, 33 deletions
diff --git a/plugingui/button.h b/plugingui/button.h index 04656ba..fde0459 100644 --- a/plugingui/button.h +++ b/plugingui/button.h @@ -26,42 +26,23 @@ */ #pragma once -#include <string> - -#include <notifier.h> - -#include "widget.h" -#include "painter.h" +#include "button_base.h" #include "font.h" #include "texturedbox.h" namespace GUI { -class Button : public Widget { +class Button + : public ButtonBase { public: - Button(Widget *parent); + Button(Widget* parent); virtual ~Button(); - // From Widget: - bool isFocusable() override { return true; } - bool catchMouse() override { return true; } - - void setText(const std::string& text); - - Notifier<> clickNotifier; - protected: - virtual void clicked() {} - // From Widget: virtual void repaintEvent(RepaintEvent* e) override; - virtual void buttonEvent(ButtonEvent* e) override; - virtual void mouseLeaveEvent() override; - virtual void mouseEnterEvent() override; private: - bool in_button{false}; - TexturedBox box_up{getImageCache(), ":pushbutton.png", 0, 0, // atlas offset (x, y) 11, 1, 11, // dx1, dx2, dx3 @@ -72,17 +53,7 @@ private: 11, 1, 11, // dx1, dx2, dx3 10, 72, 12}; // dy1, dy2, dy3 - typedef enum { - up, - down - } state_t; - - std::string text; - Font font{":fontemboss.png"}; - - state_t draw_state{up}; - state_t button_state{up}; }; } // GUI:: |