Add availableScreenRect(int id) to ContainmentInterface
Now plasmoids can simply get the available screen rect
This commit is contained in:
parent
699057ad33
commit
62d35541ed
@ -81,7 +81,9 @@ ContainmentInterface::ContainmentInterface(DeclarativeAppletScript *parent)
|
||||
if (containment()->corona()) {
|
||||
connect(containment()->corona(), &Plasma::Corona::availableScreenRegionChanged,
|
||||
this, &ContainmentInterface::availableScreenRegionChanged);
|
||||
}
|
||||
connect(containment()->corona(), &Plasma::Corona::availableScreenRectChanged,
|
||||
this, &ContainmentInterface::availableScreenRectChanged);
|
||||
}
|
||||
|
||||
if (!m_appletInterfaces.isEmpty()) {
|
||||
emit appletsChanged();
|
||||
@ -193,6 +195,16 @@ QVariantList ContainmentInterface::availableScreenRegion(int id) const
|
||||
return regVal;
|
||||
}
|
||||
|
||||
QRect ContainmentInterface::availableScreenRect(int id) const
|
||||
{
|
||||
QRect rect;
|
||||
if (containment()->corona()) {
|
||||
rect = containment()->corona()->availableScreenRect(id);
|
||||
}
|
||||
|
||||
return rect;
|
||||
}
|
||||
|
||||
Plasma::Applet *ContainmentInterface::addApplet(const QString &plugin, const QVariantList &args, const QPoint &pos)
|
||||
{
|
||||
//HACK
|
||||
|
@ -100,6 +100,12 @@ public:
|
||||
*/
|
||||
Q_INVOKABLE QVariantList availableScreenRegion(int id) const;
|
||||
|
||||
/**
|
||||
* The available rect of this screen, panels excluded. A simple rect area
|
||||
* For more precise available geometry use availableScreenRegion()
|
||||
*/
|
||||
Q_INVOKABLE QRect availableScreenRect(int id) const;
|
||||
|
||||
/**
|
||||
* Process the mime data arrived to a particular coordinate, either with a drag and drop or paste with middle mouse button
|
||||
*/
|
||||
@ -139,6 +145,7 @@ Q_SIGNALS:
|
||||
void activityChanged();
|
||||
void activityNameChanged();
|
||||
void availableScreenRegionChanged();
|
||||
void availableScreenRectChanged();
|
||||
void appletsChanged();
|
||||
void drawWallpaperChanged();
|
||||
void containmentTypeChanged();
|
||||
|
Loading…
Reference in New Issue
Block a user