Add missing qt modules (#4094)

* qt: add "qtct" to qt.platformTheme

This allows usage of qt5ct/qt6ct tool to configure Qt theme/icons/fonts
in non-KDE platforms.

* qt: add missing relatedPackages for qt.platformTheme = "kde"

* qt: add "kvantum" for qt.styles.name
This commit is contained in:
Thiago Kenji Okada 2023-06-15 14:06:07 +00:00 committed by GitHub
parent e0034971f9
commit d214b93ee3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,8 @@ let
adwaita-highcontrastinverse = adwaita-qt;
breeze = libsForQt5.breeze-qt5;
kvantum = libsForQt5.qtstyleplugin-kvantum;
};
in {
@ -38,11 +40,17 @@ in {
enable = mkEnableOption "Qt 4 and 5 configuration";
platformTheme = mkOption {
type = types.nullOr (types.enum [ "gtk" "gnome" "kde" ]);
type = types.nullOr (types.enum [ "gtk" "gnome" "qtct" "kde" ]);
default = null;
example = "gnome";
relatedPackages =
[ "qgnomeplatform" [ "libsForQt5" "qtstyleplugins" ] ];
relatedPackages = [
"qgnomeplatform"
[ "libsForQt5" "qtstyleplugins" ]
[ "libsForQt5" "qt5ct" ]
[ "qt6Packages" "qt6ct" ]
[ "libsForQt5" "plasma-integration" ]
[ "libsForQt5" "systemsettings" ]
];
description = ''
Platform theme to use for Qt applications.</para>
<para>The options are
@ -59,6 +67,14 @@ in {
<link xlink:href="https://github.com/FedoraQt/QGnomePlatform">qgnomeplatform</link>
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>qtct</literal></term>
<listitem><para>Use Qt style set using
<link xlink:href="https://github.com/desktop-app/qt5ct">qt5ct</link>
and
<link xlink:href="https://github.com/trialuser02/qt6ct">qt6ct</link>
applications</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>kde</literal></term>
<listitem><para>Use Qt settings from Plasma</para></listitem>
@ -72,7 +88,12 @@ in {
type = types.nullOr types.str;
default = null;
example = "adwaita-dark";
relatedPackages = [ "adwaita-qt" [ "libsForQt5" "qtstyleplugins" ] ];
relatedPackages = [
"adwaita-qt"
"breeze-qt5"
[ "libsForQt5" "qtstyleplugins" ]
[ "libsForQt5" "qtstyleplugin-kvantum" ]
];
description = ''
Style to use for Qt5 applications. Case-insensitive.
</para>
@ -105,6 +126,12 @@ in {
<link xlink:href="https://github.com/qt/qtstyleplugins">qtstyleplugins</link>
</para></listitem>
</varlistentry>
<varlistentry>
<term><literal>kvantum</literal></term>
<listitem><para>Use styles from
<link xlink:href="https://github.com/tsujan/Kvantum">kvantum</link>
</para></listitem>
</varlistentry>
</variablelist>
'';
};
@ -137,15 +164,22 @@ in {
# Necessary because home.sessionVariables doesn't support mkIf
home.sessionVariables = filterAttrs (n: v: v != null) {
QT_QPA_PLATFORMTHEME =
if cfg.platformTheme == "gtk" then "gtk2" else cfg.platformTheme;
QT_QPA_PLATFORMTHEME = if cfg.platformTheme == "gtk" then
"gtk2"
else if cfg.platformTheme == "qtct" then
"qt5ct"
else
cfg.platformTheme;
QT_STYLE_OVERRIDE = cfg.style.name;
};
home.packages = if cfg.platformTheme == "gnome" then
[ pkgs.qgnomeplatform ]
++ lib.optionals (cfg.style.package != null) [ cfg.style.package ]
else if cfg.platformTheme == "kde" then [
else if cfg.platformTheme == "qtct" then [
pkgs.libsForQt5.qt5ct
pkgs.qt6Packages.qt6ct
] else if cfg.platformTheme == "kde" then [
pkgs.libsForQt5.plasma-integration
pkgs.libsForQt5.systemsettings
] else