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();
|
||||
}
|
||||
|
||||
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
|
||||
{
|
||||
return m_busy;
|
||||
|
@ -52,6 +52,9 @@ class AppletInterface : public QQuickItem
|
||||
Q_ENUMS(ThemeColors)
|
||||
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(Location location READ location NOTIFY locationChanged)
|
||||
Q_PROPERTY(QString currentActivity READ currentActivity NOTIFY contextChanged)
|
||||
@ -170,6 +173,11 @@ enum IntervalAlignment {
|
||||
|
||||
|
||||
//PROPERTY ACCESSORS-------------------------------------------------------------------
|
||||
QString icon() const;
|
||||
|
||||
QString title() const;
|
||||
void setTitle(const QString &title);
|
||||
|
||||
FormFactor formFactor() const;
|
||||
|
||||
Location location() const;
|
||||
@ -203,6 +211,7 @@ Q_SIGNALS:
|
||||
void configNeedsSaving();
|
||||
|
||||
//PROPERTY change notifiers--------------
|
||||
void titleChanged();
|
||||
void formFactorChanged();
|
||||
void locationChanged();
|
||||
void contextChanged();
|
||||
|
@ -20,12 +20,17 @@ import QtQuick 2.0
|
||||
|
||||
import org.kde.plasma.core 0.1 as PlasmaCore
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
color: "darkgreen"
|
||||
PlasmaCore.IconItem {
|
||||
id: icon
|
||||
|
||||
source: plasmoid.icon ? plasmoid.icon : "plasma"
|
||||
active: mouseArea.containsMouse
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
onClicked: plasmoid.expanded = !plasmoid.expanded
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user