mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
DolphinQt: Make WrapInScrollArea and GetWrappedWidget less hacky.
This commit is contained in:
@ -6,6 +6,7 @@
|
||||
#include <QDateTimeEdit>
|
||||
#include <QHBoxLayout>
|
||||
#include <QLabel>
|
||||
#include <QScreen>
|
||||
|
||||
namespace QtUtils
|
||||
{
|
||||
@ -35,4 +36,13 @@ QWidget* CreateIconWarning(QWidget* parent, QStyle::StandardPixmap standard_pixm
|
||||
return widget;
|
||||
}
|
||||
|
||||
void AdjustSizeWithinScreen(QWidget* widget)
|
||||
{
|
||||
const auto screen_size = widget->screen()->availableSize();
|
||||
|
||||
const auto adj_screen_size = screen_size * 9 / 10;
|
||||
|
||||
widget->resize(widget->sizeHint().boundedTo(adj_screen_size));
|
||||
}
|
||||
|
||||
} // namespace QtUtils
|
||||
|
Reference in New Issue
Block a user