diff options
author | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-02-08 22:22:00 +0100 |
---|---|---|
committer | Bent Bisballe Nyeng <deva@aasimon.org> | 2017-02-08 22:22:00 +0100 |
commit | 728abec962f993309acf3ebb1317b5f3773f18c7 (patch) | |
tree | ab4e22fd914681fa42babfcba184a932956c9667 /plugingui/widget.cc | |
parent | f762a1fbf4ccf565953855695ddd0bf60b34bf8e (diff) |
UI resize refactoring part 1.
Diffstat (limited to 'plugingui/widget.cc')
-rw-r--r-- | plugingui/widget.cc | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/plugingui/widget.cc b/plugingui/widget.cc index 476746e..9b8b173 100644 --- a/plugingui/widget.cc +++ b/plugingui/widget.cc @@ -41,9 +41,6 @@ Widget::Widget(Widget* parent) parent->addChild(this); _window = parent->window(); } - - _width = _height = 0; - _visible = true; } Widget::~Widget() @@ -67,7 +64,11 @@ void Widget::hide() void Widget::setVisible(bool visible) { _visible = visible; - repaintEvent(nullptr); + + if(visible) + { + repaintEvent(nullptr); + } } bool Widget::visible() @@ -112,10 +113,10 @@ void Widget::reparent(Widget* parent) this->parent = parent; } -void Widget::resize(int width, int height) +void Widget::resize(std::size_t width, std::size_t height) { if((width < 1) || (height < 1) || - (((size_t)width == _width) && ((size_t)height == _height))) + ((width == _width) && (height == _height))) { return; } @@ -127,10 +128,11 @@ void Widget::resize(int width, int height) sizeChangeNotifier(width, height); } -void Widget::move(size_t x, size_t y) +void Widget::move(int x, int y) { _x = x; _y = y; + positionChangeNotifier(x, y); } int Widget::x() @@ -143,12 +145,12 @@ int Widget::y() return _y; } -size_t Widget::width() +std::size_t Widget::width() { return _width; } -size_t Widget::height() +std::size_t Widget::height() { return _height; } |