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)
|
||||
|
||||
/**
|
||||
* 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
|
||||
@ -288,4 +299,5 @@ Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Constraints)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::Flip)
|
||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Plasma::ComponentTypes)
|
||||
|
||||
|
||||
#endif // multiple inclusion guard
|
||||
|
@ -481,6 +481,17 @@ bool PopupApplet::isPopupShowing() const
|
||||
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)
|
||||
: q(applet),
|
||||
icon(0),
|
||||
@ -489,6 +500,7 @@ PopupAppletPrivate::PopupAppletPrivate(PopupApplet *applet)
|
||||
popupPlacement(Plasma::FloatingPopup),
|
||||
savedAspectRatio(Plasma::InvalidAspectRatioMode),
|
||||
timer(0),
|
||||
itemStatus(UnknownStatus),
|
||||
popupLostFocus(false),
|
||||
passive(false)
|
||||
{
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include <plasma/applet.h>
|
||||
#include <plasma/plasma_export.h>
|
||||
#include <plasma/plasma.h>
|
||||
|
||||
class QGraphicsProxyWidget;
|
||||
class QGraphicsLinearLayout;
|
||||
@ -107,6 +108,9 @@ public:
|
||||
*/
|
||||
bool isPopupShowing() const;
|
||||
|
||||
ItemStatus status();
|
||||
void setStatus(ItemStatus stat);
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* Hides the popup.
|
||||
@ -142,6 +146,9 @@ protected:
|
||||
void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
|
||||
void dropEvent(QGraphicsSceneDragDropEvent *event);
|
||||
|
||||
Q_SIGNALS:
|
||||
void newStatus(ItemStatus status);
|
||||
|
||||
private:
|
||||
Q_PRIVATE_SLOT(d, void internalTogglePopup())
|
||||
Q_PRIVATE_SLOT(d, void hideTimedPopup())
|
||||
|
@ -20,6 +20,8 @@
|
||||
#ifndef POPUPAPPLET_P_H
|
||||
#define POPUPAPPLET_P_H
|
||||
|
||||
#include <plasma/plasma.h>
|
||||
|
||||
namespace Plasma
|
||||
{
|
||||
|
||||
@ -46,6 +48,7 @@ public:
|
||||
Plasma::AspectRatioMode savedAspectRatio;
|
||||
QTimer *timer;
|
||||
QPoint clicked;
|
||||
ItemStatus itemStatus;
|
||||
bool popupLostFocus : 1;
|
||||
bool passive : 1;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user