mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-08-05 15:48:51 +00:00
Qt: Various layout fixes
This commit is contained in:
parent
7465906a0f
commit
1b06e66f1d
5 changed files with 21 additions and 17 deletions
|
@ -10,7 +10,8 @@
|
|||
#include <QVBoxLayout>
|
||||
#include <QWidget>
|
||||
|
||||
QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margin)
|
||||
QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margin_width,
|
||||
int margin_height)
|
||||
{
|
||||
auto* scroll = new QScrollArea;
|
||||
scroll->setWidget(wrapped_widget);
|
||||
|
@ -20,8 +21,9 @@ QWidget* GetWrappedWidget(QWidget* wrapped_widget, QWidget* to_resize, int margi
|
|||
if (to_resize != nullptr)
|
||||
{
|
||||
// For some reason width() is bigger than it needs to be.
|
||||
int recommended_width = wrapped_widget->width() * 0.9;
|
||||
int recommended_height = wrapped_widget->height() + margin;
|
||||
auto min_size = wrapped_widget->minimumSizeHint();
|
||||
int recommended_width = min_size.width() + margin_width;
|
||||
int recommended_height = min_size.height() + margin_height;
|
||||
|
||||
to_resize->resize(std::max(recommended_width, to_resize->width()),
|
||||
std::max(recommended_height, to_resize->height()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue