summaryrefslogtreecommitdiff
path: root/plugingui/tabbutton.cc
diff options
context:
space:
mode:
authorBent Bisballe Nyeng <deva@aasimon.org>2019-02-11 10:52:30 +0100
committerBent Bisballe Nyeng <deva@aasimon.org>2019-02-11 10:52:30 +0100
commit43c2a51331d3e91d86ef50c5262920bdaa260925 (patch)
treeffc5b03be36537e6f028df935a251493d4557979 /plugingui/tabbutton.cc
parent152423c0274887415b50c0d31828036a8fe54708 (diff)
Show/hide drumkit tab depending on if the current kit has a valid image attached or not.
Diffstat (limited to 'plugingui/tabbutton.cc')
-rw-r--r--plugingui/tabbutton.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/plugingui/tabbutton.cc b/plugingui/tabbutton.cc
index 845dedb..6a27f61 100644
--- a/plugingui/tabbutton.cc
+++ b/plugingui/tabbutton.cc
@@ -31,10 +31,18 @@
namespace GUI
{
+static TabID getNextTabID()
+{
+ static TabID next{0};
+ next++;
+ return next;
+}
+
TabButton::TabButton(Widget* parent, Widget* tab_widget)
: ButtonBase(parent)
, tab_widget(tab_widget)
{
+ tab_id = getNextTabID();
CONNECT(this, clickNotifier, this, &TabButton::clickHandler);
}
@@ -77,6 +85,11 @@ void TabButton::setActive(bool active)
redraw();
}
+TabID TabButton::getID() const
+{
+ return tab_id;
+}
+
void TabButton::repaintEvent(RepaintEvent* e)
{
Painter p(*this);