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

TabIcon: Draw audio icon on top of site icon for pinned tabs

This commit is contained in:
David Rosca 2017-01-01 21:34:45 +01:00
parent c0e4264540
commit 9bceb3f8b3

View File

@ -1,6 +1,6 @@
/* ============================================================
* QupZilla - WebKit based browser
* Copyright (C) 2014-2016 David Rosca <nowrep@gmail.com>
* QupZilla - Qt web browser
* Copyright (C) 2014-2017 David Rosca <nowrep@gmail.com>
*
* 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
@ -175,13 +175,18 @@ void TabIcon::paintEvent(QPaintEvent* event)
if (m_animationRunning) {
p.drawPixmap(r, s_data->animationPixmap, QRect(m_currentFrame * pixmapSize, 0, pixmapSize, pixmapSize));
} else if (m_audioIconDisplayed) {
} else if (m_audioIconDisplayed && (!m_tab || !m_tab->isPinned())) {
p.drawPixmap(r, m_tab->isMuted() ? s_data->audioMutedPixmap : s_data->audioPlayingPixmap);
} else if (!m_sitePixmap.isNull()) {
p.drawPixmap(r, m_sitePixmap);
} else if (m_tab && m_tab->isPinned()) {
p.drawPixmap(r, IconProvider::emptyWebIcon().pixmap(size));
}
// Draw audio icon on top of site icon for pinned tabs
if (!m_animationRunning && m_audioIconDisplayed && m_tab && m_tab->isPinned()) {
p.drawPixmap(r, m_tab->isMuted() ? s_data->audioMutedPixmap : s_data->audioPlayingPixmap);
}
}
void TabIcon::mousePressEvent(QMouseEvent *event)