DolphinQt: Make WrapInScrollArea and GetWrappedWidget less hacky.

This commit is contained in:
Jordan Woyak
2025-05-12 22:17:49 -05:00
parent e796e82e8c
commit 543b85a451
18 changed files with 93 additions and 82 deletions

View File

@ -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