From 82d5de34a53ea92bfb7995de9ed445f3ecd0bcb4 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Mon, 2 Dec 2019 16:04:10 +0100 Subject: [PATCH] New helper Window::setWindowCentered() --- radio/src/thirdparty/libopenui/src/window.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/radio/src/thirdparty/libopenui/src/window.h b/radio/src/thirdparty/libopenui/src/window.h index b1b6e892f..be6801acf 100644 --- a/radio/src/thirdparty/libopenui/src/window.h +++ b/radio/src/thirdparty/libopenui/src/window.h @@ -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;