Add shade property and changed signal to KDecoration

Replaces the pure virtual method which the Decoration had to
implement. Instead the Decoration can now connect to the signal.

For KCommonDecoration there is no change at all except that the
invoked method is turned into a slot.
icc-effect-5.14.5
Martin Gräßlin 2013-08-23 17:06:57 +02:00
parent fd64a29f72
commit 63bb36e2ad
8 changed files with 9 additions and 22 deletions

View File

@ -428,7 +428,7 @@ void Client::createDecoration(const QRect& oldgeom)
} else {
decoration = decorationPlugin()->createDecoration(bridge);
}
connect(this, SIGNAL(shadeChanged()), decoration, SLOT(shadeChange()));
connect(this, &Client::shadeChanged, decoration, &KDecoration::shadeChanged);
connect(this, &Client::desktopChanged, decoration, &KDecoration::desktopChanged);
connect(this, &Client::captionChanged, decoration, &KDecoration::captionChanged);
connect(this, &Client::activeChanged, decoration, &KDecoration::activeChanged);

View File

@ -327,11 +327,6 @@ void AuroraeClient::resize(const QSize &s)
widget()->resize(s);
}
void AuroraeClient::shadeChange()
{
emit shadeChanged();
}
void AuroraeClient::borders(int &left, int &right, int &top, int &bottom) const
{
if (!m_item) {

View File

@ -97,8 +97,6 @@ class AuroraeClient : public KDecoration
Q_PROPERTY(bool moveable READ isMovable CONSTANT)
Q_PROPERTY(bool preview READ isPreview CONSTANT)
Q_PROPERTY(bool resizeable READ isResizable CONSTANT)
Q_PROPERTY(bool setShade READ isSetShade NOTIFY shadeChanged)
Q_PROPERTY(bool shade READ isShade WRITE setShade NOTIFY shadeChanged)
Q_PROPERTY(bool shadeable READ isShadeable)
Q_PROPERTY(bool keepAbove READ keepAbove WRITE setKeepAbove NOTIFY keepAboveChangedWrapper)
Q_PROPERTY(bool keepBelow READ keepBelow WRITE setKeepBelow NOTIFY keepBelowChangedWrapper)
@ -122,7 +120,6 @@ public:
virtual QSize minimumSize() const;
virtual Position mousePosition(const QPoint& p) const;
virtual void resize(const QSize& s);
virtual void shadeChange();
// optional overrides
virtual void padding(int &left, int &right, int &top, int &bottom) const;
bool isMaximized() const;
@ -135,7 +132,6 @@ public:
Q_SIGNALS:
void iconChanged();
void maximizeChanged();
void shadeChanged();
void keepAboveChangedWrapper();
void keepBelowChangedWrapper();
void buttonsChanged();

View File

@ -60,6 +60,7 @@ KCommonDecoration::KCommonDecoration(KDecorationBridge* bridge, KDecorationFacto
connect(wrapper, &KDecoration::activeChanged, this, &KCommonDecoration::activeChange);
connect(wrapper, &KDecoration::captionChanged, this, &KCommonDecoration::captionChange);
connect(wrapper, &KDecoration::desktopChanged, this, &KCommonDecoration::desktopChange);
connect(wrapper, &KDecoration::shadeChanged, this, &KCommonDecoration::shadeChange);
}
KCommonDecoration::~KCommonDecoration()

View File

@ -257,12 +257,12 @@ public:
virtual void resize(const QSize& s);
virtual QSize minimumSize() const;
virtual void maximizeChange();
virtual void shadeChange();
virtual void iconChange();
public Q_SLOTS:
virtual void activeChange();
virtual void captionChange();
virtual void desktopChange();
virtual void shadeChange();
void keepAboveChange(bool above);
void keepBelowChange(bool below);
void slotMaximize();

View File

@ -78,11 +78,6 @@ void KCommonDecorationWrapper::maximizeChange()
return decoration->maximizeChange();
}
void KCommonDecorationWrapper::shadeChange()
{
return decoration->shadeChange();
}
bool KCommonDecorationWrapper::drawbound(const QRect& geom, bool clear)
{
return decoration->drawbound(geom, clear);

View File

@ -51,7 +51,6 @@ public:
virtual QSize minimumSize() const;
virtual void iconChange();
virtual void maximizeChange();
virtual void shadeChange();
virtual bool drawbound(const QRect& geom, bool clear);
virtual bool windowDocked(Position side);

View File

@ -494,6 +494,7 @@ class KWIN_EXPORT KDecoration
Q_PROPERTY(QString caption READ caption NOTIFY captionChanged)
Q_PROPERTY(int desktop READ desktop WRITE setDesktop NOTIFY desktopChanged)
Q_PROPERTY(bool onAllDesktops READ isOnAllDesktops NOTIFY desktopChanged)
Q_PROPERTY(bool setShade READ isSetShade NOTIFY shadeChanged)
public:
/**
* Constructs a KDecoration object. Both the arguments are passed from
@ -827,11 +828,6 @@ public Q_SLOTS:
* Use maximizeMode() to get the current state.
*/
virtual void maximizeChange() = 0;
/**
* This function is called whenever the window is shaded or unshaded. Use
* isShade() to get the current state.
*/
virtual void shadeChange() = 0;
Q_SIGNALS:
/**
@ -849,6 +845,11 @@ Q_SIGNALS:
* on which the window is.
*/
void desktopChanged();
/**
* This signal is emitted whenever the window is shaded or unshaded. Use
* isShade() to get the current state.
*/
void shadeChanged();
/**
* This signal is emitted whenever the window's keep-above state changes.
*/