summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/widgets/widget.cpp20
-rw-r--r--src/gui/widgets/widget.h5
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