1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 18:56:34 +01:00

ButtonWithMenu: Don't show menu on right click

This commit is contained in:
David Rosca 2018-01-05 16:36:15 +01:00
parent c5b59d1011
commit 09d2a2017d

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* Falkon - Qt web browser * Falkon - Qt web browser
* Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2018 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -165,7 +165,7 @@ void ButtonWithMenu::generateMenu()
void ButtonWithMenu::mousePressEvent(QMouseEvent *event) void ButtonWithMenu::mousePressEvent(QMouseEvent *event)
{ {
if (parentWidget() && parentWidget()->parentWidget()) { if (event->buttons() == Qt::LeftButton && parentWidget() && parentWidget()->parentWidget()) {
emit aboutToShowMenu(); emit aboutToShowMenu();
QWidget *w = parentWidget()->parentWidget(); QWidget *w = parentWidget()->parentWidget();
m_menu->popup(w->mapToGlobal(w->rect().bottomLeft())); m_menu->popup(w->mapToGlobal(w->rect().bottomLeft()));