summaryrefslogtreecommitdiff
path: root/plugingui
diff options
context:
space:
mode:
Diffstat (limited to 'plugingui')
-rw-r--r--plugingui/tabwidget.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugingui/tabwidget.cc b/plugingui/tabwidget.cc
index 6988d39..10dd996 100644
--- a/plugingui/tabwidget.cc
+++ b/plugingui/tabwidget.cc
@@ -54,7 +54,12 @@ void TabWidget::switchTab(Widget* tabWidget)
void TabWidget::sizeChanged(int width, int height)
{
std::size_t pos = 0;
- std::size_t buttonWidth = width / buttons.size();
+ std::size_t buttonWidth = 1;
+ if(buttons.size() > 0)
+ {
+ buttonWidth = width / buttons.size();
+ }
+
for(auto& button : buttons)
{
button.resize(buttonWidth, 40);