mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19: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 ) ) ) )
|
||||
{
|
||||
// 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 );
|
||||
}
|
||||
else
|
||||
|
|
|
@ -135,8 +135,8 @@ void ArticleWebView::sendCustomMouseEvent( QEvent::Type type) {
|
|||
void ArticleWebView::mouseReleaseEvent(QMouseEvent *event) {
|
||||
bool noMidButton = !( event->buttons() & Qt::MiddleButton );
|
||||
|
||||
if ( midButtonPressed & noMidButton )
|
||||
midButtonPressed = false;
|
||||
// if ( midButtonPressed & noMidButton )
|
||||
// midButtonPressed = false;
|
||||
}
|
||||
|
||||
void ArticleWebView::doubleClickAction(QMouseEvent *event) {
|
||||
|
|
|
@ -32,6 +32,10 @@ public:
|
|||
|
||||
bool isMidButtonPressed() const
|
||||
{ return midButtonPressed; }
|
||||
void resetMidButtonPressed()
|
||||
{
|
||||
midButtonPressed = false;
|
||||
}
|
||||
void setSelectionBySingleClick( bool set )
|
||||
{ selectionBySingleClick = set; }
|
||||
|
||||
|
|
Loading…
Reference in a new issue