mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-30 17:24:08 +00:00
fix:middle mouse click open in new tab
This commit is contained in:
parent
4a96067e86
commit
269a7bcf48
|
@ -1110,6 +1110,7 @@ void ArticleView::linkClicked( QUrl const & url_ )
|
||||||
( kmod & ( Qt::ControlModifier | Qt::ShiftModifier ) ) ) )
|
( kmod & ( Qt::ControlModifier | Qt::ShiftModifier ) ) ) )
|
||||||
{
|
{
|
||||||
// Mid button or Control/Shift is currently pressed - open the link in new tab
|
// Mid button or Control/Shift is currently pressed - open the link in new tab
|
||||||
|
ui.definition->resetMidButtonPressed();
|
||||||
emit openLinkInNewTab( url, ui.definition->url(), getCurrentArticle(), contexts );
|
emit openLinkInNewTab( url, ui.definition->url(), getCurrentArticle(), contexts );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
@ -135,8 +135,8 @@ void ArticleWebView::sendCustomMouseEvent( QEvent::Type type) {
|
||||||
void ArticleWebView::mouseReleaseEvent(QMouseEvent *event) {
|
void ArticleWebView::mouseReleaseEvent(QMouseEvent *event) {
|
||||||
bool noMidButton = !( event->buttons() & Qt::MiddleButton );
|
bool noMidButton = !( event->buttons() & Qt::MiddleButton );
|
||||||
|
|
||||||
if ( midButtonPressed & noMidButton )
|
// if ( midButtonPressed & noMidButton )
|
||||||
midButtonPressed = false;
|
// midButtonPressed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void ArticleWebView::doubleClickAction(QMouseEvent *event) {
|
void ArticleWebView::doubleClickAction(QMouseEvent *event) {
|
||||||
|
|
|
@ -32,6 +32,10 @@ public:
|
||||||
|
|
||||||
bool isMidButtonPressed() const
|
bool isMidButtonPressed() const
|
||||||
{ return midButtonPressed; }
|
{ return midButtonPressed; }
|
||||||
|
void resetMidButtonPressed()
|
||||||
|
{
|
||||||
|
midButtonPressed = false;
|
||||||
|
}
|
||||||
void setSelectionBySingleClick( bool set )
|
void setSelectionBySingleClick( bool set )
|
||||||
{ selectionBySingleClick = set; }
|
{ selectionBySingleClick = set; }
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue