mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 15:24:05 +00:00
Regression: Fix "can't go up/down the list of suggestions" bug introduced while fixing "sync between currently active article and the 'found in dictionaries' pane for web dictionaries" bug. See other focusReasons at http://doc.qt.nokia.com/4.7-snapshot/qt.html#FocusReason-enum
This commit is contained in:
parent
e362b4d2ca
commit
f5cd150201
|
@ -101,7 +101,7 @@ std::string ArticleMaker::makeHtmlHeader( QString const & word,
|
|||
"function processIframeMouseOut() { overIframeId = null; top.focus(); }"
|
||||
"function processIframeMouseOver( newId ) { overIframeId = newId; }"
|
||||
"function processIframeClick() { if( overIframeId != null ) { overIframeId = overIframeId.replace( 'gdexpandframe-', '' ); gdMakeArticleActive( overIframeId ) } }"
|
||||
"function init() { window.addEventListener('blur', processIframeClick, false); top.focus(); }"
|
||||
"function init() { window.addEventListener('blur', processIframeClick, false); }"
|
||||
"window.addEventListener('load', init, false);"
|
||||
"</script>";
|
||||
|
||||
|
|
|
@ -38,3 +38,20 @@ void ArticleWebView::mouseDoubleClickEvent( QMouseEvent * event )
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
void ArticleWebView::focusInEvent( QFocusEvent * event )
|
||||
{
|
||||
QWebView::focusInEvent( event );
|
||||
|
||||
switch( event->reason() )
|
||||
{
|
||||
case Qt::MouseFocusReason:
|
||||
case Qt::TabFocusReason:
|
||||
case Qt::BacktabFocusReason:
|
||||
page()->mainFrame()->evaluateJavaScript("top.focus();");
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -38,6 +38,7 @@ protected:
|
|||
void mousePressEvent( QMouseEvent * event );
|
||||
void mouseReleaseEvent( QMouseEvent * event );
|
||||
void mouseDoubleClickEvent( QMouseEvent * event );
|
||||
void focusInEvent( QFocusEvent * event );
|
||||
|
||||
private:
|
||||
|
||||
|
|
Loading…
Reference in a new issue