BreezeStyleSheets
BreezeStyleSheets copied to clipboard
Can't find dark.qss?
Hello,
When I try to build, I get the following error:
P:\BreezeStyleSheets>python configure.py --compiled-resource breeze_resources.py
Traceback (most recent call last):
File "configure.py", line 371, in
UPDATE: I got this working by getting rid of "--compiled-resource breeze_resources.py" This worked, however the window title bar is still white. Any idea why that is?
Thanks!
For the first issue, it's possible it's a bug on my end. As for the second one, Windows does not allow you to change the Window titlebar style through Qt. The only solution is to remove it entirely, and implement your own. This is a lot of work, so I've done most of it for you. You're free to copy and paste the code with the same license as the project uses (MIT, requires attribution and reproduction of the license but allows commercial use).
An example doing so can be found here. Please note the caveats described here:
https://github.com/Alexhuszagh/BreezeStyleSheets/blob/9ade91d4da1dd0eaf885793d61f8455ca08065d3/example/titlebar.py#L98-L100
FYI: if you're on Windows, then you might be able to use platform-specific APIs (the WinAPI) to change the titlebar style, but this isn't cross-platform nor available in Qt. As far as implementing your own custom titlebar, if you ever plan on having Linux users, it's a terrible idea due to design choices in Wayland (X11 works fine).
Note you can test if your application is using Wayland or X11 via environment variables:
# Use `XDG_SESSION_TYPE`, since we can override it for X11.
IS_WAYLAND = os.environ.get('XDG_SESSION_TYPE') == 'wayland'
IS_XWAYLAND = os.environ.get('XDG_SESSION_TYPE') == 'xwayland'
IS_X11 = os.environ.get('XDG_SESSION_TYPE') == 'x11'
# We can run X11 on Wayland, but this doesn't support certain
# features like mouse grabbing, so we don't use it here.
IS_TRUE_WAYLAND = 'WAYLAND_DISPLAY' in os.environ
So if you really want to, you can have a custom titlebar for everything besides Wayland.
Closed since this is now documented, with an example provided, and the rest is platform limitations with how title bars work.