Export displayWidth/height/size as properties of workspace

remotes/origin/Plasma/5.0
Martin Gräßlin 14 years ago
parent 55088ba776
commit cf5b70bd2c
  1. 15
      scripting/workspace_wrapper.cpp
  2. 15
      scripting/workspace_wrapper.h

@ -76,6 +76,21 @@ QSize WorkspaceWrapper::workspaceSize() const
return QSize(workspaceWidth(), workspaceHeight());
}
QSize WorkspaceWrapper::displaySize() const
{
return QSize(KWin::displayWidth(), KWin::displayHeight());
}
int WorkspaceWrapper::displayWidth() const
{
return KWin::displayWidth();
}
int WorkspaceWrapper::displayHeight() const
{
return KWin::displayWidth();
}
void WorkspaceWrapper::setupClientConnections(KWin::Client *client)
{
connect(client, SIGNAL(clientMinimized(KWin::Client*,bool)), SIGNAL(clientMinimized(KWin::Client*)));

@ -46,6 +46,18 @@ class WorkspaceWrapper : public QObject
* The number of desktops currently used. Minimum number of desktops is 1, maximum 20.
**/
Q_PROPERTY(int desktops READ numberOfDesktops WRITE setNumberOfDesktops NOTIFY numberDesktopsChanged)
/**
* The same of the display, that is all screens.
**/
Q_PROPERTY(QSize displaySize READ displaySize)
/**
* The width of the display, that is width of all combined screens.
**/
Q_PROPERTY(int displayWidth READ displayWidth)
/**
* The height of the display, that is height of all combined screens.
**/
Q_PROPERTY(int displayHeight READ displayHeight)
private:
Q_DISABLE_COPY(WorkspaceWrapper)
@ -86,6 +98,9 @@ void setter( rettype val );
int workspaceWidth() const;
int workspaceHeight() const;
QSize workspaceSize() const;
int displayWidth() const;
int displayHeight() const;
QSize displaySize() const;
Q_INVOKABLE QList< KWin::Client* > clientList() const;

Loading…
Cancel
Save