Skip to content

Conversation

@Json-To-String
Copy link

This adds runmanager gui functionality to ensure PySide6 uses the correct palette if the user sets their OS theme to be light or dark.

Still to do is to ensure the highlight is sensible (Since PySide6 interacts oddly with the OS highlight and accents) and also to ensure the buttons in the top right have the correct palette applied.
image

@Json-To-String
Copy link
Author

Sadly the folder buttons looked decent on linux but awful on windows, back to the drawing board I suppose.

@Json-To-String
Copy link
Author

Potentially helpful find, in pyside6-designer I inspected the palette and found a few more options than the qt docs lead me to believe were available:
image

There's also a way to save custom palettes, so this could be useful for later when making custom themes.

Copy link
Contributor

@dihm dihm left a comment

Choose a reason for hiding this comment

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

Few changes, and I'd like to hammer out the highlight situation a little more.

Comment on lines 688 to 689
else:
print(f"Unable to get color palette from os, got {check_if_light_or_dark()}")
Copy link
Contributor

Choose a reason for hiding this comment

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

This branch is no longer needed.

if QT_ENV.lower() == 'pyqt5':
return "light"
style_hints = QtGui.QGuiApplication.styleHints()
if style_hints.colorScheme() == Qt.ColorScheme.Dark:
Copy link
Contributor

Choose a reason for hiding this comment

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

A minor style thing, but could we change this call to QtCore.Qt.ColorScheme.Dark? Then we don't need another distinct import for just this line and the call matches usage in other places.

Copy link
Author

@Json-To-String Json-To-String Dec 11, 2025

Choose a reason for hiding this comment

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

Oh yes that's the more pythonic way

Edit: I realize I was thinking about something else nevermind that but the suggestion is still good

)
from labscript_utils.qtwidgets.outputbox import OutputBox
import qtutils.icons
from qtutils.qt import QT_ENV
Copy link
Contributor

Choose a reason for hiding this comment

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

Lets merge this import into the import on line 49.

Comment on lines 378 to 379
p.color(QtGui.QPalette.Highlight)
)
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure I'm sold on this change. If we are going to replace the custom highlight, we should drop it everywhere. But I'm honestly slightly more inclined to keep the custom highlight color usage here. Let's workshop it some more...

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.

2 participants