fix(ring_progress_bar): added hover mouse effect#1031
fix(ring_progress_bar): added hover mouse effect#1031wyzula-jan wants to merge 6 commits intomainfrom
Conversation
8f1e948 to
92713a1
Compare
There was a problem hiding this comment.
Pull request overview
This pull request adds hover effects to the ring progress bar widget, including visual animations (line width and radius expansion) and informative tooltips that display ring mode, values, and device information when hovering over individual rings.
Changes:
- Added mouse tracking and hover detection for individual rings within the progress bar container
- Implemented smooth hover animations with line width and radius expansion effects
- Added dynamic tooltips showing ring configuration details (mode, value, max_value, and device/signal information for device mode)
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 9 comments.
| File | Description |
|---|---|
| bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py | Added mouse event handlers, ring detection logic at cursor position, hover state management, and tooltip building functionality |
| bec_widgets/widgets/progress/ring_progress_bar/ring.py | Implemented hover animation with QPropertyAnimation, modified paint event to render hover effects (line width and radius expansion), and added hover_progress property |
Note: The PR description references issue #123 which concerns stuck communication with BECFigure during automatic updates, which is unrelated to this hover functionality. Additionally, the PR title uses "fix" prefix, but this appears to be a new feature addition rather than a bug fix.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py
Outdated
Show resolved
Hide resolved
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
cd29650 to
32c3d77
Compare
6028210 to
a02170c
Compare
e4a9a1a to
2c14038
Compare
|
@wyzula-jan I've opened a new pull request, #1101, to work on those changes. Once the pull request is ready, I'll request review from you. |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 4 changed files in this pull request and generated 3 comments.
Comments suppressed due to low confidence (1)
bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py:374
- clear_all() closes and deleteLater()s rings but does not call ring.cleanup() (unlike remove_ring). If a ring was connected to scan/device endpoints, this can leave dispatcher subscriptions around until the ring object is GC’d, with a risk of callbacks hitting a partially-deleted widget. Call ring.cleanup() (and ideally stop hover animation) before close()/deleteLater().
self._hovered_ring = None
self._last_hover_global_pos = None
self._hover_tooltip.hide()
for ring in self.rings:
ring.close()
ring.deleteLater()
self.rings = []
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
bec_widgets/widgets/progress/ring_progress_bar/ring_progress_bar.py
Outdated
Show resolved
Hide resolved
|
@wyzula-jan I've opened a new pull request, #1102, to work on those changes. Once the pull request is ready, I'll request review from you. |
8e2705f to
4338bb7
Compare
4338bb7 to
62fde02
Compare
wakonig
left a comment
There was a problem hiding this comment.
I don't really understand the placement of _refresh_hover_tooltip. Some update methods have it, some don't, some have it even 3 times (cf. set_update)
| if refresh_tooltip: | ||
| if self.progress_container and self.progress_container.is_ring_hovered(self): | ||
| self.progress_container.refresh_hover_tooltip(self) | ||
| super().update() |
Description
Hover widget extension, ring minor improvements, hover tooltip with additional info over ring.
Type of Change
RingProgressBarhover interactions and tooltip presentationBECWidgetHow to test
RingProgressBarwidget with multiple rings with different modes and move the mouse over each ringScreenshots / GIFs (if applicable)
ring_compressed.mp4
Additional Comments
The tooltip implementation was refactored to use the shared
WidgetTooltipfromhover_widget.py, which is used for example in the BECMainWindow scan progress bar in the bottom right.