diff options
author | Andrei Karas <akaras@inbox.ru> | 2015-01-05 15:47:31 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2015-01-05 15:47:31 +0300 |
commit | 5aa5429c62096034769ffdaef92a0fcb5db08301 (patch) | |
tree | 15fb060f619c30c4e7349e2d18f3cf6cfba05928 /src/gui/widgets/tabstrip.cpp | |
parent | ad3a223908a77d42ee97ef28b598e3c831bee7d1 (diff) | |
download | manaplus-5aa5429c62096034769ffdaef92a0fcb5db08301.tar.gz manaplus-5aa5429c62096034769ffdaef92a0fcb5db08301.tar.bz2 manaplus-5aa5429c62096034769ffdaef92a0fcb5db08301.tar.xz manaplus-5aa5429c62096034769ffdaef92a0fcb5db08301.zip |
Allow set pressed item in widgetgroup and child objects.
Diffstat (limited to 'src/gui/widgets/tabstrip.cpp')
-rw-r--r-- | src/gui/widgets/tabstrip.cpp | 11 |
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; |