fix:middle mouse click open in new tab

This commit is contained in:
yifang 2022-03-04 00:17:21 +08:00
parent 4a96067e86
commit 269a7bcf48
3 changed files with 7 additions and 2 deletions

View file

@ -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

View file

@ -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) {

View file

@ -32,6 +32,10 @@ public:
bool isMidButtonPressed() const
{ return midButtonPressed; }
void resetMidButtonPressed()
{
midButtonPressed = false;
}
void setSelectionBySingleClick( bool set )
{ selectionBySingleClick = set; }