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

qt: add adwaita platform theme #5156

Merged
merged 3 commits into from
Apr 18, 2024

Conversation

tschai-yim
Copy link
Contributor

@tschai-yim tschai-yim commented Mar 18, 2024

Description

This PR adds adwaita as an option to qt.platformTheme fixing #4702 and also NixOS/nixpkgs#295345 (the gnome option breaks some Qt6 tray applications). It also extends the configuraton interface to match qt.style which has a name and package sub-option for edge cases.

Checklist

  • Change is backwards compatible.

  • Code formatted with ./format.

  • Code tested through nix-shell --pure tests -A run.all or nix develop --ignore-environment .#all using Flakes.

  • Test cases updated/added. See example.

  • Commit messages are formatted like

    {component}: {description}
    
    {long description}
    

    See CONTRIBUTING for more information and recent commit messages for examples.

  • If this PR adds a new module

    • Added myself as module maintainer. See example.

Maintainer CC

@rycee @thiagokokada

@thiagokokada
Copy link
Contributor

It also extends the configuraton interface to match qt.style which has a name and package sub-option for edge cases.

One reason I did not do this before is because those are all breaking changes, and there is no way to do this in a way that we could inform the users (e.g.: mkRenamedOption wouldn't work here).

So I am not sure about those changes. This will probably generate difficult to debug errors for the users.

@tschai-yim tschai-yim force-pushed the feat/qt-adwaita-platform-theme branch from 303beb4 to 221e2e3 Compare March 19, 2024 07:42
@tschai-yim
Copy link
Contributor Author

Added backwards compatibility with the following warning:

$ nix develop --ignore-environment .#qt-platform-theme-gnome
trace: warning: The option `qt.platformTheme` has been renamed to `qt.platformTheme.name`.
trace: warning: The value `gnome` for option `qt.platformTheme` is deprecated. Use `adwaita` instead.
bash: warning: setlocale: LC_NUMERIC: cannot change locale (de_CH.UTF-8): No such file or directory
bash: warning: setlocale: LC_TIME: cannot change locale (de_CH.UTF-8): No such file or directory
qt-platform-theme-gnome: OK

I think that should be enough for users to know what to do.

@tschai-yim tschai-yim changed the title [WIP] qt: add adwaita platform theme qt: add adwaita platform theme Mar 19, 2024
Copy link
Contributor

@thiagokokada thiagokokada left a comment

Choose a reason for hiding this comment

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

LGTM, thanks for the backwards compatibility changes.

@tschai-yim tschai-yim force-pushed the feat/qt-adwaita-platform-theme branch 3 times, most recently from 21eee62 to 7aab777 Compare March 20, 2024 07:41
modules/misc/qt.nix Outdated Show resolved Hide resolved
modules/misc/qt.nix Outdated Show resolved Hide resolved
@tschai-yim
Copy link
Contributor Author

@rycee @andresilva your comments should be resolved. You can rereview the code.

tschai-yim and others added 2 commits April 18, 2024 23:25
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
@rycee rycee force-pushed the feat/qt-adwaita-platform-theme branch from fd612a8 to 7579929 Compare April 18, 2024 21:26
@rycee rycee force-pushed the feat/qt-adwaita-platform-theme branch from 7579929 to 54e35e0 Compare April 18, 2024 21:29
@rycee rycee merged commit ff1c364 into nix-community:master Apr 18, 2024
3 checks passed
@rycee
Copy link
Member

rycee commented Apr 18, 2024

Thanks! Merged to master now 🙂

@tschai-yim tschai-yim deleted the feat/qt-adwaita-platform-theme branch April 19, 2024 16:20
@oxalica
Copy link
Contributor

oxalica commented Apr 21, 2024

It seems my QT theme breaks after the update, and it's mixing the light theme and dark theme together. I guess this PR may be relevant. Either using the original qt.platformTheme = "gnome" or the new qt.platformTheme.name = "adwaita"; has the same visual effect as screenshot below. Both dolphin from QT5 and QT6 suffer the visual issue. I'm not sure if my setting is the correct way to use Breeze-dark for QT apps.

The items are interleaving dark and light theme. (The grey box is just for redacted texts.)

image

My previously working configuration is here.

@Birdy2014
Copy link

The README of QAdwaitaDecorations says that it is a "Qt decoration plugin", not a platform theme and that it should be applied by setting the QT_WAYLAND_DECORATION environment variable.

I don't know much about Qt, but it seems to me like it doesn't make much sense to try to set QAdwaitaDecorations as a platform theme.

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.

6 participants