From a35ffe16cc72bd0b85a93266ceb1ba1b94fe20e9 Mon Sep 17 00:00:00 2001 From: Jim Taylor Date: Tue, 20 Feb 2018 01:25:54 -0500 Subject: [PATCH] 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. --- companion/src/modeledit/mixerslistwidget.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/companion/src/modeledit/mixerslistwidget.cpp b/companion/src/modeledit/mixerslistwidget.cpp index 79b2423c1..fcdf4d8ec 100644 --- a/companion/src/modeledit/mixerslistwidget.cpp +++ b/companion/src/modeledit/mixerslistwidget.cpp @@ -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();