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

[Bug]: Accent Colors show as Gray on Windows with PySide 6.8.0.1 #668

Open
3 tasks done
CyanVoxel opened this issue Dec 24, 2024 · 4 comments
Open
3 tasks done

[Bug]: Accent Colors show as Gray on Windows with PySide 6.8.0.1 #668

CyanVoxel opened this issue Dec 24, 2024 · 4 comments
Labels
Priority: Medium An issue that shouldn't be be saved for last Status: Help Wanted Extra attention is needed System: Windows For Microsoft Windows Type: Bug Something isn't working as intended Type: UI/UX User interface and/or user experience

Comments

@CyanVoxel
Copy link
Member

Checklist

  • I am using an up-to-date version.
  • I have read the documentation.
  • I have searched existing issues.

TagStudio Version

main branch (v9.5.0)

Operating System & Version

Windows 10 22H2

Description

System accent colors grabbed by QPalette show as gray on Windows as of updating to PySide 6.8.0.1. The following snippet is from thumb_button.py:

self.select_color: QColor = QPalette.color(
            self.palette(),
            QPalette.ColorGroup.Active,
            QPalette.ColorRole.Accent,
        )

PySide 6.7.1 (aaea0b1)
image

PySide 6.8.0.1 (latest)
image

Note that I've only seen this occur on Windows while it seems to be functioning on macOS. Other native Qt widgets such as loading bars also seem to be grabbing the accent color correctly.

Expected Behavior

Accent/selection colors on all platforms should function as they used to before PySide 6.8.0.1.

Steps to Reproduce

  1. Open a TagStudio library on Windows (confirmed on 10, not sure about 11)
  2. Hover over an item thumbnail and observe the incorrect accent color

Logs

No response

@CyanVoxel CyanVoxel added Type: Bug Something isn't working as intended Type: UI/UX User interface and/or user experience Priority: Medium An issue that shouldn't be be saved for last System: Windows For Microsoft Windows labels Dec 24, 2024
@CyanVoxel CyanVoxel added this to the SQL Parity milestone Dec 24, 2024
@CyanVoxel CyanVoxel moved this to 🛠 Ready for Development in TagStudio Development Dec 24, 2024
@SkeleyM
Copy link
Contributor

SkeleyM commented Dec 24, 2024

id be happy to fix this

@kana800
Copy link

kana800 commented Jan 6, 2025

Hi, wanted to check this out noticed the accent color is totally different from the one shown above 😅.

image


commenting out the following snippet gave me shown the color scheme.

         pal: QPalette = app.palette()
         pal.setColor(QPalette.ColorGroup.Active,
         			 QPalette.ColorRole.Highlight, QColor('#6E4BCE'))
         pal.setColor(QPalette.ColorGroup.Normal,
         			 QPalette.ColorRole.Window, QColor('#110F1B'))
         app.setPalette(pal)

In thumb_button.py, we are using the QPalette.ColorRole.Accent.

self.hover_color: QColor = QPalette.color(
            self.palette(),
            QPalette.ColorGroup.Active,
            QPalette.ColorRole.Accent,
        )

got it working by adding the following line @CyanVoxel and doing slight adjustment mentioned in #672

        pal: QPalette = app.palette()
        pal.setColor(QPalette.ColorGroup.Active,
        			 QPalette.ColorRole.Highlight, QColor('#6E4BCE'))
+        pal.setColor(QPalette.ColorGroup.Active,
+        			 QPalette.ColorRole.Accent, QColor('#6E4BCE'))
        pal.setColor(QPalette.ColorGroup.Normal,
        			 QPalette.ColorRole.Window, QColor('#110F1B'))

without the adjustment (left is before and right is after) :

image

after the adjustment mentioned in the PR #672

        self.hover_color.setHsl(
            self.hover_color.hslHue(),
            self.hover_color.hslSaturation(),
-            min(self.hover_color.lightness() + 80, 255),
+            min(self.hover_color.lightness() + 80, 200),
            self.hover_color.alpha(),
        )

image


TagStudio Version

Operating System

  • windows 11 23H2

let me know if it works ! 👋🏽

@CyanVoxel
Copy link
Member Author

Hi, wanted to check this out noticed the accent color is totally different from the one shown above 😅.

image

The color in the screenshot from aaea0b1 is derived from my system accent color, which is why yours is different and implies that the feature is working as intended

commenting out the following snippet gave me shown the color scheme.

         pal: QPalette = app.palette()
         pal.setColor(QPalette.ColorGroup.Active,
         			 QPalette.ColorRole.Highlight, QColor('#6E4BCE'))
         pal.setColor(QPalette.ColorGroup.Normal,
         			 QPalette.ColorRole.Window, QColor('#110F1B'))
         app.setPalette(pal)

I'm a bit confused why you mention the code here, as its unrelated to the issue at hand and hasn't been active in the program for at least 9 months: d974aa7.

In thumb_button.py, we are using the QPalette.ColorRole.Accent.

self.hover_color: QColor = QPalette.color(
            self.palette(),
            QPalette.ColorGroup.Active,
            QPalette.ColorRole.Accent,
        )

Yes, QPalette.ColorRole.Accent is what has allowed us to grab the users' system accent color

got it working by adding the following line @CyanVoxel and doing slight adjustment mentioned in #672

        pal: QPalette = app.palette()
        pal.setColor(QPalette.ColorGroup.Active,
        			 QPalette.ColorRole.Highlight, QColor('#6E4BCE'))
+        pal.setColor(QPalette.ColorGroup.Active,
+        			 QPalette.ColorRole.Accent, QColor('#6E4BCE'))
        pal.setColor(QPalette.ColorGroup.Normal,
        			 QPalette.ColorRole.Window, QColor('#110F1B'))

without the adjustment (left is before and right is after) :

image

Unfortunately the old behavior (aaea0b1) up until this bug was to use the user's system accent color, not to use hardcoded values which is what that (very old) commented-out code did and what this solution suggests. This bug is also affecting the main branch, not the Alpha-v9.4 one:

TagStudio Version

main branch (v9.5.0)

Operating System & Version

Windows 10 22H2

Description

System accent colors grabbed by QPalette show as gray on Windows as of updating to PySide 6.8.0.1. The following snippet is from thumb_button.py:

@kana800
Copy link

kana800 commented Jan 7, 2025

Unfortunately the old behavior (aaea0b1) up until this bug was to use the user's system accent color, not to use hardcoded values which is what that (very old) commented-out code did and what this solution suggests.

oww okay got it ! thank you for the explanation. let me look more into this;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority: Medium An issue that shouldn't be be saved for last Status: Help Wanted Extra attention is needed System: Windows For Microsoft Windows Type: Bug Something isn't working as intended Type: UI/UX User interface and/or user experience
Projects
Status: 🛠 Ready for Development
Development

Successfully merging a pull request may close this issue.

3 participants