* move the header bits around a bit for a more logical ordering (e.g. all static methods together, all reimp'd methods that are really imp details together at the bottom, etc)
* implement a generic shape() method. this is experimental, so will be interesting to see how it goes. it does show we need a good shape hint in the applet background svg =) svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=760187
This commit is contained in:
parent
8801af70e5
commit
16dab9574f
@ -829,6 +829,15 @@ QRectF Applet::boundingRect() const
|
|||||||
return rect.adjusted(-left,-top,right,bottom);
|
return rect.adjusted(-left,-top,right,bottom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPainterPath Applet::shape() const
|
||||||
|
{
|
||||||
|
if (isContainment()) {
|
||||||
|
return Plasma::Widget::shape();
|
||||||
|
}
|
||||||
|
|
||||||
|
return Plasma::roundedRectangle(boundingRect().adjusted(-2, -2, 2, 2), 10);
|
||||||
|
}
|
||||||
|
|
||||||
QSizeF Applet::sizeHint() const
|
QSizeF Applet::sizeHint() const
|
||||||
{
|
{
|
||||||
int left = 0;
|
int left = 0;
|
||||||
|
99
applet.h
99
applet.h
@ -349,11 +349,6 @@ class PLASMA_EXPORT Applet : public Widget
|
|||||||
*/
|
*/
|
||||||
static QStringList knownCategories(const QString &parentApp = QString(), bool visibleOnly = true);
|
static QStringList knownCategories(const QString &parentApp = QString(), bool visibleOnly = true);
|
||||||
|
|
||||||
/**
|
|
||||||
* @return true if this plasmoid provides a GUI configuration
|
|
||||||
**/
|
|
||||||
bool hasConfigurationInterface();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Attempts to load an applet
|
* Attempts to load an applet
|
||||||
*
|
*
|
||||||
@ -385,6 +380,20 @@ class PLASMA_EXPORT Applet : public Widget
|
|||||||
static Applet* loadApplet(const KPluginInfo& info, uint appletId = 0,
|
static Applet* loadApplet(const KPluginInfo& info, uint appletId = 0,
|
||||||
const QVariantList& args = QVariantList());
|
const QVariantList& args = QVariantList());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the category of the given applet
|
||||||
|
*
|
||||||
|
* @param a KPluginInfo object for the applet
|
||||||
|
*/
|
||||||
|
static QString category(const KPluginInfo& applet);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get the category of the given applet
|
||||||
|
*
|
||||||
|
* @param the name of the applet
|
||||||
|
*/
|
||||||
|
static QString category(const QString& appletName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method is called when the interface should be painted.
|
* This method is called when the interface should be painted.
|
||||||
*
|
*
|
||||||
@ -434,20 +443,6 @@ class PLASMA_EXPORT Applet : public Widget
|
|||||||
*/
|
*/
|
||||||
QColor color() const;
|
QColor color() const;
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the category of the given applet
|
|
||||||
*
|
|
||||||
* @param a KPluginInfo object for the applet
|
|
||||||
*/
|
|
||||||
static QString category(const KPluginInfo& applet);
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get the category of the given applet
|
|
||||||
*
|
|
||||||
* @param the name of the applet
|
|
||||||
*/
|
|
||||||
static QString category(const QString& appletName);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return true if this applet is immutable
|
* @return true if this applet is immutable
|
||||||
**/
|
**/
|
||||||
@ -512,17 +507,22 @@ class PLASMA_EXPORT Applet : public Widget
|
|||||||
* or false if it doesn't
|
* or false if it doesn't
|
||||||
*/
|
*/
|
||||||
void setNeedsConfiguring(bool needsConfiguring);
|
void setNeedsConfiguring(bool needsConfiguring);
|
||||||
enum { Type = Plasma::AppletType };
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reimplemented from QGraphicsItem
|
* @return true if this plasmoid provides a GUI configuration
|
||||||
**/
|
**/
|
||||||
int type() const;
|
bool hasConfigurationInterface();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Reimplemented from QGraphicsItem
|
* Sets whether or not this applet provides a user interface for
|
||||||
|
* configuring the applet.
|
||||||
|
*
|
||||||
|
* It defaults to false, and if true is passed in you should
|
||||||
|
* also reimplement showConfigurationInterface()
|
||||||
|
*
|
||||||
|
* @arg hasInterface whether or not there is a user interface available
|
||||||
**/
|
**/
|
||||||
QRectF boundingRect () const;
|
void setHasConfigurationInterface(bool hasInterface);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns a list of context-related QAction instances.
|
* Returns a list of context-related QAction instances.
|
||||||
@ -539,22 +539,12 @@ class PLASMA_EXPORT Applet : public Widget
|
|||||||
* Sets shadow for the given applet.
|
* Sets shadow for the given applet.
|
||||||
*/
|
*/
|
||||||
void setShadowShown(bool);
|
void setShadowShown(bool);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns true if the given item has a shadow shown.
|
* Returns true if the given item has a shadow shown.
|
||||||
*/
|
*/
|
||||||
bool isShadowShown() const;
|
bool isShadowShown() const;
|
||||||
|
|
||||||
// reimplemented from LayoutItem
|
|
||||||
// value is the same as contentSizeHint() if drawStandardBackground() is false
|
|
||||||
// or contentSizeHint() plus the size of the border otherwise.
|
|
||||||
virtual QSizeF sizeHint() const;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets the geometry of this Plasma::Applet
|
|
||||||
* @param geometry the geometry to apply to this Plasma::Applet.
|
|
||||||
*/
|
|
||||||
void setGeometry(const QRectF &geometry);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sets whether or not this Applet is acting as a Containment
|
* Sets whether or not this Applet is acting as a Containment
|
||||||
*/
|
*/
|
||||||
@ -565,6 +555,34 @@ class PLASMA_EXPORT Applet : public Widget
|
|||||||
*/
|
*/
|
||||||
bool isContainment() const;
|
bool isContainment() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Sets the geometry of this Plasma::Applet. Should not be used directly by
|
||||||
|
* applet subclasses.
|
||||||
|
* @param geometry the geometry to apply to this Plasma::Applet.
|
||||||
|
*/
|
||||||
|
void setGeometry(const QRectF &geometry);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented from LayoutItem
|
||||||
|
*/
|
||||||
|
virtual QSizeF sizeHint() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented from QGraphicsItem
|
||||||
|
**/
|
||||||
|
int type() const;
|
||||||
|
enum { Type = Plasma::AppletType };
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented from QGraphicsItem
|
||||||
|
**/
|
||||||
|
QRectF boundingRect() const;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reimplemented from QGraphicsItem
|
||||||
|
*/
|
||||||
|
QPainterPath shape() const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
@ -678,17 +696,6 @@ class PLASMA_EXPORT Applet : public Widget
|
|||||||
*/
|
*/
|
||||||
void needsFocus(bool focus);
|
void needsFocus(bool focus);
|
||||||
|
|
||||||
/**
|
|
||||||
* Sets whether or not this applet provides a user interface for
|
|
||||||
* configuring the applet.
|
|
||||||
*
|
|
||||||
* It defaults to false, and if true is passed in you should
|
|
||||||
* also reimplement showConfigurationInterface()
|
|
||||||
*
|
|
||||||
* @arg hasInterface whether or not there is a user interface available
|
|
||||||
**/
|
|
||||||
void setHasConfigurationInterface(bool hasInterface);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @internal event filter; used for focus watching
|
* @internal event filter; used for focus watching
|
||||||
**/
|
**/
|
||||||
|
Loading…
Reference in New Issue
Block a user