Move maxSize and minSize to AbstractClient
With a default implementation returning either a INT_MAX size or 0.
This commit is contained in:
parent
ffd6f9ceba
commit
f16644ac2e
3 changed files with 22 additions and 10 deletions
|
@ -448,4 +448,14 @@ void AbstractClient::keepInArea(QRect area, bool partial)
|
|||
move(tx, ty);
|
||||
}
|
||||
|
||||
QSize AbstractClient::maxSize() const
|
||||
{
|
||||
return rules()->checkMaxSize(QSize(INT_MAX, INT_MAX));
|
||||
}
|
||||
|
||||
QSize AbstractClient::minSize() const
|
||||
{
|
||||
return rules()->checkMinSize(QSize(0, 0));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -131,6 +131,14 @@ class AbstractClient : public Toplevel
|
|||
* To read only the caption as provided by WM_NAME, use the getter with an additional @c false value.
|
||||
**/
|
||||
Q_PROPERTY(QString caption READ caption NOTIFY captionChanged)
|
||||
/**
|
||||
* Minimum size as specified in WM_NORMAL_HINTS
|
||||
**/
|
||||
Q_PROPERTY(QSize minSize READ minSize)
|
||||
/**
|
||||
* Maximum size as specified in WM_NORMAL_HINTS
|
||||
**/
|
||||
Q_PROPERTY(QSize maxSize READ maxSize)
|
||||
public:
|
||||
virtual ~AbstractClient();
|
||||
|
||||
|
@ -311,6 +319,8 @@ public:
|
|||
virtual void resizeWithChecks(int w, int h, ForceGeometry_t force = NormalGeometrySet) = 0;
|
||||
void resizeWithChecks(const QSize& s, ForceGeometry_t force = NormalGeometrySet);
|
||||
void keepInArea(QRect area, bool partial = false);
|
||||
virtual QSize minSize() const;
|
||||
virtual QSize maxSize() const;
|
||||
|
||||
// TODO: remove boolean trap
|
||||
static bool belongToSameApplication(const AbstractClient* c1, const AbstractClient* c2, bool active_hack = false);
|
||||
|
|
12
client.h
12
client.h
|
@ -164,14 +164,6 @@ class Client
|
|||
* The "Window Tabs" Group this Client belongs to.
|
||||
**/
|
||||
Q_PROPERTY(KWin::TabGroup* tabGroup READ tabGroup NOTIFY tabGroupChanged SCRIPTABLE false)
|
||||
/**
|
||||
* Minimum size as specified in WM_NORMAL_HINTS
|
||||
**/
|
||||
Q_PROPERTY(QSize minSize READ minSize)
|
||||
/**
|
||||
* Maximum size as specified in WM_NORMAL_HINTS
|
||||
**/
|
||||
Q_PROPERTY(QSize maxSize READ maxSize)
|
||||
/**
|
||||
* Whether the window has a decoration or not.
|
||||
* This property is not allowed to be set by applications themselves.
|
||||
|
@ -229,8 +221,8 @@ public:
|
|||
|
||||
bool hasNETSupport() const;
|
||||
|
||||
QSize minSize() const;
|
||||
QSize maxSize() const;
|
||||
QSize minSize() const override;
|
||||
QSize maxSize() const override;
|
||||
QSize basicUnit() const;
|
||||
virtual QPoint clientPos() const; // Inside of geometry()
|
||||
virtual QSize clientSize() const;
|
||||
|
|
Loading…
Reference in a new issue