From 36e98b942ac2606de4609744e0cb3e561264b763 Mon Sep 17 00:00:00 2001 From: falkTX Date: Wed, 30 Oct 2019 08:02:53 +0100 Subject: [PATCH] Set parameter tooltip based on lv2 control comment --- source/frontend/carla_widgets.py | 4 ++++ source/frontend/widgets/paramspinbox.py | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/source/frontend/carla_widgets.py b/source/frontend/carla_widgets.py index f6883634d..21757bc86 100755 --- a/source/frontend/carla_widgets.py +++ b/source/frontend/carla_widgets.py @@ -252,6 +252,10 @@ class PluginParameter(QWidget): self.ui.widget.setStepLarge(pInfo['stepLarge']) self.ui.widget.setScalePoints(pInfo['scalePoints'], bool(pHints & PARAMETER_USES_SCALEPOINTS)) + if pInfo['comment']: + self.ui.label.setToolTip(pInfo['comment']) + self.ui.widget.setToolTip(pInfo['comment']) + if pType == PARAMETER_INPUT: if not pHints & PARAMETER_IS_ENABLED: self.ui.label.setEnabled(False) diff --git a/source/frontend/widgets/paramspinbox.py b/source/frontend/widgets/paramspinbox.py index 114600e66..2ec9d7df8 100644 --- a/source/frontend/widgets/paramspinbox.py +++ b/source/frontend/widgets/paramspinbox.py @@ -441,6 +441,10 @@ class ParamSpinBox(QAbstractSpinBox): self.fBox.currentIndexChanged['QString'].connect(self.slot_comboBoxIndexChanged) + def setToolTip(self, text): + self.fBar.setToolTip(text) + QAbstractSpinBox.setToolTip(self, text) + def stepBy(self, steps): if steps == 0 or self.fValue is None: return