Merge pull request #34526 from ttuegel/bugfix/plasma-integration/font-style

plasma-integration: Fix font style name bug with Qt >= 5.8
This commit is contained in:
Thomas Tuegel 2018-02-04 17:41:50 -06:00 committed by GitHub
commit 4688dd0cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 44 additions and 1 deletions

View File

@ -47,6 +47,18 @@ in
${getBin config.hardware.pulseaudio.package}/bin/pactl load-module module-device-manager "do_routing=1"
''}
if [ -f "$HOME/.config/kdeglobals" ]
then
# Remove extraneous font style names.
# See also: https://phabricator.kde.org/D9070
${getBin pkgs.gnused}/bin/sed -i "$HOME/.config/kdeglobals" \
-e '/^fixed=/ s/,Regular$//' \
-e '/^font=/ s/,Regular$//' \
-e '/^menuFont=/ s/,Regular$//' \
-e '/^smallestReadableFont=/ s/,Regular$//' \
-e '/^toolBarFont=/ s/,Regular$//'
fi
exec "${getBin plasma5.plasma-workspace}/bin/startkde"
'';
};

View File

@ -125,7 +125,7 @@ let
milou = callPackage ./milou.nix {};
oxygen = callPackage ./oxygen.nix {};
plasma-desktop = callPackage ./plasma-desktop {};
plasma-integration = callPackage ./plasma-integration.nix {};
plasma-integration = callPackage ./plasma-integration {};
plasma-nm = callPackage ./plasma-nm {};
plasma-pa = callPackage ./plasma-pa.nix { inherit gconf; };
plasma-vault = callPackage ./plasma-vault {};

View File

@ -0,0 +1,24 @@
Index: src/platformtheme/kfontsettingsdata.cpp
===================================================================
--- src/platformtheme/kfontsettingsdata.cpp
+++ src/platformtheme/kfontsettingsdata.cpp
@@ -70,15 +70,18 @@
const KFontData &fontData = DefaultFontData[fontType];
cachedFont = new QFont(QLatin1String(fontData.FontName), fontData.Size, fontData.Weight);
cachedFont->setStyleHint(fontData.StyleHint);
- cachedFont->setStyleName(QLatin1String(fontData.StyleName));
const KConfigGroup configGroup(mKdeGlobals, fontData.ConfigGroupKey);
QString fontInfo = configGroup.readEntry(fontData.ConfigKey, QString());
//If we have serialized information for this font, restore it
//NOTE: We are not using KConfig directly because we can't call QFont::QFont from here
if (!fontInfo.isEmpty()) {
cachedFont->fromString(fontInfo);
+ } else {
+ // set the canonical stylename here, where it cannot override
+ // user-specific font attributes if those do not include a stylename.
+ cachedFont->setStyleName(QLatin1String(fontData.StyleName));
}
mFonts[fontType] = cachedFont;

View File

@ -14,4 +14,11 @@ mkDerivation {
breeze-qt5 kconfig kconfigwidgets kiconthemes kio knotifications kwayland
libXcursor qtquickcontrols2
];
patches = [
# See also: https://phabricator.kde.org/D9070
# ttuegel: The patch is checked into Nixpkgs because I could not get
# Phabricator to give me a stable link to it.
./D9070.patch
];
patchFlags = "-p0";
}