From 0662809cd218b23c28733642147b2d20baed4141 Mon Sep 17 00:00:00 2001 From: 23rd <23rd@vivaldi.net> Date: Sun, 15 Jan 2023 06:34:23 +0300 Subject: [PATCH] Added some convenient overload methods to RpWidget. --- ui/rp_widget.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ui/rp_widget.h b/ui/rp_widget.h index f1260b9..4095c2d 100644 --- a/ui/rp_widget.h +++ b/ui/rp_widget.h @@ -54,6 +54,9 @@ public: y -= margins.top(); Base::move(style::RightToLeft() ? x : ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - Base::width()), y); } + void setGeometryToLeft(const QRect &r, int outerw = 0) { + setGeometryToLeft(r.x(), r.y(), r.width(), r.height(), outerw); + } void setGeometryToLeft(int x, int y, int w, int h, int outerw = 0) { auto margins = getMargins(); x -= margins.left(); @@ -62,6 +65,9 @@ public: h -= margins.top() - margins.bottom(); Base::setGeometry(style::RightToLeft() ? ((outerw > 0 ? outerw : Base::parentWidget()->width()) - x - w) : x, y, w, h); } + void setGeometryToRight(const QRect &r, int outerw = 0) { + setGeometryToRight(r.x(), r.y(), r.width(), r.height(), outerw); + } void setGeometryToRight(int x, int y, int w, int h, int outerw = 0) { auto margins = getMargins(); x -= margins.right();