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

[SiteIcon] Support :pressed state for style sheets

This commit is contained in:
nowrep 2014-03-23 23:53:51 +01:00
parent 2228b060bc
commit 2e8c9f690e
3 changed files with 11 additions and 6 deletions

View File

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

View File

@ -42,6 +42,8 @@ private slots:
void iconClicked();
void updateIcon();
void popupClosed();
private:
void contextMenuEvent(QContextMenuEvent* e);
void mousePressEvent(QMouseEvent* e);

View File

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