From 4011e25e40831fb4ada937e58ea616a7b654d36d Mon Sep 17 00:00:00 2001 From: AngeredZeus Date: Tue, 21 Jul 2020 08:26:25 -0400 Subject: [PATCH] UI: Fix clickable text on properties with tooltips --- UI/properties-view.cpp | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) diff --git a/UI/properties-view.cpp b/UI/properties-view.cpp index b496612bc..6e70b5962 100644 --- a/UI/properties-view.cpp +++ b/UI/properties-view.cpp @@ -1443,28 +1443,42 @@ void OBSPropertiesView::AddProperty(obs_property_t *property, return; if (obs_property_long_description(property)) { - QString lStr = "%1 "; bool lightTheme = palette().text().color().redF() < 0.5; QString file = lightTheme ? ":/res/images/help.svg" : ":/res/images/help_light.svg"; if (label) { + QString lStr = "%1 "; + label->setText(lStr.arg(label->text(), file)); label->setToolTip( obs_property_long_description(property)); } else if (type == OBS_PROPERTY_BOOL) { + + QString bStr = " "; + + const char *desc = obs_property_description(property); + QWidget *newWidget = new QWidget(); + QHBoxLayout *boxLayout = new QHBoxLayout(newWidget); boxLayout->setContentsMargins(0, 0, 0, 0); boxLayout->setAlignment(Qt::AlignLeft); + boxLayout->setSpacing(0); QCheckBox *check = qobject_cast(widget); - QLabel *help = - new QLabel(lStr.arg(check->text(), file)); + check->setText(desc); + check->setToolTip( + obs_property_long_description(property)); + + QLabel *help = new QLabel(check); + help->setText(bStr.arg(file)); help->setToolTip( obs_property_long_description(property)); - check->setText(""); + boxLayout->addWidget(check); boxLayout->addWidget(help); widget = newWidget;