mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-24 12:44:07 +00:00
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:
commit
61ee894ff7
|
@ -136,12 +136,12 @@ public slots:
|
||||||
/// Goes forward in history
|
/// Goes forward in history
|
||||||
void forward();
|
void forward();
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
/// Takes the focus to the view
|
/// Takes the focus to the view
|
||||||
void focus()
|
void focus()
|
||||||
{ ui.definition->setFocus( Qt::ShortcutFocusReason ); }
|
{ ui.definition->setFocus( Qt::ShortcutFocusReason ); }
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
/// Reloads the view
|
/// Reloads the view
|
||||||
void reload()
|
void reload()
|
||||||
{ ui.definition->reload(); }
|
{ ui.definition->reload(); }
|
||||||
|
|
|
@ -229,6 +229,11 @@ ScanPopup::ScanPopup( QWidget * parent,
|
||||||
connect( &focusTranslateLineAction, SIGNAL( triggered() ),
|
connect( &focusTranslateLineAction, SIGNAL( triggered() ),
|
||||||
this, SLOT( focusTranslateLine() ) );
|
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 >() <<
|
switchExpandModeAction.setShortcuts( QList< QKeySequence >() <<
|
||||||
QKeySequence( Qt::CTRL + Qt::Key_8 ) <<
|
QKeySequence( Qt::CTRL + Qt::Key_8 ) <<
|
||||||
|
|
Loading…
Reference in a new issue