Fix Issue 5633 - Workaround for Linux QT Styles (Breeze, Oxygen, ?) returning bad rect width. (#5695)

* Fix Issue 5633 - Workaround for Linux QT Styles (Breeze, Oxygen, ?) returning bad rect width.
This commit is contained in:
Jim Taylor
2018-02-20 01:25:54 -05:00
committed by Max Paperno
parent 3785e24077
commit a35ffe16cc
@@ -207,6 +207,11 @@ void MixersDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option
style->drawControl(QStyle::CE_ItemViewItem, &options, painter, options.widget);
QRect textRect = style->subElementRect(QStyle::SE_ItemViewItemText, &options);
#ifdef Q_OS_LINUX
// Workaround for buggy Linux native styles (https://github.com/opentx/opentx/issues/5633)
if (options.widget && textRect.width() < options.widget->geometry().width() * 0.75f)
textRect.setWidth(options.widget->geometry().width());
#endif
QRectF clipRect = textRect.translated(-textRect.topLeft());
ctx.clip = clipRect;
painter->save();