Skip to content

[FIX] ScoringSheetViewer slider style and tooltip#7024

Merged
janezd merged 4 commits intobiolab:masterfrom
ZanMervic:bugfix/6985/scoring-sheet-viewer-slider
Apr 26, 2025
Merged

[FIX] ScoringSheetViewer slider style and tooltip#7024
janezd merged 4 commits intobiolab:masterfrom
ZanMervic:bugfix/6985/scoring-sheet-viewer-slider

Conversation

@ZanMervic
Copy link
Contributor

Issue

Fixes #6985

Description of changes
  • Changes to the slider styling to suggest the slider is not interactive.
  • Created a custom slider which ignores mouse events instead of disabling the default slider. By doing this, the tooltip should work on macOS.
Includes
  • Code changes
  • Tests
  • Documentation

@codecov
Copy link

codecov bot commented Feb 11, 2025

Codecov Report

Attention: Patch coverage is 30.00000% with 14 lines in your changes missing coverage. Please review.

Project coverage is 88.60%. Comparing base (7be875f) to head (2b517e7).
Report is 134 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #7024      +/-   ##
==========================================
+ Coverage   88.36%   88.60%   +0.24%     
==========================================
  Files         332      332              
  Lines       73345    73384      +39     
==========================================
+ Hits        64813    65025     +212     
+ Misses       8532     8359     -173     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ajdapretnar
Copy link
Contributor

I like the change visually, but the tooltip doesn't work for me. Perhaps it is not necessary, since we see the exact probability below, but I kind like tooltips in general.

@janezd janezd self-assigned this Feb 14, 2025
# Draw a simple 2px wide black rectangle as the custom handle.
painter.save()
painter.setPen(Qt.NoPen)
painter.setBrush(Qt.black)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use

painter.setBrush(QPalette().color(QPalette.WindowText))

to support dark mode.

painter.save()
painter.setPen(Qt.NoPen)
painter.setBrush(Qt.black)
painter.drawRect(QRect(handle_rect.center().x() - 1, handle_rect.y(), 4, handle_rect.height()))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This hard rectangle looks Linux-y. Perhaps change to this?

painter.drawRoundedRect(QRect(handle_rect.center().x() - 1, handle_rect.y(),
                              3, handle_rect.height()),
                        3, 3)

@janezd
Copy link
Contributor

janezd commented Mar 6, 2025

@ZanMervic, thanks for the change. Apologies that it took me so long to review this.

I made the slider a tad shorter, I think it looks nicer.

Lint failed with a complaint about accessing a private method, so I looked in. The problem is that the code didn't follow the proper Qt way for the widget to update a parent, which is by emitting a signal. I made the necessary change. Please check and -- if it's OK -- merge (or approve if you have no right to merge).

@janezd janezd force-pushed the bugfix/6985/scoring-sheet-viewer-slider branch from 3e3cd4b to 2b517e7 Compare March 6, 2025 18:04
@janezd janezd merged commit ec7b840 into biolab:master Apr 26, 2025
25 of 30 checks 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.

Scoring Sheet Viewer: slider not working

3 participants