Restore zoom fonts after changing profile with ESC sequences
ClosedPublic

Authored by ahmadsamir on Feb 19 2018, 5:54 AM.

Details

Summary

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

Diff Detail

Repository
R319 Konsole
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Feb 19 2018, 5:54 AM
Restricted Application added a project: Konsole. · View Herald TranscriptFeb 19 2018, 5:54 AM
Restricted Application added a subscriber: Konsole. · View Herald Transcript
ahmadsamir requested review of this revision.Feb 19 2018, 5:54 AM

Thanks for the patch! Please follow the formatting guidelines here: https://community.kde.org/Infrastructure/Phabricator#Formatting_your_patch

Specifically, remove "BUG: 386643" from the title, and put it on its own line in the Summary section.

Also, please populate the Test Plan field with the results of your testing. Thanks!

ahmadsamir retitled this revision from Preserve zoom'ed font sizes, if any, in each view after changing profile properties via the command line or ESC sequences Fixes BUG: 386643 to Restore zoom'ed font sizes after changing profile properties via the command line or ESC sequences.Feb 19 2018, 5:22 PM
ahmadsamir edited the summary of this revision. (Show Details)

Almost! Instead of:
"Fixes Bug: 386643"
it needs to be:
"BUG: 386643"

Thanks for the patch! Please follow the formatting guidelines here: https://community.kde.org/Infrastructure/Phabricator#Formatting_your_patch

Specifically, remove "BUG: 386643" from the title, and put it on its own line in the Summary section.

Also, please populate the Test Plan field with the results of your testing. Thanks!

That's what I get for using arc...

Almost! Instead of:
"Fixes Bug: 386643"
it needs to be:
"BUG: 386643"

No need in this particular case; since I don't have commit access to KDE's git, Kurt commits the patch if it's accepted and he phrases the commit messages himself, with all the necessary keywords including BUG: .

It's a good habit anyway, since if you or he pushed using arc, then that keyword would trigger the commit hook and close the bug automatically.

If you're having trouble with arc, I recommend reading https://community.kde.org/Infrastructure/Phabricator#Using_Arcanist_to_post_patches

[...]

If you're having trouble with arc, I recommend reading https://community.kde.org/Infrastructure/Phabricator#Using_Arcanist_to_post_patches

Thanks. I'll certainly have a look there.

I'm testing using arc as well

src/SessionManager.cpp
271

const TerminaD...

272

since you are calling getVTfont() twice, you might want to assign it to a variable - depends on cost and how often called

I notice w/ this patch, if you change the font size via shortcut and then edit profile, you get a new profile w/o a name.

src/SessionManager.cpp
271

ignore this - won't work w/o more work

ahmadsamir updated this revision to Diff 28072.Feb 25 2018, 9:15 PM

Assign getVTFont() to a variable instead of calling it twice

ahmadsamir retitled this revision from Restore zoom'ed font sizes after changing profile properties via the command line or ESC sequences to Restore zoom fonts after changing profile with ESC sequences.Feb 25 2018, 9:17 PM
ahmadsamir edited the summary of this revision. (Show Details)
ahmadsamir edited the summary of this revision. (Show Details)
ahmadsamir marked 3 inline comments as done.Feb 25 2018, 9:21 PM
ahmadsamir added inline comments.
src/SessionManager.cpp
271

I tried using 'const TerminalDisplay *' after reading your previous comment, and I reached the same conclusion, that it won't work.

Even if getVTFont() and setVTFont() become const member functions, QWidget::setFont() isn't a const member function...

ahmadsamir marked an inline comment as done.Feb 25 2018, 9:24 PM

I notice w/ this patch, if you change the font size via shortcut and then edit profile, you get a new profile w/o a name.

IIUC if a profile property is changed via the cmd or an ESC sequence, konsole switches to a new unnamed profile (which is a clone of the current profile).

ahmadsamir marked an inline comment as done.Feb 25 2018, 9:25 PM
hindenburg accepted this revision.Feb 28 2018, 4:20 AM
This revision is now accepted and ready to land.Feb 28 2018, 4:20 AM
This revision was automatically updated to reflect the committed changes.