Skip to content

Commit

Permalink
Make names more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Libretto committed Nov 22, 2023
1 parent 25aab9f commit 3eea00d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions data/resources/shortcuts.blp
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ template $DialectShortcutsWindow : ShortcutsWindow {

ShortcutsShortcut {
title: C_("shortcuts window", "Increase font size");
action-name: "win.inc-font";
action-name: "win.font-size-inc";
}

ShortcutsShortcut {
title: C_("shortcuts window", "Decrease font size");
action-name: "win.dec-font";
action-name: "win.font-size-dec";
}
}

Expand Down
4 changes: 2 additions & 2 deletions dialect/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ def setup_actions(self):
self.set_accels_for_action('win.forward', ['<Alt>Right'])
self.set_accels_for_action('win.switch', ['<Primary>S'])
self.set_accels_for_action('win.clear', ['<Primary>D'])
self.set_accels_for_action('win.inc-font', ['<Primary>plus', '<Primary>KP_Add'])
self.set_accels_for_action('win.dec-font', ['<Primary>minus', '<Primary>KP_Subtract'])
self.set_accels_for_action('win.font-size-inc', ['<Primary>plus', '<Primary>KP_Add'])
self.set_accels_for_action('win.font-size-dec', ['<Primary>minus', '<Primary>KP_Subtract'])
self.set_accels_for_action('win.paste', ['<Primary><Shift>V'])
self.set_accels_for_action('win.copy', ['<Primary><Shift>C'])
self.set_accels_for_action('win.listen-dest', ['<Primary>L'])
Expand Down
16 changes: 8 additions & 8 deletions dialect/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,13 +152,13 @@ def setup_actions(self):
clear_action.connect('activate', self.ui_clear)
self.add_action(clear_action)

inc_font_action = Gio.SimpleAction.new('inc-font', None)
inc_font_action.connect('activate', self.ui_inc_font)
self.add_action(inc_font_action)
font_size_inc_action = Gio.SimpleAction.new('font-size-inc', None)
font_size_inc_action.connect('activate', self.ui_font_size_inc)
self.add_action(font_size_inc_action)

dec_font_action = Gio.SimpleAction.new('dec-font', None)
dec_font_action.connect('activate', self.ui_dec_font)
self.add_action(dec_font_action)
font_size_dec_action = Gio.SimpleAction.new('font-size-dec', None)
font_size_dec_action.connect('activate', self.ui_font_size_dec)
self.add_action(font_size_dec_action)

paste_action = Gio.SimpleAction.new('paste', None)
paste_action.connect('activate', self.ui_paste)
Expand Down Expand Up @@ -795,10 +795,10 @@ def set_font_size(self, size):
self.font_size = size
self.font_css_provider.load_from_data(f'textview {{ font-size: { str(size) }pt; }}')

def ui_inc_font(self, _action, _param):
def ui_font_size_inc(self, _action, _param):
self.set_font_size(self.font_size + 5)

def ui_dec_font(self, _action, _param):
def ui_font_size_dec(self, _action, _param):
new_size = self.font_size - 5
if new_size >= 5:
self.set_font_size(new_size)
Expand Down

0 comments on commit 3eea00d

Please sign in to comment.