GUI: Allow scaling dialog and widget sizes in constructors

The resize() function has the option to do the scaling, but
adding it to the construtor avoids having to then call resize().
Also this makes more explicit that by default the sizes are not
scaled. The reason for not scaling by default is because values
with get from the ThemeEngine are already scaled.
This commit is contained in:
Thierry Crozat 2023-03-23 21:04:50 +00:00 committed by Eugene Sandulenko
parent 77728fcf73
commit b1fcd15cad
12 changed files with 107 additions and 40 deletions

View file

@ -37,8 +37,8 @@ namespace GUI {
* ...
*/
Dialog::Dialog(int x, int y, int w, int h)
: GuiObject(x, y, w, h),
Dialog::Dialog(int x, int y, int w, int h, bool scale)
: GuiObject(x, y, w, h, scale),
_mouseWidget(nullptr), _focusedWidget(nullptr), _dragWidget(nullptr), _tickleWidget(nullptr), _visible(false),
_backgroundType(GUI::ThemeEngine::kDialogBackgroundDefault) {
// Some dialogs like LauncherDialog use internally a fixed size, even though