DolphinQt: Fix the WiiPane hinting a larger than required size.

This commit is contained in:
Jordan Woyak
2025-05-16 19:31:00 -05:00
parent 5bc661aeca
commit 1e4dfc0956
2 changed files with 18 additions and 5 deletions

View File

@ -19,4 +19,18 @@ QWidget* CreateIconWarning(QWidget* parent, QStyle::StandardPixmap standard_pixm
// Similar to QWidget::adjustSize except maximum size is 9/10 of screen rather than 2/3.
void AdjustSizeWithinScreen(QWidget* widget);
// A QWidget that returns the minimumSizeHint as the primary sizeHint.
// Useful for QListWidget which hints a fairly large height even when entirely empty.
// Usage: QtUtils::MinimumSizeHintWidget<QListWidget>
template <typename Widget>
class MinimumSizeHintWidget : public Widget
{
public:
using Widget::Widget;
// Note: Some widget (e.g. QPushButton) minimumSizeHint implementations themselves use sizeHint,
// which would cause this to stack overflow.
QSize sizeHint() const override { return Widget::minimumSizeHint(); }
};
} // namespace QtUtils