New helper Window::setWindowCentered()

This commit is contained in:
Bertrand Songis
2019-12-02 16:04:10 +01:00
parent 366ac31707
commit 82d5de34a5
+6
View File
@@ -156,6 +156,12 @@ class Window {
invalidate();
}
void setWindowCentered()
{
rect.x = (parent->width() - width()) / 2;
rect.y = (parent->height() - height()) / 2;
}
void setHeight(coord_t value)
{
rect.h = value;