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

[Theme] Use theme icon for Exit Fullscreen button in toolbar

This commit is contained in:
Javier Llorente 2014-02-07 23:14:32 +01:00 committed by nowrep
parent 5e0db8fe13
commit c84f3d2366
10 changed files with 37 additions and 2 deletions

View File

@ -102,6 +102,11 @@
qproperty-multiIcon: url(images/navigation-supermenu.png); qproperty-multiIcon: url(images/navigation-supermenu.png);
} }
#navigation-button-exitfullscreen
{
qproperty-themeIcon: "view-restore";
}
/*TabWidget*/ /*TabWidget*/
#tabbar::scroller #tabbar::scroller
{ {

View File

@ -100,6 +100,11 @@
qproperty-icon: url(images/navigation-supmenu.png); qproperty-icon: url(images/navigation-supmenu.png);
} }
#navigation-button-exitfullscreen
{
qproperty-themeIcon: "view-restore";
}
/*TabWidget*/ /*TabWidget*/
#tabbar::tab #tabbar::tab
{ {

View File

@ -69,6 +69,11 @@
qproperty-fallbackIcon: url(images/preferences-desktop.png); qproperty-fallbackIcon: url(images/preferences-desktop.png);
} }
#navigation-button-exitfullscreen
{
qproperty-themeIcon: "view-restore";
}
#navigation-button-supermenu::menu-indicator #navigation-button-supermenu::menu-indicator
{ {
image: none; image: none;

View File

@ -97,6 +97,11 @@
qproperty-multiIcon: url(images/navigation-supermenu.png); qproperty-multiIcon: url(images/navigation-supermenu.png);
} }
#navigation-button-exitfullscreen
{
qproperty-themeIcon: "view-restore";
}
/*TabWidget*/ /*TabWidget*/
#tabbar::scroller #tabbar::scroller
{ {

View File

@ -107,6 +107,11 @@
qproperty-iconSize: 23px 22px; qproperty-iconSize: 23px 22px;
} }
#navigation-button-exitfullscreen
{
qproperty-themeIcon: "view-restore";
}
/*TabWidget*/ /*TabWidget*/
#tabbar::scroller #tabbar::scroller
{ {

View File

@ -80,5 +80,6 @@
<file>icons/theme/expand.png</file> <file>icons/theme/expand.png</file>
<file>icons/theme/collapse.png</file> <file>icons/theme/collapse.png</file>
<file>icons/theme/speeddial.png</file> <file>icons/theme/speeddial.png</file>
<file>icons/theme/view-restore.png</file>
</qresource> </qresource>
</RCC> </RCC>

Binary file not shown.

After

Width:  |  Height:  |  Size: 469 B

View File

@ -149,10 +149,13 @@ NavigationBar::NavigationBar(QupZilla* mainClass)
m_navigationSplitter->setCollapsible(0, false); m_navigationSplitter->setCollapsible(0, false);
m_exitFullscreen = new ToolButton(); m_exitFullscreen = new ToolButton();
m_exitFullscreen->setText(tr("Exit Fullscreen")); m_exitFullscreen->setObjectName("navigation-button-exitfullscreen");
m_exitFullscreen->setToolTip(tr("Exit Fullscreen")); m_exitFullscreen->setToolTip(tr("Exit Fullscreen"));
m_exitFullscreen->setToolButtonStyle(Qt::ToolButtonIconOnly);
m_exitFullscreen->setFocusPolicy(Qt::NoFocus);
m_exitFullscreen->setAutoRaise(true); m_exitFullscreen->setAutoRaise(true);
m_exitFullscreen->setVisible(false); m_exitFullscreen->setVisible(false);
setButtonIconSize(m_exitFullscreen);
m_layout->addLayout(backNextLayout); m_layout->addLayout(backNextLayout);
m_layout->addWidget(m_reloadStop); m_layout->addWidget(m_reloadStop);

View File

@ -196,6 +196,8 @@ QIcon IconProvider::standardIcon(QStyle::StandardPixmap icon)
QIcon IconProvider::fromTheme(const QString &icon) QIcon IconProvider::fromTheme(const QString &icon)
{ {
// TODO: This should actually look in :icons/theme for fallback icon, not hardcode every icon
if (icon == QLatin1String("go-home")) { if (icon == QLatin1String("go-home")) {
return QIcon::fromTheme("go-home", QIcon(":/icons/theme/home.png")); return QIcon::fromTheme("go-home", QIcon(":/icons/theme/home.png"));
} }
@ -217,6 +219,9 @@ QIcon IconProvider::fromTheme(const QString &icon)
else if (icon == QLatin1String("go-previous")) { else if (icon == QLatin1String("go-previous")) {
return QIcon::fromTheme("go-previous", QIcon(":icons/theme/go-previous.png")); return QIcon::fromTheme("go-previous", QIcon(":icons/theme/go-previous.png"));
} }
else if (icon == QLatin1String("view-restore")) {
return QIcon::fromTheme("view-restore", QIcon(":icons/theme/view-restore.png"));
}
else { else {
return QIcon::fromTheme(icon); return QIcon::fromTheme(icon);
} }

View File

@ -16,6 +16,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
* ============================================================ */ * ============================================================ */
#include "toolbutton.h" #include "toolbutton.h"
#include "iconprovider.h"
#include <QMouseEvent> #include <QMouseEvent>
#include <QMenu> #include <QMenu>
@ -35,7 +36,7 @@ ToolButton::ToolButton(QWidget* parent)
void ToolButton::setThemeIcon(const QString &image) void ToolButton::setThemeIcon(const QString &image)
{ {
m_themeIcon = image; m_themeIcon = image;
setIcon(QIcon::fromTheme(image)); setIcon(qIconProvider->fromTheme(image));
m_usingMultiIcon = false; m_usingMultiIcon = false;
} }