1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

ToolButton: Fix showing both context menu and button menu on right click

This commit is contained in:
David Rosca 2015-10-05 22:41:20 +02:00
parent 3ec6da6103
commit 9fd7c271e4
2 changed files with 10 additions and 0 deletions

View File

@ -203,6 +203,15 @@ void ToolButton::mouseDoubleClickEvent(QMouseEvent* e)
}
}
void ToolButton::contextMenuEvent(QContextMenuEvent *e)
{
// Block to prevent showing both context menu and button menu
if (menu())
return;
QToolButton::contextMenuEvent(e);
}
void ToolButton::paintEvent(QPaintEvent* e)
{
if (!(m_options & MultiIconOption)) {

View File

@ -81,6 +81,7 @@ protected:
void mousePressEvent(QMouseEvent* e);
void mouseReleaseEvent(QMouseEvent* e);
void mouseDoubleClickEvent(QMouseEvent* e);
void contextMenuEvent(QContextMenuEvent *e);
void paintEvent(QPaintEvent* e);
private: