Merge pull request #1017 from vedgy/add-scan-popup-article-view-focus-shortcut

Add a shortcut to focus scan popup's article view
This commit is contained in:
Abs62 2018-05-17 20:51:04 +03:00 committed by GitHub
commit 61ee894ff7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 2 deletions

View file

@ -136,12 +136,12 @@ public slots:
/// Goes forward in history
void forward();
public:
/// Takes the focus to the view
void focus()
{ ui.definition->setFocus( Qt::ShortcutFocusReason ); }
public:
/// Reloads the view
void reload()
{ ui.definition->reload(); }

View file

@ -229,6 +229,11 @@ ScanPopup::ScanPopup( QWidget * parent,
connect( &focusTranslateLineAction, SIGNAL( triggered() ),
this, SLOT( focusTranslateLine() ) );
QAction * const focusArticleViewAction = new QAction( this );
focusArticleViewAction->setShortcutContext( Qt::WidgetWithChildrenShortcut );
focusArticleViewAction->setShortcut( QKeySequence( "Ctrl+N" ) );
addAction( focusArticleViewAction );
connect( focusArticleViewAction, SIGNAL( triggered() ), definition, SLOT( focus() ) );
switchExpandModeAction.setShortcuts( QList< QKeySequence >() <<
QKeySequence( Qt::CTRL + Qt::Key_8 ) <<