From 43c2a51331d3e91d86ef50c5262920bdaa260925 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Mon, 11 Feb 2019 10:52:30 +0100 Subject: Show/hide drumkit tab depending on if the current kit has a valid image attached or not. --- plugingui/tabwidget.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'plugingui/tabwidget.h') diff --git a/plugingui/tabwidget.h b/plugingui/tabwidget.h index ff239a8..dc69776 100644 --- a/plugingui/tabwidget.h +++ b/plugingui/tabwidget.h @@ -43,18 +43,22 @@ public: //! Add new tab to the tab widget. //! \param title The title to display on the tab button. //! \param widget The widget to show in the tab. - void addTab(const std::string& title, Widget* widget); + //! \returns The TabID of the newly added tab. + TabID addTab(const std::string& title, Widget* widget); std::size_t getBarHeight() const; void setTabWidth(std::size_t width); std::size_t getTabWidth() const; + void setVisible(TabID tab_id, bool visible); + private: //! Callback for Widget::sizeChangeNotifier void sizeChanged(int width, int height); private: + void relayout(); //! Switch to the next tab if delta is > 0 or previous tab if delta is <= 0. void rotateTab(float delta); void switchTab(Widget* tabWidget); -- cgit v1.2.3