summaryrefslogtreecommitdiff
path: root/plugingui/tabbutton.h
diff options
context:
space:
mode:
authorAndré Nusser <andre.nusser@googlemail.com>2017-04-16 12:54:16 +0200
committerAndré Nusser <andre.nusser@googlemail.com>2017-04-16 12:54:16 +0200
commit19b9cddf7d5ef3daac5cda481db492f28574d28d (patch)
treea3ca1d8ab84df69bd01c9bbab6d455c996cc462c /plugingui/tabbutton.h
parentf4114b68d903eb5828c93910853ea9fdea004952 (diff)
Move button functionality to BaseButton. Create TabButton.
Diffstat (limited to 'plugingui/tabbutton.h')
-rw-r--r--plugingui/tabbutton.h34
1 files changed, 28 insertions, 6 deletions
diff --git a/plugingui/tabbutton.h b/plugingui/tabbutton.h
index 2f5e287..2f0dc10 100644
--- a/plugingui/tabbutton.h
+++ b/plugingui/tabbutton.h
@@ -28,26 +28,48 @@
#include <notifier.h>
-#include "widget.h"
-#include "button.h"
+#include "button_base.h"
+#include "font.h"
+#include "texturedbox.h"
namespace GUI
{
class TabButton
- : public Button
+ : public ButtonBase
{
public:
- TabButton(Widget* parent, Widget* tabWidget);
+ TabButton(Widget* parent, Widget* tab_widget);
+ virtual ~TabButton();
- Widget *getTabWidget();
+ Widget* getTabWidget();
+ std::size_t getMinimalWidth() const;
+ std::size_t getMinimalHeight() const;
+ void setActive(bool active);
Notifier<Widget*> switchTabNotifier;
+protected:
+ // From Widget:
+ virtual void repaintEvent(RepaintEvent* e) override;
+
private:
void clickHandler();
- Widget* tabWidget;
+ Widget* tab_widget;
+ bool active;
+
+ TexturedBox tab_active{getImageCache(), ":tab.png",
+ 0, 0, // atlas offset (x, y)
+ 5, 1, 5, // dx1, dx2, dx3
+ 5, 13, 1}; // dy1, dy2, dy3
+
+ TexturedBox tab_passive{getImageCache(), ":tab.png",
+ 11, 0, // atlas offset (x, y)
+ 5, 1, 5, // dx1, dx2, dx3
+ 5, 13, 1}; // dy1, dy2, dy3
+
+ Font font{":fontemboss.png"};
};
} // GUI::