icon in popup, plasmoid exposes icon and title
This commit is contained in:
parent
dc814d02d2
commit
21d96f9dbf
@ -107,6 +107,26 @@ QString AppletInterface::currentActivity() const
|
|||||||
return applet()->containment()->activity();
|
return applet()->containment()->activity();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QString AppletInterface::icon() const
|
||||||
|
{
|
||||||
|
return applet()->icon();
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AppletInterface::title() const
|
||||||
|
{
|
||||||
|
return applet()->title();
|
||||||
|
}
|
||||||
|
|
||||||
|
void AppletInterface::setTitle(const QString &title)
|
||||||
|
{
|
||||||
|
if (applet()->title() == title) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
applet()->setTitle(title);
|
||||||
|
emit titleChanged();
|
||||||
|
}
|
||||||
|
|
||||||
bool AppletInterface::isBusy() const
|
bool AppletInterface::isBusy() const
|
||||||
{
|
{
|
||||||
return m_busy;
|
return m_busy;
|
||||||
|
@ -52,6 +52,9 @@ class AppletInterface : public QQuickItem
|
|||||||
Q_ENUMS(ThemeColors)
|
Q_ENUMS(ThemeColors)
|
||||||
Q_ENUMS(ItemStatus)
|
Q_ENUMS(ItemStatus)
|
||||||
|
|
||||||
|
Q_PROPERTY(QString title READ title WRITE setTitle NOTIFY titleChanged)
|
||||||
|
//TODO: writable icon
|
||||||
|
Q_PROPERTY(QString icon READ icon CONSTANT)
|
||||||
Q_PROPERTY(FormFactor formFactor READ formFactor NOTIFY formFactorChanged)
|
Q_PROPERTY(FormFactor formFactor READ formFactor NOTIFY formFactorChanged)
|
||||||
Q_PROPERTY(Location location READ location NOTIFY locationChanged)
|
Q_PROPERTY(Location location READ location NOTIFY locationChanged)
|
||||||
Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY contextChanged)
|
Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY contextChanged)
|
||||||
@ -170,6 +173,11 @@ enum IntervalAlignment {
|
|||||||
|
|
||||||
|
|
||||||
//PROPERTY ACCESSORS-------------------------------------------------------------------
|
//PROPERTY ACCESSORS-------------------------------------------------------------------
|
||||||
|
QString icon() const;
|
||||||
|
|
||||||
|
QString title() const;
|
||||||
|
void setTitle(const QString &title);
|
||||||
|
|
||||||
FormFactor formFactor() const;
|
FormFactor formFactor() const;
|
||||||
|
|
||||||
Location location() const;
|
Location location() const;
|
||||||
@ -203,6 +211,7 @@ Q_SIGNALS:
|
|||||||
void configNeedsSaving();
|
void configNeedsSaving();
|
||||||
|
|
||||||
//PROPERTY change notifiers--------------
|
//PROPERTY change notifiers--------------
|
||||||
|
void titleChanged();
|
||||||
void formFactorChanged();
|
void formFactorChanged();
|
||||||
void locationChanged();
|
void locationChanged();
|
||||||
void contextChanged();
|
void contextChanged();
|
||||||
|
@ -20,12 +20,17 @@ import QtQuick 2.0
|
|||||||
|
|
||||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||||
|
|
||||||
Rectangle {
|
PlasmaCore.IconItem {
|
||||||
id: root
|
id: icon
|
||||||
color: "darkgreen"
|
|
||||||
|
source: plasmoid.icon ? plasmoid.icon : "plasma"
|
||||||
|
active: mouseArea.containsMouse
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
|
id: mouseArea
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
onClicked: plasmoid.expanded = !plasmoid.expanded
|
onClicked: plasmoid.expanded = !plasmoid.expanded
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user