mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-06-30 08:33:32 +00:00
UI: Improve macOS properties tooltip spacing workaround
QMacStyle appears to have an issue where it messes up the positions of
some widgets. The previous workaround added extra spacing to force the
icon further to the right. Forcing the widget rectangle to be used
instead of the one made by the style also fixes this, arguably in a
nicer way.
See also b760b24ff0
which does this for
checkboxes in the source tree.
This commit is contained in:
parent
7a4cb085ba
commit
298e858f63
|
@ -1640,18 +1640,15 @@ void OBSPropertiesView::AddProperty(obs_property_t *property,
|
|||
QHBoxLayout *boxLayout = new QHBoxLayout(newWidget);
|
||||
boxLayout->setContentsMargins(0, 0, 0, 0);
|
||||
boxLayout->setAlignment(Qt::AlignLeft);
|
||||
#ifdef __APPLE__
|
||||
/* TODO: This fixes the issue of tooltip not aligning
|
||||
* correcty on macOS, the root cause needs further
|
||||
* investigation. */
|
||||
boxLayout->setSpacing(10);
|
||||
#else
|
||||
boxLayout->setSpacing(0);
|
||||
#endif
|
||||
|
||||
QCheckBox *check = qobject_cast<QCheckBox *>(widget);
|
||||
check->setText(desc);
|
||||
check->setToolTip(
|
||||
obs_property_long_description(property));
|
||||
#ifdef __APPLE__
|
||||
check->setAttribute(Qt::WA_LayoutUsesWidgetRect);
|
||||
#endif
|
||||
|
||||
QLabel *help = new QLabel(check);
|
||||
help->setText(bStr.arg(file));
|
||||
|
|
Loading…
Reference in a new issue