summaryrefslogtreecommitdiff
path: root/src/gui/widgets
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-04-06 12:21:38 +0300
committerAndrei Karas <akaras@inbox.ru>2014-04-06 12:21:38 +0300
commit2a4363ec9c80eafae21835c6c6fe92d7c10678ce (patch)
tree16d92581589e1c6554b667f49308bd10840887aa /src/gui/widgets
parent20ad155838f202584cb261ff8a33fd458a04d83f (diff)
downloadplus-2a4363ec9c80eafae21835c6c6fe92d7c10678ce.tar.gz
plus-2a4363ec9c80eafae21835c6c6fe92d7c10678ce.tar.bz2
plus-2a4363ec9c80eafae21835c6c6fe92d7c10678ce.tar.xz
plus-2a4363ec9c80eafae21835c6c6fe92d7c10678ce.zip
Add to widgets resize event handler.
In this handler set redraw flag.
Diffstat (limited to 'src/gui/widgets')
-rw-r--r--src/gui/widgets/widget.cpp11
-rw-r--r--src/gui/widgets/widget.h4
2 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/widgets/widget.cpp b/src/gui/widgets/widget.cpp
index 5a51a2012..43c8df92f 100644
--- a/src/gui/widgets/widget.cpp
+++ b/src/gui/widgets/widget.cpp
@@ -351,6 +351,12 @@ void Widget::setFont(Font *const font)
fontChanged();
}
+void Widget::distributeWindowResizeEvent()
+{
+ FOR_EACH (std::list<Widget*>::const_iterator, iter, mWidgets)
+ (*iter)->windowResized();
+}
+
bool Widget::widgetExists(const Widget* widget)
{
return mWidgetsSet.find(const_cast<Widget*>(widget))
@@ -506,3 +512,8 @@ void Widget::showPart(const Rect &rectangle)
if (mParent)
mParent->showWidgetPart(this, rectangle);
}
+
+void Widget::windowResized()
+{
+ mRedraw = true;
+}
diff --git a/src/gui/widgets/widget.h b/src/gui/widgets/widget.h
index 46245ea2b..f3e2fdb66 100644
--- a/src/gui/widgets/widget.h
+++ b/src/gui/widgets/widget.h
@@ -1021,6 +1021,10 @@ class Widget : public Widget2
void setRedraw(const bool b)
{ mRedraw = b; }
+ static void distributeWindowResizeEvent();
+
+ void windowResized();
+
protected:
/**
* Distributes an action event to all action listeners