Skip to content

Conversation

@loathingKernel
Copy link
Contributor

@loathingKernel loathingKernel commented Apr 12, 2025

Adds theming for QScrollBar/QComboBox controls for the Steam Deck theme

Preview:
image

The icon file paths are injected in to the CSS string dynamically right now. I would like to move them into a QResources file but I wanted to get the ok from you before going forward with that. The QResources as far as the theme is concerned should include the QSS file along with any images it uses. The icons are modified from Font Awesome icons and I should check up on their exact license.

Generally I consider this WIP that should take some time due to availability. Feel free to comment with any concerns in the meantime though.

Edit: Regarding the license, it should be ok to use. These icons are take from the FontAwesome repository, they are caret-down and caret-up

@loathingKernel
Copy link
Contributor Author

loathingKernel commented Apr 14, 2025

I've added examples of using QResources and generating the stylesheet through qstylizer so it is more clear what kind of handling I was referring to previously. The qstylizer code is probably over-engineered (some things could just be statically defined) for this use-case but I wanted to demonstrate what is possible with it.

@loathingKernel loathingKernel marked this pull request as ready for review April 14, 2025 20:20
@DavidoTek
Copy link
Owner

Thanks!

Sorry for the late reply. I was busy and forgot to respond to this issue.

I like the style. It looks good and matches the Steam look and feel!

I've added examples of using QResources

I think that the QResources are nice in a Qt ecosystem, and the handling of icons is way cleaner. Nevertheless, I'm not sure if it is the best way in our case.
It would be fine if the output files were automatically generated by the CI pipeline and only included in the builds, but that is not the case here. I'm already not very happy with the way the translation files are handled since both the source code and the compiled .qm files are in the repository.
Since the style is defined imperatively in the stylesheet.py, wouldn't it be possible to directly import it from that file without going the route with the .qss file? I assume that the icon imports could also be handled using pkgutil, like you did in the previous version.

Edit: Regarding the license, it should be ok to use. These icons are take from the FontAwesome repository, they are caret-down and caret-up

Should be fine, we can include them in the Licensing section in the README for attribution.

@loathingKernel
Copy link
Contributor Author

loathingKernel commented Sep 17, 2025

I'm already not very happy with the way the translation files are handled since both the source code and the compiled .qm files are in the repository.

I have the same issue in Rare, but it is what it is until I get some time to figure out how to use buildtools to build them at package creation.

Since the style is defined imperatively in the stylesheet.py, wouldn't it be possible to directly import it from that file without going the route with the .qss file?

You could, but you would need to depend on qstylizer at runtime to generate the qss stylesheet string. So it's what you consider less of an issue. For the icons to work with the stylesheet tho, they need to be either absolute paths or be part of the same QResource file as the stylesheet for the url() scheme to work. So in the case of the former you do need extra manipulation to inject the paths into the stylesheet. Likely not an issue if you are generating the style at runtime, but in my opinion makes for a more complicated setup overall.

So it boils down to whether you want to include another dependency that doesn't do anything but generate the stylesheet.

@DavidoTek
Copy link
Owner

You could, but you would need to depend on qstylizer at runtime to generate the qss stylesheet string. So it's what you consider less of an issue

Okay, that's a valid point.

I'll think about a way to automate it. I don't want to introduce large changes in the build process since there are packages that I do not maintain.
On the other hand, since it is mostly confined to the steamdeck folder, it might be okay to leave it as is and just add a README that explains how to generate them. They won't be updated often.

I have the same issue in Rare, but it is what it is until I get some time to figure out how to use buildtools to build them at package creation.

I see. The simplest solution is probably to add a GitHub Action that checks for changes, rebuilds the stylesheet.qss and __init__.py, and commits the new generated files back to the repo. I don't think that makes sense for ProtonUp-Qt, since the files are not changed that often. But I will keep it in mind for other stuff, like the translation files or if the resource file is used for other stuff too.
This way, there would still be duplicate files that may run out of sync if the CI fails, but there will always be a copy of the generated file available in the repo.

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