From 728abec962f993309acf3ebb1317b5f3773f18c7 Mon Sep 17 00:00:00 2001 From: Bent Bisballe Nyeng Date: Wed, 8 Feb 2017 22:22:00 +0100 Subject: UI resize refactoring part 1. --- plugingui/widget.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) (limited to 'plugingui/widget.h') diff --git a/plugingui/widget.h b/plugingui/widget.h index 03e8ab0..4ea79e9 100644 --- a/plugingui/widget.h +++ b/plugingui/widget.h @@ -54,19 +54,22 @@ public: virtual void hide(); // From LayoutItem - virtual void resize(int width, int height) override; - virtual void move(size_t x, size_t y) override; + virtual void resize(std::size_t width, std::size_t height) override; + virtual void move(int x, int y) override; virtual int x() override; virtual int y() override; - virtual size_t width() override; - virtual size_t height() override; + virtual std::size_t width() override; + virtual std::size_t height() override; // From Canvas PixelBufferAlpha& GetPixelBuffer() override; void beginPaint() override; void endPaint() override; + //! Translate x-coordinate from parent-space to window-space. virtual size_t windowX(); + + //! Translate y-coordinate from parent-space to window-space. virtual size_t windowY(); virtual bool isFocusable() { return false; } @@ -97,7 +100,8 @@ public: bool visible(); void setVisible(bool visible); - Notifier sizeChangeNotifier; // (int, width, int height) + Notifier sizeChangeNotifier; // (width, height) + Notifier positionChangeNotifier; // (x, y) protected: void repaintChildren(RepaintEvent* repaintEvent); @@ -111,10 +115,10 @@ protected: int _x{0}; int _y{0}; - size_t _width{0}; - size_t _height{0}; + std::size_t _width{0}; + std::size_t _height{0}; - bool _visible = true; + bool _visible{true}; }; } // GUI:: -- cgit v1.2.3