Skip to content

fix: show the full slider tooltip when hovering its title, not just the groove - #770

Merged
marcinz606 merged 1 commit into
mainfrom
fix/slider-label-tooltips
Aug 7, 2026
Merged

fix: show the full slider tooltip when hovering its title, not just the groove#770
marcinz606 merged 1 commit into
mainfrom
fix/slider-label-tooltips

Conversation

@marcinz606

Copy link
Copy Markdown
Owner

Problem

Every sidebar slider is a CompactSlider: a container QWidget holding a title QLabel, an edited dot, a spin box and the groove. The explanatory tooltips (plus shortcut key chips) are set on the container, mostly from ControlsPanel.apply_shortcut_tooltips().

Qt propagates a tooltip from a child to its parent only when the child has none of its own. CompactSlider.__init__ gave the label its own tooltip:

self.label.setToolTip(f"{label} (double-click to reset)")

so hovering the groove surfaced the rich text, but hovering the title only repeated the control name. That was the only place in the slider stack that tooltipped a label.

Fix

  • wrap_tooltip() gains an optional footer — trusted markup appended inside the <qt> document, so callers adding a boilerplate line don't re-implement its escape-vs-passthrough rule. Existing single-argument callers are unaffected.
  • BaseSlider.setToolTip appends a Double-click to reset footer; CompactSlider.setToolTip mirrors the wrapped result onto the label, so both halves are identical. toolTip() returns the already-wrapped string, so the footer is never appended twice.
  • Sliders that never get an explanatory tooltip now show <name> + hint on both halves — previously the groove showed nothing at all for those.
  • The hint uses THEME.text_secondary, not text_muted: #555 on the #161616 tooltip background is ~2.4:1.

Also fixes the inverse case in export_settings_form.py, where four sliders tooltipped .label directly and left the container bare, so their groove had no tooltip.

Rendered result (prose, right-floated key chips, hint line):

Overall print density — simulates enlarger
exposure time. Lower = brighter, higher = darker
                                       [Q] & [A]
Double-click to reset

Not covered

clone_slider still doesn't copy src.toolTip(), so Favourites mirrors show only name + hint. Pre-existing and unchanged here; a correct fix needs the raw pre-wrap text stashed on the source and re-copied on every rebind.

Test plan

  • New tests/test_slider_tooltips.py: label == container, hint present exactly once, chip <table> survives unescaped and precedes the hint, plain < still escaped, export-form containers tooltipped.
  • make all green — ruff, ty, 3475 passed / 5 skipped.
  • Tooltip HTML rendered offscreen through QTextDocument to confirm layout and that no tags leak as literal text.

…he groove

A CompactSlider's title QLabel carried its own tooltip ("<name> (double-click
to reset)"), and Qt only propagates a tooltip to the parent when the child has
none — so the explanatory text set on the container was unreachable from the
label. Mirror the container's tooltip onto the label, with a "Double-click to
reset" footer appended to both halves so the gesture stays advertised.

wrap_tooltip() grows an optional footer argument, appended inside the <qt>
document, so callers don't re-implement its escape-vs-passthrough rule.

Also fixes the inverse case in the export form, where four sliders tooltipped
.label directly and left the groove with no tooltip at all.
@marcinz606
marcinz606 merged commit ee9e402 into main Aug 7, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant