api to show/hide plasmoids from the systray, like NotificationItems
this REALLY needs api review CCMAIL:plasma-devel@kde.org svn path=/trunk/KDE/kdelibs/; revision=993364
This commit is contained in:
parent
c201a16450
commit
1300eea396
12
plasma.h
12
plasma.h
@ -250,6 +250,17 @@ enum MessageButton {
|
|||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(MessageButtons, MessageButton)
|
Q_DECLARE_FLAGS(MessageButtons, MessageButton)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Status of an applet...
|
||||||
|
* FIXME: this will have to move in PopupApplet? or find an api-less way?
|
||||||
|
*/
|
||||||
|
enum ItemStatus {
|
||||||
|
UnknownStatus = 0,
|
||||||
|
PassiveStatus = 1,
|
||||||
|
ActiveStatus = 2,
|
||||||
|
NeedsAttentionStatus = 3
|
||||||
|
};
|
||||||
|
Q_ENUMS(ItemStatus)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return the scaling factor (0..1) for a ZoomLevel
|
* @return the scaling factor (0..1) for a ZoomLevel
|
||||||
@ -288,4 +299,5 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints)
|
|||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip)
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes)
|
||||||
|
|
||||||
|
|
||||||
#endif // multiple inclusion guard
|
#endif // multiple inclusion guard
|
||||||
|
@ -481,6 +481,17 @@ bool PopupApplet::isPopupShowing() const
|
|||||||
return d->dialog && d->dialog->isVisible();
|
return d->dialog && d->dialog->isVisible();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ItemStatus PopupApplet::status()
|
||||||
|
{
|
||||||
|
return d->itemStatus;
|
||||||
|
}
|
||||||
|
|
||||||
|
void PopupApplet::setStatus(ItemStatus status)
|
||||||
|
{
|
||||||
|
d->itemStatus = status;
|
||||||
|
emit newStatus(status);
|
||||||
|
}
|
||||||
|
|
||||||
PopupAppletPrivate::PopupAppletPrivate(PopupApplet *applet)
|
PopupAppletPrivate::PopupAppletPrivate(PopupApplet *applet)
|
||||||
: q(applet),
|
: q(applet),
|
||||||
icon(0),
|
icon(0),
|
||||||
@ -489,6 +500,7 @@ PopupAppletPrivate::PopupAppletPrivate(PopupApplet *applet)
|
|||||||
popupPlacement(Plasma::FloatingPopup),
|
popupPlacement(Plasma::FloatingPopup),
|
||||||
savedAspectRatio(Plasma::InvalidAspectRatioMode),
|
savedAspectRatio(Plasma::InvalidAspectRatioMode),
|
||||||
timer(0),
|
timer(0),
|
||||||
|
itemStatus(UnknownStatus),
|
||||||
popupLostFocus(false),
|
popupLostFocus(false),
|
||||||
passive(false)
|
passive(false)
|
||||||
{
|
{
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <plasma/applet.h>
|
#include <plasma/applet.h>
|
||||||
#include <plasma/plasma_export.h>
|
#include <plasma/plasma_export.h>
|
||||||
|
#include <plasma/plasma.h>
|
||||||
|
|
||||||
class QGraphicsProxyWidget;
|
class QGraphicsProxyWidget;
|
||||||
class QGraphicsLinearLayout;
|
class QGraphicsLinearLayout;
|
||||||
@ -107,6 +108,9 @@ public:
|
|||||||
*/
|
*/
|
||||||
bool isPopupShowing() const;
|
bool isPopupShowing() const;
|
||||||
|
|
||||||
|
ItemStatus status();
|
||||||
|
void setStatus(ItemStatus stat);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
/**
|
/**
|
||||||
* Hides the popup.
|
* Hides the popup.
|
||||||
@ -142,6 +146,9 @@ protected:
|
|||||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||||
void dropEvent(QGraphicsSceneDragDropEvent *event);
|
void dropEvent(QGraphicsSceneDragDropEvent *event);
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void newStatus(ItemStatus status);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q_PRIVATE_SLOT(d, void internalTogglePopup())
|
Q_PRIVATE_SLOT(d, void internalTogglePopup())
|
||||||
Q_PRIVATE_SLOT(d, void hideTimedPopup())
|
Q_PRIVATE_SLOT(d, void hideTimedPopup())
|
||||||
|
@ -20,6 +20,8 @@
|
|||||||
#ifndef POPUPAPPLET_P_H
|
#ifndef POPUPAPPLET_P_H
|
||||||
#define POPUPAPPLET_P_H
|
#define POPUPAPPLET_P_H
|
||||||
|
|
||||||
|
#include <plasma/plasma.h>
|
||||||
|
|
||||||
namespace Plasma
|
namespace Plasma
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -46,6 +48,7 @@ public:
|
|||||||
Plasma::AspectRatioMode savedAspectRatio;
|
Plasma::AspectRatioMode savedAspectRatio;
|
||||||
QTimer *timer;
|
QTimer *timer;
|
||||||
QPoint clicked;
|
QPoint clicked;
|
||||||
|
ItemStatus itemStatus;
|
||||||
bool popupLostFocus : 1;
|
bool popupLostFocus : 1;
|
||||||
bool passive : 1;
|
bool passive : 1;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user