1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 10:46:35 +01:00

ButtonWithMenu: Fix down state handling

This commit is contained in:
David Rosca 2018-01-28 11:03:41 +01:00
parent 00e2af4164
commit 310f3cfde7
No known key found for this signature in database
GPG Key ID: EBC3FC294452C6D8

View File

@ -25,9 +25,11 @@ ButtonWithMenu::ButtonWithMenu(QWidget* parent)
, m_menu(new QMenu(this)) , m_menu(new QMenu(this))
{ {
setCursor(Qt::ArrowCursor); setCursor(Qt::ArrowCursor);
setFocusPolicy(Qt::ClickFocus); setFocusPolicy(Qt::NoFocus);
connect(this, SIGNAL(aboutToShowMenu()), this, SLOT(generateMenu())); connect(this, SIGNAL(aboutToShowMenu()), this, SLOT(generateMenu()));
connect(m_menu, &QMenu::aboutToShow, this, std::bind(&ButtonWithMenu::setDown, this, true));
connect(m_menu, &QMenu::aboutToHide, this, std::bind(&ButtonWithMenu::setDown, this, false));
} }
void ButtonWithMenu::setCurrentItem() void ButtonWithMenu::setCurrentItem()