Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FIX] ScoringSheetViewer slider style and tooltip #7024

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

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

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
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 24 commits behind head on master.

❌ Your patch check has failed because the patch coverage (30.00%) is below the target coverage (95.00%). You can increase the patch coverage or adjust the target coverage.

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
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