Expose the screenGeometry on the applet interface
It's useful to be able to figure out information about the current screen without having to ask the corona.
This commit is contained in:
parent
549fb7ce51
commit
8ab91f219d
@ -460,6 +460,11 @@ int AppletInterface::screen() const
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QRect AppletInterface::screenGeometry() const
|
||||||
|
{
|
||||||
|
return applet()->containment()->corona()->screenGeometry(applet()->containment()->screen());
|
||||||
|
}
|
||||||
|
|
||||||
void AppletInterface::setHideOnWindowDeactivate(bool hide)
|
void AppletInterface::setHideOnWindowDeactivate(bool hide)
|
||||||
{
|
{
|
||||||
if (m_hideOnDeactivate != hide) {
|
if (m_hideOnDeactivate != hide) {
|
||||||
|
@ -150,6 +150,12 @@ class AppletInterface : public PlasmaQuick::AppletQuickItem
|
|||||||
// would be preferrable if found.
|
// would be preferrable if found.
|
||||||
Q_PROPERTY(int screen READ screen NOTIFY screenChanged)
|
Q_PROPERTY(int screen READ screen NOTIFY screenChanged)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Provides access to the geometry of the applet is in.
|
||||||
|
* Can be useful to figure out what's the absolute position of the applet.
|
||||||
|
*/
|
||||||
|
Q_PROPERTY(QRect screenGeometry READ screenGeometry NOTIFY screenChanged)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Whether the dialog should be hidden when the dialog loses focus.
|
* Whether the dialog should be hidden when the dialog loses focus.
|
||||||
*
|
*
|
||||||
@ -273,6 +279,7 @@ public:
|
|||||||
Plasma::Types::ItemStatus status() const;
|
Plasma::Types::ItemStatus status() const;
|
||||||
|
|
||||||
int screen() const;
|
int screen() const;
|
||||||
|
QRect screenGeometry() const;
|
||||||
|
|
||||||
bool immutable() const;
|
bool immutable() const;
|
||||||
bool userConfiguring() const;
|
bool userConfiguring() const;
|
||||||
|
Loading…
Reference in New Issue
Block a user