Members of the KDE Community are recommended to subscribe to the kde-community mailing list at to allow them to participate in important discussions and receive other important announcements

Commit 18014c75 authored by Ahmad Samir's avatar Ahmad Samir Committed by Kurt Hindenburg

Restore zoom fonts after changing profile with ESC sequences

When a profile property is changed via the command line or an ESC sequence
a new temp profile is created and applied, this resets the zoom values in
the views connected to the session.
Save zoom font sizes and restore them after the new profile is applied.

BUG: 386643
FIXED-IN: 18.04

Reviewers: hindenburg

Reviewed By: hindenburg

Subscribers: ngraham, #konsole

Tags: #konsole

Differential Revision:
parent 5345bbb0
......@@ -37,6 +37,7 @@
#include "ProfileManager.h"
#include "History.h"
#include "Enumeration.h"
#include "TerminalDisplay.h"
using namespace Konsole;
......@@ -263,6 +264,17 @@ void SessionManager::sessionProfileCommandReceived(const QString &text)
Session *session = qobject_cast<Session *>(sender());
// store the font for each view if zoom was applied so that they can
// be restored after applying the new profile
QHash<TerminalDisplay *, QFont> zoomFontSizes;
foreach (TerminalDisplay *view, session->views()) {
const QFont &viewCurFont = view->getVTFont();
if (viewCurFont != _sessionProfiles[session]->font()) {
zoomFontSizes.insert(view, viewCurFont);
ProfileCommandParser parser;
QHash<Profile::Property, QVariant> changes = parser.parse(text);
......@@ -283,6 +295,14 @@ void SessionManager::sessionProfileCommandReceived(const QString &text)
_sessionProfiles[session] = newProfile;
applyProfile(newProfile, true);
emit sessionUpdated(session);
if (!zoomFontSizes.isEmpty()) {
QHashIterator<TerminalDisplay *, QFont> it(zoomFontSizes);
while (it.hasNext()) {;
void SessionManager::saveSessions(KConfig *config)
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