+contentSizeHint -> died
+contextActions -> contextualActions svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=801150
This commit is contained in:
parent
9316dbd0d5
commit
13f4fae5f3
@ -958,10 +958,10 @@ QPainterPath Applet::shape() const
|
|||||||
return Plasma::roundedRectangle(boundingRect().adjusted(-2, -2, 2, 2), 10);
|
return Plasma::roundedRectangle(boundingRect().adjusted(-2, -2, 2, 2), 10);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> Applet::contextActions()
|
QList<QAction*> Applet::contextualActions()
|
||||||
{
|
{
|
||||||
//kDebug() << "empty context actions";
|
//kDebug() << "empty context actions";
|
||||||
return d->script ? d->script->contextActions() : QList<QAction*>();
|
return d->script ? d->script->contextualActions() : QList<QAction*>();
|
||||||
}
|
}
|
||||||
|
|
||||||
QColor Applet::color() const
|
QColor Applet::color() const
|
||||||
|
2
applet.h
2
applet.h
@ -472,7 +472,7 @@ class PLASMA_EXPORT Applet : public QGraphicsWidget
|
|||||||
* @return A list of actions. The default implementation returns an
|
* @return A list of actions. The default implementation returns an
|
||||||
* empty list.
|
* empty list.
|
||||||
**/
|
**/
|
||||||
virtual QList<QAction*> contextActions();
|
virtual QList<QAction*> contextualActions();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets shadow for the given applet.
|
* Sets shadow for the given applet.
|
||||||
|
@ -267,7 +267,7 @@ void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
|
|||||||
if (applet) {
|
if (applet) {
|
||||||
bool hasEntries = false;
|
bool hasEntries = false;
|
||||||
|
|
||||||
QList<QAction*> actions = applet->contextActions();
|
QList<QAction*> actions = applet->contextualActions();
|
||||||
if (!actions.isEmpty()) {
|
if (!actions.isEmpty()) {
|
||||||
foreach(QAction* action, actions) {
|
foreach(QAction* action, actions) {
|
||||||
desktopMenu.addAction(action);
|
desktopMenu.addAction(action);
|
||||||
@ -284,7 +284,7 @@ void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
|
|||||||
hasEntries = true;
|
hasEntries = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> containmentActions = contextActions();
|
QList<QAction*> containmentActions = contextualActions();
|
||||||
if (!containmentActions.isEmpty()) {
|
if (!containmentActions.isEmpty()) {
|
||||||
if (hasEntries) {
|
if (hasEntries) {
|
||||||
desktopMenu.addSeparator();
|
desktopMenu.addSeparator();
|
||||||
@ -329,7 +329,7 @@ void Containment::contextMenuEvent(QGraphicsSceneContextMenuEvent* event)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> actions = contextActions();
|
QList<QAction*> actions = contextualActions();
|
||||||
|
|
||||||
if (actions.count() < 1) {
|
if (actions.count() < 1) {
|
||||||
//kDebug() << "no applet, but no actions";
|
//kDebug() << "no applet, but no actions";
|
||||||
|
@ -61,15 +61,10 @@ void AppletScript::paintInterface(QPainter* painter, const QStyleOptionGraphicsI
|
|||||||
Q_UNUSED(contentsRect)
|
Q_UNUSED(contentsRect)
|
||||||
}
|
}
|
||||||
|
|
||||||
QSizeF AppletScript::contentSizeHint() const
|
|
||||||
{
|
|
||||||
return applet()->boundingRect().size();
|
|
||||||
}
|
|
||||||
|
|
||||||
QSizeF AppletScript::size() const
|
QSizeF AppletScript::size() const
|
||||||
{
|
{
|
||||||
if (applet()) {
|
if (applet()) {
|
||||||
return applet()->boundingRect().size();
|
return applet()->size();
|
||||||
}
|
}
|
||||||
|
|
||||||
return QSizeF();
|
return QSizeF();
|
||||||
@ -80,7 +75,7 @@ void AppletScript::constraintsUpdated(Plasma::Constraints constraints)
|
|||||||
Q_UNUSED(constraints);
|
Q_UNUSED(constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<QAction*> AppletScript::contextActions()
|
QList<QAction*> AppletScript::contextualActions()
|
||||||
{
|
{
|
||||||
return QList<QAction*>();
|
return QList<QAction*>();
|
||||||
}
|
}
|
||||||
|
@ -72,12 +72,6 @@ public:
|
|||||||
const QStyleOptionGraphicsItem* option,
|
const QStyleOptionGraphicsItem* option,
|
||||||
const QRect &contentsRect);
|
const QRect &contentsRect);
|
||||||
|
|
||||||
/**
|
|
||||||
* Called to discover the content size hint for the item.
|
|
||||||
* The default implementation simply returns the Applet's contentSizeHint
|
|
||||||
*/
|
|
||||||
virtual QSizeF contentSizeHint() const;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the area within which contents can be painted.
|
* Returns the area within which contents can be painted.
|
||||||
**/
|
**/
|
||||||
@ -102,7 +96,7 @@ public:
|
|||||||
* @return A list of actions. The default implementation returns an
|
* @return A list of actions. The default implementation returns an
|
||||||
* empty list.
|
* empty list.
|
||||||
*/
|
*/
|
||||||
virtual QList<QAction*> contextActions();
|
virtual QList<QAction*> contextualActions();
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user