Shade related properties

Adding a convenient method to set a client to shade ignoring the
hover state.
This commit is contained in:
Martin Gräßlin 2011-12-22 18:10:18 +01:00
parent 938c94d7cc
commit 20284fb7bb
2 changed files with 15 additions and 3 deletions

View file

@ -1064,6 +1064,10 @@ bool Client::isShadeable() const
return !isSpecialWindow() && !noBorder() && (rules()->checkShade(ShadeNormal) != rules()->checkShade(ShadeNone));
}
void Client::setShade(bool set) {
set ? setShade(ShadeNormal) : setShade(ShadeNone);
}
void Client::setShade(ShadeMode mode)
{
if (isSpecialWindow() || noBorder())
@ -1138,6 +1142,7 @@ void Client::setShade(ShadeMode mode)
// Update states of all other windows in this group
if (clientGroup())
clientGroup()->updateStates(this);
emit shadeChanged();
}
void Client::shadeHover()

View file

@ -125,10 +125,15 @@ class Client
**/
Q_PROPERTY(bool providesContextHelp READ providesContextHelp CONSTANT)
Q_PROPERTY(bool resizeable READ isResizable)
// TODO: notify signal
/**
* Whether the Client can be shaded. The property is evaluated each time it is invoked.
* Because of that there is no notify signal.
**/
Q_PROPERTY(bool shadeable READ isShadeable)
// TODO: proper setShade method and notifiy signal
Q_PROPERTY(bool shade READ isShade)
/**
* Whether the Client is shaded.
**/
Q_PROPERTY(bool shade READ isShade WRITE setShade NOTIFY shadeChanged)
/**
* Whether the Client is a transient Window to another Window.
* @see transientFor
@ -229,6 +234,7 @@ public:
bool isShade() const; // True only for ShadeNormal
ShadeMode shadeMode() const; // Prefer isShade()
void setShade(bool set);
void setShade(ShadeMode mode);
bool isShadeable() const;
@ -555,6 +561,7 @@ signals:
void fullScreenChanged();
void transientChanged();
void modalChanged();
void shadeChanged();
private:
void exportMappingState(int s); // ICCCM 4.1.3.1, 4.1.4, NETWM 2.5.1