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 folder progress bar positioning in account settings on macOS #5645

Merged
merged 5 commits into from
May 8, 2023

Conversation

claucambra
Copy link
Collaborator

We draw a custom widget for the folder status in the account settings, using QStyle's various drawing methods to render the internal widgets. This works great 99% of the time, except on macOS where QMacStyle has a bug with drawing progress bars and does not respect X or Y settings in the QStyleOptionProgressBar rect QRect. This means the progress bar gets drawn out of position at the top-left of the folder view.

In cases where we are running macOS, default to drawing this progress bar with the Fusion style instead.

This PR also includes a number of code clean ups in the relevant paint function for the folder delegate

With fix:

Screenshot 2023-05-04 at 12 09 43

Before fix:

Screenshot 2023-05-04 at 12 29 38

@claucambra claucambra self-assigned this May 4, 2023
@codecov
Copy link

codecov bot commented May 4, 2023

Codecov Report

Merging #5645 (3960032) into master (5beba91) will increase coverage by 0.01%.
The diff coverage is n/a.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5645      +/-   ##
==========================================
+ Coverage   59.25%   59.26%   +0.01%     
==========================================
  Files         143      143              
  Lines       18450    18450              
==========================================
+ Hits        10932    10934       +2     
+ Misses       7518     7516       -2     

see 2 files with indirect coverage changes

claucambra added 5 commits May 8, 2023 20:04
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
… QMacStyle

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
…older settings instead of QCommonStyle

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
…legate::paint

Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
@claucambra claucambra force-pushed the bugfix/folder-progress-bar-mac branch from 9898c0f to 3960032 Compare May 8, 2023 12:04
@nextcloud-desktop-bot
Copy link

AppImage file: nextcloud-PR-5645-396003264cff659428ae89385bbf522455fc2d8b-x86_64.AppImage

To test this change/fix you can simply download above AppImage file and test it.

Please make sure to quit your existing Nextcloud app and backup your data.

@claucambra
Copy link
Collaborator Author

/backport to stable-3.8

@sonarcloud
Copy link

sonarcloud bot commented May 8, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 2 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@claucambra claucambra merged commit 9fba8df into master May 8, 2023
@claucambra claucambra deleted the bugfix/folder-progress-bar-mac branch May 8, 2023 13:16
@mgallien mgallien added this to the 3.9.0 milestone May 10, 2023
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.

5 participants