diff options
author | Andrei Karas <akaras@inbox.ru> | 2016-03-28 18:16:53 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2016-03-28 18:16:53 +0300 |
commit | 195315b65cfb8e74bf09ff416f69e80c50a01f74 (patch) | |
tree | 4bae932d7120e699205a6f9bc34502ab978b7ff6 | |
parent | 53e0578322818441802a424ee6401971ee289508 (diff) | |
download | plus-195315b65cfb8e74bf09ff416f69e80c50a01f74.tar.gz plus-195315b65cfb8e74bf09ff416f69e80c50a01f74.tar.bz2 plus-195315b65cfb8e74bf09ff416f69e80c50a01f74.tar.xz plus-195315b65cfb8e74bf09ff416f69e80c50a01f74.zip |
Rename static widgets collections in Widget.
-rw-r--r-- | src/gui/widgets/widget.cpp | 20 | ||||
-rw-r--r-- | src/gui/widgets/widget.h | 5 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp index f2f112c61..986d97d99 100644 --- a/src/gui/widgets/widget.cpp +++ b/src/gui/widgets/widget.cpp @@ -76,8 +76,8 @@ #include "debug.h" Font* Widget::mGlobalFont = nullptr; -std::list<Widget*> Widget::mWidgets; -std::set<Widget*> Widget::mWidgetsSet; +std::list<Widget*> Widget::mAllWidgets; +std::set<Widget*> Widget::mAllWidgetsSet; Widget::Widget(const Widget2 *const widget) : Widget2(widget), @@ -107,8 +107,8 @@ Widget::Widget(const Widget2 *const widget) : mMouseConsume(true), mRedraw(true) { - mWidgets.push_back(this); - mWidgetsSet.insert(this); + mAllWidgets.push_back(this); + mAllWidgetsSet.insert(this); } Widget::~Widget() @@ -121,8 +121,8 @@ Widget::~Widget() setFocusHandler(nullptr); - mWidgets.remove(this); - mWidgetsSet.erase(this); + mAllWidgets.remove(this); + mAllWidgetsSet.erase(this); } void Widget::setWidth(const int width) @@ -334,7 +334,7 @@ void Widget::setGlobalFont(Font *const font) { mGlobalFont = font; - FOR_EACH (std::list<Widget*>::const_iterator, iter, mWidgets) + FOR_EACH (std::list<Widget*>::const_iterator, iter, mAllWidgets) { if (!(*iter)->mCurrentFont) (*iter)->fontChanged(); @@ -349,14 +349,14 @@ void Widget::setFont(Font *const font) void Widget::distributeWindowResizeEvent() { - FOR_EACH (std::list<Widget*>::const_iterator, iter, mWidgets) + FOR_EACH (std::list<Widget*>::const_iterator, iter, mAllWidgets) (*iter)->windowResized(); } bool Widget::widgetExists(const Widget *const widget) { - return mWidgetsSet.find(const_cast<Widget*>(widget)) - != mWidgetsSet.end(); + return mAllWidgetsSet.find(const_cast<Widget*>(widget)) + != mAllWidgetsSet.end(); } void Widget::setSize(const int width, const int height) diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h index d4b85e4b8..707b4dfb9 100644 --- a/src/gui/widgets/widget.h +++ b/src/gui/widgets/widget.h @@ -1250,12 +1250,13 @@ class Widget notfinal : public Widget2 */ static Font* mGlobalFont; + private: /** * Holds a list of all instances of widgets. */ - static std::list<Widget*> mWidgets; + static std::list<Widget*> mAllWidgets; - static std::set<Widget*> mWidgetsSet; + static std::set<Widget*> mAllWidgetsSet; }; #endif // GUI_WIDGETS_WIDGET_H |