Commit c29e7348 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg
Browse files

Don't override profile icon in "New Tab" menu

We only need to set the favourite emblem for the default profile icon, for
other profiles, the profile icon is already set on the menu action.

Rename a lambda to a more meaningful name.

BUG: 437200
FIXED-IN: 21.08
(cherry picked from commit e03a4680)
parent b246ac57
......@@ -415,7 +415,7 @@ void MainWindow::profileListChanged(const QList<QAction *> &sessionActions)
for (QAction *sessionAction : sessionActions) {
_newTabMenuAction->menu()->addAction(sessionAction);
auto setActionFont = [sessionAction](bool isBold) {
auto setActionFontBold = [sessionAction](bool isBold) {
QFont actionFont = sessionAction->font();
actionFont.setBold(isBold);
sessionAction->setFont(actionFont);
......@@ -425,10 +425,9 @@ void MainWindow::profileListChanged(const QList<QAction *> &sessionActions)
if (profile && profile->name() == sessionAction->text().remove(QLatin1Char('&'))) {
QIcon icon(KIconLoader::global()->loadIcon(profile->icon(), KIconLoader::Small, 0, KIconLoader::DefaultState, QStringList(QStringLiteral("emblem-favorite"))));
sessionAction->setIcon(icon);
setActionFont(true);
setActionFontBold(true);
} else {
sessionAction->setIcon(QIcon::fromTheme(profile->icon()));
setActionFont(false);
setActionFontBold(false);
}
}
} else {
......
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