Added some convenient overload methods to RpWidget.

This commit is contained in:
23rd 2023-01-15 06:34:23 +03:00
parent 2404225e09
commit 0662809cd2

View file

@ -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();