Commit 86be8d49 authored by Henrik Fehlauer's avatar Henrik Fehlauer

Allow to change toolbar font separately again

Summary:
The fonts KCM supports changing the toolbar font, but with the port to
QPA/Plasma 5 in aa16577f this stopped working and toolbars just used the
general font. This is fixed by setting QPlatformTheme's ToolButtonFont
to the toolbar font chosen. However, there are some caveats:

Default toolbar font size is 9, while the general font size is 10.
This would result in a sudden shrink in toolbar widths everywhere (or
worse for weird leftover settings users might have tried unsuccessfully).

In some places QToolButtons are used outside of toolbars, sometimes
right next to QPushButtons. As due to the bug both had the same font,
this might now lead to unexpected differences.

Therefore, to keep visual consistency with past Plasma 5 releases, let's
change the default toolbar font size to 10 and provide a kconf_update
script to copy the general font to the toolbar font once.

BUG: 358254
FIXED-IN: 5.11.0

Test Plan:
make install, run kconf_update: toolBarFont in kdeglobals gets updated
immediately

Change "Toolbar" font in "kcmshell5 fonts", start your favorite KDE
and Qt-only applications: toolbar font and/or font size changed
accordingly

Reviewers: #plasma, davidedmundson, fvogt

Reviewed By: #plasma, davidedmundson, fvogt

Subscribers: fvogt, davidedmundson, jensreuterberg, plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D6697
parent 2434bafc
......@@ -68,5 +68,5 @@ endif()
install(TARGETS KDEPlasmaPlatformTheme DESTINATION ${KDE_INSTALL_QTPLUGINDIR}/platformthemes)
install(FILES fonts_global.upd fonts_akregator.upd fonts_kate.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(FILES fonts_global_toolbar.upd fonts_global.upd fonts_akregator.upd fonts_kate.upd DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
install(PROGRAMS fonts_global.pl fonts_akregator.pl fonts_kate.pl DESTINATION ${KDE_INSTALL_KCONFUPDATEDIR})
# Ensure toolbar font (as displayed) remains the same even after
# fixing BUG 358254, i.e. copy general font to toolbar font once
Version=5
Id=Fonts_Global_Toolbar
Options=copy,overwrite
File=kdeglobals
Group=General
Key=font,toolBarFont
......@@ -155,7 +155,6 @@ const QFont *KdePlatformTheme::font(Font type) const
case TipLabelFont:
case StatusBarFont:
case PushButtonFont:
case ToolButtonFont:
case ItemViewFont:
case ListViewFont:
case HeaderViewFont:
......@@ -172,6 +171,8 @@ const QFont *KdePlatformTheme::font(Font type) const
fdtype = KFontSettingsData::SmallestReadableFont; break;
case FixedFont:
fdtype = KFontSettingsData::FixedFont; break;
case ToolButtonFont:
fdtype = KFontSettingsData::ToolbarFont; break;
default:
fdtype = KFontSettingsData::GeneralFont; break;
}
......
......@@ -55,7 +55,7 @@ static const char DefaultFont[] = "Noto Sans";
static const KFontData DefaultFontData[KFontSettingsData::FontTypesCount] = {
{ GeneralId, "font", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
{ GeneralId, "fixed", "Hack", 9, -1, QFont::Monospace, "Regular" },
{ GeneralId, "toolBarFont", DefaultFont, 9, -1, QFont::SansSerif, "Regular" },
{ GeneralId, "toolBarFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
{ GeneralId, "menuFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
{ "WM", "activeFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
{ GeneralId, "taskbarFont", DefaultFont, 10, -1, QFont::SansSerif, "Regular" },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment