summaryrefslogtreecommitdiff
path: root/src/gui/widgets/tabstrip.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/widgets/tabstrip.cpp')
-rw-r--r--src/gui/widgets/tabstrip.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/gui/widgets/tabstrip.cpp b/src/gui/widgets/tabstrip.cpp
index 5dac11926..d3f334e8a 100644
--- a/src/gui/widgets/tabstrip.cpp
+++ b/src/gui/widgets/tabstrip.cpp
@@ -28,7 +28,8 @@ TabStrip::TabStrip(const Widget2 *const widget,
const std::string &group,
const int height,
const int spacing) :
- WidgetGroup(widget, group, height, spacing)
+ WidgetGroup(widget, group, height, spacing),
+ mPressFirst(true)
{
mAllowLogic = false;
}
@@ -36,18 +37,20 @@ TabStrip::TabStrip(const Widget2 *const widget,
TabStrip::TabStrip(const Widget2 *const widget,
const int height,
const int spacing) :
- WidgetGroup(widget, "", height, spacing)
+ WidgetGroup(widget, "", height, spacing),
+ mPressFirst(true)
{
mAllowLogic = false;
}
-Widget *TabStrip::createWidget(const std::string &text) const
+Widget *TabStrip::createWidget(const std::string &text,
+ const bool pressed) const
{
Button *const widget = new Button(this);
widget->setStick(true);
widget->setCaption(text);
widget->adjustSize();
- if (!mCount)
+ if ((!mCount && mPressFirst) || pressed)
widget->setPressed(true);
widget->setTag(static_cast<int>(mWidgets.size()));
return widget;