From b95c2d245e77f5ca8d60cdb55ee10d42aa425998 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 7 Feb 2013 00:01:31 +0530 Subject: [PATCH] E-book viewer: Add shortcuts Ctrl+= and Ctrl+- to increase/decrease text size. Fixes #1117524 (Shortcuts in reader for enlargem shrink text) --- src/calibre/gui2/viewer/main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/calibre/gui2/viewer/main.py b/src/calibre/gui2/viewer/main.py index bcb10a2f5b..fc2f84320d 100644 --- a/src/calibre/gui2/viewer/main.py +++ b/src/calibre/gui2/viewer/main.py @@ -236,6 +236,8 @@ class EbookViewer(MainWindow, Ui_EbookViewer): self.action_copy.triggered[bool].connect(self.copy) self.action_font_size_larger.triggered.connect(self.font_size_larger) self.action_font_size_smaller.triggered.connect(self.font_size_smaller) + self.action_font_size_larger.setShortcut(Qt.CTRL+Qt.Key_Equal) + self.action_font_size_smaller.setShortcut(Qt.CTRL+Qt.Key_Minus) self.action_open_ebook.triggered[bool].connect(self.open_ebook) self.action_next_page.triggered.connect(self.view.next_page) self.action_previous_page.triggered.connect(self.view.previous_page) @@ -705,11 +707,13 @@ class EbookViewer(MainWindow, Ui_EbookViewer): self.view.shrink_fonts() def magnification_changed(self, val): - tt = _('%(which)s font size\nCurrent magnification: %(mag).1f') + tt = _('%(which)s font size [%(sc)s]\nCurrent magnification: %(mag).1f') + sc = unicode(self.action_font_size_larger.shortcut().toString()) self.action_font_size_larger.setToolTip( - tt %dict(which=_('Increase'), mag=val)) + tt %dict(which=_('Increase'), mag=val, sc=sc)) + sc = unicode(self.action_font_size_smaller.shortcut().toString()) self.action_font_size_smaller.setToolTip( - tt %dict(which=_('Decrease'), mag=val)) + tt %dict(which=_('Decrease'), mag=val, sc=sc)) self.action_font_size_larger.setEnabled(self.view.multiplier < 3) self.action_font_size_smaller.setEnabled(self.view.multiplier > 0.2)