From 64c9af09914472c6a9eeb495cd790f7c325b194c Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Sun, 4 Apr 2021 10:34:37 +0200 Subject: Add: NWidgetBase::GetCurrentRect function --- src/widget_type.h | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/widget_type.h') diff --git a/src/widget_type.h b/src/widget_type.h index c5083c6c5..1692ef226 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -158,6 +158,16 @@ public: virtual void Draw(const Window *w) = 0; virtual void SetDirty(const Window *w) const; + Rect GetCurrentRect() const + { + Rect r; + r.left = this->pos_x; + r.top = this->pos_y; + r.right = this->pos_x + this->current_x; + r.bottom = this->pos_y + this->current_y; + return r; + } + WidgetType type; ///< Type of the widget / nested widget. uint fill_x; ///< Horizontal fill stepsize (from initial size, \c 0 means not resizable). uint fill_y; ///< Vertical fill stepsize (from initial size, \c 0 means not resizable). -- cgit v1.2.3-54-g00ecf