mirror of
https://invent.kde.org/network/falkon.git
synced 2024-12-20 02:36:34 +01:00
[Linux theme] New icon for search button in searchbar.
Use "edit-find" icon for theme, if there is no such icon, the old one will be used.
This commit is contained in:
parent
992c7a4de1
commit
6ebfee73ba
@ -201,6 +201,7 @@ IconProvider
|
||||
margin-bottom:2px;
|
||||
margin-right: 2px;
|
||||
qproperty-pixmap: url(images/search-icon.png);
|
||||
qproperty-themeIcon: "edit-find";
|
||||
}
|
||||
|
||||
#websearchbar-searchprovider-comobobox
|
||||
|
@ -18,12 +18,27 @@
|
||||
#include "clickablelabel.h"
|
||||
|
||||
#include <QMouseEvent>
|
||||
#include <QIcon>
|
||||
|
||||
ClickableLabel::ClickableLabel(QWidget* parent)
|
||||
: QLabel(parent)
|
||||
{
|
||||
}
|
||||
|
||||
void ClickableLabel::setThemeIcon(const QString &name)
|
||||
{
|
||||
QIcon icon(name);
|
||||
|
||||
if (!icon.isNull()) {
|
||||
setPixmap(icon.pixmap(size()));
|
||||
}
|
||||
}
|
||||
|
||||
QString ClickableLabel::themeIcon() const
|
||||
{
|
||||
return m_themeIcon;
|
||||
}
|
||||
|
||||
void ClickableLabel::mouseReleaseEvent(QMouseEvent* ev)
|
||||
{
|
||||
if (ev->button() == Qt::LeftButton && rect().contains(ev->pos())) {
|
||||
|
@ -30,10 +30,14 @@ class QT_QUPZILLA_EXPORT ClickableLabel : public QLabel
|
||||
Q_PROPERTY(QSize fixedsize READ size WRITE setFixedSize)
|
||||
Q_PROPERTY(int fixedwidth READ width WRITE setFixedWidth)
|
||||
Q_PROPERTY(int fixedheight READ height WRITE setFixedHeight)
|
||||
Q_PROPERTY(QString themeIcon READ themeIcon WRITE setThemeIcon)
|
||||
|
||||
public:
|
||||
explicit ClickableLabel(QWidget* parent = 0);
|
||||
|
||||
void setThemeIcon(const QString &name);
|
||||
QString themeIcon() const;
|
||||
|
||||
signals:
|
||||
void clicked(QPoint);
|
||||
void middleClicked(QPoint);
|
||||
@ -41,6 +45,8 @@ signals:
|
||||
private:
|
||||
void mouseReleaseEvent(QMouseEvent* ev);
|
||||
|
||||
QString m_themeIcon;
|
||||
|
||||
};
|
||||
|
||||
#endif // CLICKABLELABEL_H
|
||||
|
Loading…
Reference in New Issue
Block a user