Skip to content

Commit

Permalink
Improve tooltipps
Browse files Browse the repository at this point in the history
Signed-off-by: chipmuenk <mail@chipmuenk.de>
  • Loading branch information
chipmuenk committed Oct 22, 2017
1 parent 4e1efb8 commit 07198bf
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 10 deletions.
17 changes: 12 additions & 5 deletions pyfda/input_widgets/amplitude_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ def _construct_UI(self):
self.cmbUnitsA = QComboBox(self)
self.cmbUnitsA.addItems(amp_units)
self.cmbUnitsA.setObjectName("cmbUnitsA")
self.cmbUnitsA.setToolTip("Set unit for amplitude specifications:\n"
"dB is attenuation (positive values)\nV and W are less than 1.")
self.cmbUnitsA.setToolTip("<span>Unit for amplitude specifications:"
" dB is attenuation (&gt; 0); levels in V and W have to be &lt; 1.</span>")

# fit size dynamically to largest element:
self.cmbUnitsA.setSizeAdjustPolicy(QComboBox.AdjustToContents)
Expand Down Expand Up @@ -164,7 +164,7 @@ def update_UI(self, new_labels = ()):
- `self.n_cur_labels`, the number of currently visible labels / qlineedit
fields
"""
state = new_labels[0]
state = new_labels[0]
new_labels = new_labels[1:]

# W_lbl = max([self.qfm.width(l) for l in new_labels]) # max. label width in pixel
Expand All @@ -176,13 +176,20 @@ def update_UI(self, new_labels = ()):
elif num_new_labels > self.n_cur_labels: # more new labels, create / show new ones
self._show_entries(num_new_labels)

tool_tipp = "Amplitude specifications for filter: "
tool_tipp_sb = "Min. attenuation resp. maximum level in stop band"
for i in range(num_new_labels):
# Update ALL labels and corresponding values
self.qlabels[i].setText(rt_label(new_labels[i]))

self.qlineedit[i].setText(str(fb.fil[0][new_labels[i]]))
self.qlineedit[i].setObjectName(new_labels[i]) # update ID
self.qlineedit[i].setToolTip("Define amplitudes positive")

if "sb" in new_labels[i].lower():
self.qlineedit[i].setToolTip("<span>" + tool_tipp + tool_tipp_sb + " (&gt; 0).</span>")
elif "pb" in new_labels[i].lower():
self.qlineedit[i].setToolTip("<span>" + tool_tipp +
"Maximum pass band ripple (&gt; 0).<span/>")
qstyle_widget(self.qlineedit[i], state)

self.n_cur_labels = num_new_labels # update number of currently visible labels
Expand Down
5 changes: 0 additions & 5 deletions pyfda/input_widgets/target_specs.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,6 @@ def _construct_UI(self):
" StopBand (SB) Frequencies are maximally attenuated</span>")
# subwidget for Amplitude Specs
self.a_specs = amplitude_specs.AmplitudeSpecs(self, title = "Amplitude")
self.a_specs.setToolTip("<span>Define Amplitude specs for filter;"
" Amplitudes in dB (positive values), Volts/Watts less than 1;"
" PassBand (PB) Amp defines ripple max in passband;"
" StopBand (SB) Amp defines min attenuation in stopband</span>")

self.a_specs.setVisible(True)
"""
LAYOUT
Expand Down

0 comments on commit 07198bf

Please sign in to comment.