Skip to content

Commit

Permalink
Save font size when changing zoom level with keyboard shortcuts
Browse files Browse the repository at this point in the history
  • Loading branch information
Davidy22 committed May 12, 2023
1 parent 5ceca08 commit a011f8a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
10 changes: 8 additions & 2 deletions guake/guake_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,14 +937,20 @@ def accel_reset_terminal(self, *args):

def accel_zoom_in(self, *args):
"""Callback to zoom in."""
font = " ".join(self.settings.styleFont.get_string("style").split(" ")[:-1])
new_size = int(self.settings.styleFont.get_string("style").split(" ")[-1]) + 1
self.settings.styleFont.set_string("style", f"{font} {new_size}")
for term in self.get_notebook().iter_terminals():
term.increase_font_size()
term.set_font_scale(new_size / (new_size - 1))
return True

def accel_zoom_out(self, *args):
"""Callback to zoom out."""
font = " ".join(self.settings.styleFont.get_string("style").split(" ")[:-1])
new_size = int(self.settings.styleFont.get_string("style").split(" ")[-1]) - 1
self.settings.styleFont.set_string("style", f"{font} {new_size}")
for term in self.get_notebook().iter_terminals():
term.decrease_font_size()
term.set_font_scale((new_size - 1) / new_size)
return True

def accel_increase_height(self, *args):
Expand Down
7 changes: 7 additions & 0 deletions releasenotes/notes/save_zoom-8b8f54485b975e7c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
release_summary: >
Save font size when changing zoom level with keyboard shortcuts
fixes:
- |
- Opening a new tab resets the zoom level/ #2109

0 comments on commit a011f8a

Please sign in to comment.