mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-06-11 16:49:28 +02:00
DolphinQt: Fix ElidedButton (MappingButton) from growing with long text.
This commit is contained in:
@ -27,6 +27,14 @@ void ElidedButton::setElideMode(Qt::TextElideMode elide_mode)
|
||||
repaint();
|
||||
}
|
||||
|
||||
QSize ElidedButton::sizeHint() const
|
||||
{
|
||||
// Long text produces big sizeHints which is throwing layouts off
|
||||
// even when setting fixed sizes. This seems like a Qt layout bug.
|
||||
// Let's always return the sizeHint of an empty button to work around this.
|
||||
return QPushButton(parentWidget()).sizeHint();
|
||||
}
|
||||
|
||||
void ElidedButton::paintEvent(QPaintEvent* event)
|
||||
{
|
||||
QStyleOptionButton option;
|
||||
|
Reference in New Issue
Block a user