mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
ToolButton: Bring back fallbackIcon property
This commit is contained in:
parent
95f10443ef
commit
31508f2907
|
@ -63,6 +63,17 @@ void ToolButton::setThemeIcon(const QString &icon)
|
||||||
setIcon(QIcon::fromTheme(m_themeIcon));
|
setIcon(QIcon::fromTheme(m_themeIcon));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIcon ToolButton::fallbackIcon() const
|
||||||
|
{
|
||||||
|
return icon();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ToolButton::setFallbackIcon(const QIcon &fallbackIcon)
|
||||||
|
{
|
||||||
|
if (icon().isNull())
|
||||||
|
setIcon(fallbackIcon);
|
||||||
|
}
|
||||||
|
|
||||||
QIcon ToolButton::icon() const
|
QIcon ToolButton::icon() const
|
||||||
{
|
{
|
||||||
return QToolButton::icon();
|
return QToolButton::icon();
|
||||||
|
|
|
@ -33,6 +33,7 @@ class QUPZILLA_EXPORT ToolButton : public QToolButton
|
||||||
Q_PROPERTY(QImage multiIcon READ multiIcon WRITE setMultiIcon)
|
Q_PROPERTY(QImage multiIcon READ multiIcon WRITE setMultiIcon)
|
||||||
Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
|
Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
|
||||||
Q_PROPERTY(QString themeIcon READ themeIcon WRITE setThemeIcon)
|
Q_PROPERTY(QString themeIcon READ themeIcon WRITE setThemeIcon)
|
||||||
|
Q_PROPERTY(QIcon fallbackIcon READ fallbackIcon WRITE setFallbackIcon)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit ToolButton(QWidget* parent = 0);
|
explicit ToolButton(QWidget* parent = 0);
|
||||||
|
@ -45,6 +46,10 @@ public:
|
||||||
QString themeIcon() const;
|
QString themeIcon() const;
|
||||||
void setThemeIcon(const QString &icon);
|
void setThemeIcon(const QString &icon);
|
||||||
|
|
||||||
|
// FallbackIcon - In case theme doesn't contain ThemeIcon
|
||||||
|
QIcon fallbackIcon() const;
|
||||||
|
void setFallbackIcon(const QIcon &fallbackIcon);
|
||||||
|
|
||||||
// Icon - Standard QToolButton with icon
|
// Icon - Standard QToolButton with icon
|
||||||
QIcon icon() const;
|
QIcon icon() const;
|
||||||
void setIcon(const QIcon &icon);
|
void setIcon(const QIcon &icon);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user