Add an action to reset the font size to the default and set the default shortcut to Ctrl+0
Details
- Reviewers
cullmann - Group Reviewers
KTextEditor - Commits
- R39:968af10fd4b6: Add action to reset font size
Zoom out the text. Press Ctrl+0 to go back to default zoom.
Do the same with the 'Reset font size' item in the 'View' menu.
Try to reassign the keyboard shortcut in the shortcuts manager and check that it works.
FEATURE: 407910
Diff Detail
- Repository
- R39 KTextEditor
- Lint
Lint Skipped - Unit
Unit Tests Skipped
Hi, this is a good start!
Thanks for taking care of this.
I think to get the "default font", you need to call KateRendererConfig::global()->font() instead of using a default constructed QFont. That should return the font configured in the KTextEditor settings.
For the shortcut: I guess you should use KStandardShortcut::ActualSize().
As we now have three actions just for zooming I think some "Zoom" sub-menu would be nice.
I initially tried using this, but it doesn't compile. It complains that ‘ActualSize’ cannot be used as a function. Just using KStandardShortcut::ActualSize results in the shortcut being set to '8' on my machine.
As we now have three actions just for zooming I think some "Zoom" sub-menu would be nice.
Should I make this change here, or in a separate pull request?
Could you try: KStandardShortcut::shortcut(KStandardShortcut::ActualSize)
The sub-menu should be just made in this review request, no need for an extra one, thanks!
I've made the suggested changes (use standard reset zoom shortcut, and move zoom option to a submenu). Everything seems to work now.
Btw., if should push, I would need your name + email address for the git commit, thanks.
I don't think I have the permissions for that. Could you please do it for me?
Name: Kishore Gopalakrishnan
Email: kishore96@gmail.com
Also, thanks for helping me with this!
Thank you for providing the patch!
Helping a bit to bring it up to speed is much easier and more motivating than to start from scratch for a thing one doesn't need oneself that much.
> Thanks, one bug less!
I hope more people that actually can scratch their own itch start to contribute with patches.