diff --git a/src/lib/navigation/siteicon.cpp b/src/lib/navigation/siteicon.cpp index 27cbe2328..6c1dd8b55 100644 --- a/src/lib/navigation/siteicon.cpp +++ b/src/lib/navigation/siteicon.cpp @@ -78,8 +78,12 @@ void SiteIcon::iconClicked() return; } + setDown(true); + SiteInfoWidget* info = new SiteInfoWidget(m_window); info->showAt(parentWidget()); + + connect(info, SIGNAL(destroyed()), this, SLOT(popupClosed())); } void SiteIcon::updateIcon() @@ -87,6 +91,11 @@ void SiteIcon::updateIcon() ToolButton::setIcon(m_icon); } +void SiteIcon::popupClosed() +{ + setDown(false); +} + void SiteIcon::contextMenuEvent(QContextMenuEvent* e) { // Prevent propagating to LocationBar diff --git a/src/lib/navigation/siteicon.h b/src/lib/navigation/siteicon.h index 700a48802..99b4f56e6 100644 --- a/src/lib/navigation/siteicon.h +++ b/src/lib/navigation/siteicon.h @@ -42,6 +42,8 @@ private slots: void iconClicked(); void updateIcon(); + void popupClosed(); + private: void contextMenuEvent(QContextMenuEvent* e); void mousePressEvent(QMouseEvent* e); diff --git a/src/lib/tools/toolbutton.cpp b/src/lib/tools/toolbutton.cpp index 6ecad9b0d..8dfa4f1da 100644 --- a/src/lib/tools/toolbutton.cpp +++ b/src/lib/tools/toolbutton.cpp @@ -137,11 +137,6 @@ void ToolButton::mousePressEvent(QMouseEvent* e) return; } - - if (e->buttons() == Qt::MiddleButton) { - setDown(true); - } - QToolButton::mousePressEvent(e); } @@ -160,7 +155,6 @@ void ToolButton::mouseReleaseEvent(QMouseEvent* e) } QToolButton::mouseReleaseEvent(e); - setDown(false); } void ToolButton::mouseDoubleClickEvent(QMouseEvent* e)