diff options
Diffstat (limited to 'src/widget_type.h')
-rw-r--r-- | src/widget_type.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/widget_type.h b/src/widget_type.h index 4b49741bb..888d9052d 100644 --- a/src/widget_type.h +++ b/src/widget_type.h @@ -172,6 +172,9 @@ public: this->padding_left = left; }; + inline uint GetHorizontalStepSize() const; + inline uint GetVerticalStepSize() const; + WidgetType type; ///< Type of the widget / nested widget. bool fill_x; ///< Allow horizontal filling from initial size. bool fill_y; ///< Allow vertical filling from initial size. @@ -195,6 +198,18 @@ public: uint8 padding_left; ///< Paddings added to the left of the widget. Managed by parent container widget. }; +/** Get the horizontal sizing step. */ +inline uint NWidgetBase::GetHorizontalStepSize() const +{ + return this->fill_x ? 1 : 0; +} + +/** Get the vertical sizing step. */ +inline uint NWidgetBase::GetVerticalStepSize() const +{ + return this->fill_y ? 1 : 0; +} + /** Base class for a resizable nested widget. * @ingroup NestedWidgets */ class NWidgetResizeBase : public NWidgetBase { |