diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-07-20 22:10:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-07-20 22:10:07 +0300 |
commit | 2c176c9f29375ee359eca2b204489a48c1ac9e4e (patch) | |
tree | 9d7a3267a4737d5eaac45907fc3c95108c59b6d2 /src/gui/widgets | |
parent | 9523ac746bb27a7868d50acee0b99d14724a7f12 (diff) | |
download | manaplus-2c176c9f29375ee359eca2b204489a48c1ac9e4e.tar.gz manaplus-2c176c9f29375ee359eca2b204489a48c1ac9e4e.tar.bz2 manaplus-2c176c9f29375ee359eca2b204489a48c1ac9e4e.tar.xz manaplus-2c176c9f29375ee359eca2b204489a48c1ac9e4e.zip |
Into staticbrowserbox allow add separators without duplication.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r-- | src/gui/widgets/staticbrowserbox.cpp | 13 | ||||
-rw-r--r-- | src/gui/widgets/staticbrowserbox.h | 3 |
2 files changed, 15 insertions, 1 deletions
diff --git a/src/gui/widgets/staticbrowserbox.cpp b/src/gui/widgets/staticbrowserbox.cpp index 5999b2adf..8b3106b24 100644 --- a/src/gui/widgets/staticbrowserbox.cpp +++ b/src/gui/widgets/staticbrowserbox.cpp @@ -84,7 +84,8 @@ StaticBrowserBox::StaticBrowserBox(const Widget2 *const widget, mProcessVars(false), mEnableImages(false), mEnableKeys(false), - mEnableTabs(false) + mEnableTabs(false), + mSeparator(false) { mAllowLogic = false; @@ -156,6 +157,14 @@ void StaticBrowserBox::setLinkHandler(LinkHandler* linkHandler) mLinkHandler = linkHandler; } +void StaticBrowserBox::addSeparator(const std::string &row) +{ + if (mSeparator) + return; + addRow(row, false); + mSeparator = true; +} + void StaticBrowserBox::addRow(const std::string &row, const bool atTop) { @@ -168,6 +177,8 @@ void StaticBrowserBox::addRow(const std::string &row, if (getWidth() < 0) return; + mSeparator = false; + if (mProcessVars) { BrowserBoxTools::replaceVars(tmp); diff --git a/src/gui/widgets/staticbrowserbox.h b/src/gui/widgets/staticbrowserbox.h index 93d05049f..ff5862577 100644 --- a/src/gui/widgets/staticbrowserbox.h +++ b/src/gui/widgets/staticbrowserbox.h @@ -72,6 +72,8 @@ class StaticBrowserBox final : public Widget, void setOpaque(Opaque opaque) { mOpaque = opaque; } + void addSeparator(const std::string &row); + /** * Adds a text row to the browser. */ @@ -183,6 +185,7 @@ class StaticBrowserBox final : public Widget, bool mEnableImages; bool mEnableKeys; bool mEnableTabs; + bool mSeparator; static ImageSet *mEmotes; static int mInstances; |