Add caption 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
This commit is contained in:
parent
e1c4512ccc
commit
29bce13e9f
8 changed files with 8 additions and 20 deletions
|
@ -430,7 +430,7 @@ void Client::createDecoration(const QRect& oldgeom)
|
|||
}
|
||||
connect(this, SIGNAL(shadeChanged()), decoration, SLOT(shadeChange()));
|
||||
connect(this, SIGNAL(desktopChanged()), decoration, SLOT(desktopChange()));
|
||||
connect(this, SIGNAL(captionChanged()), decoration, SLOT(captionChange()));
|
||||
connect(this, &Client::captionChanged, decoration, &KDecoration::captionChanged);
|
||||
connect(this, &Client::activeChanged, decoration, &KDecoration::activeChanged);
|
||||
connect(this, SIGNAL(clientMaximizedStateChanged(KWin::Client*,KDecorationDefines::MaximizeMode)),
|
||||
decoration, SLOT(maximizeChange()));
|
||||
|
|
|
@ -306,11 +306,6 @@ bool AuroraeClient::eventFilter(QObject *object, QEvent *event)
|
|||
return false;
|
||||
}
|
||||
|
||||
void AuroraeClient::captionChange()
|
||||
{
|
||||
emit captionChanged();
|
||||
}
|
||||
|
||||
void AuroraeClient::iconChange()
|
||||
{
|
||||
emit iconChanged();
|
||||
|
|
|
@ -87,7 +87,6 @@ private:
|
|||
class AuroraeClient : public KDecoration
|
||||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QString caption READ caption NOTIFY captionChanged)
|
||||
Q_PROPERTY(int desktop READ desktop WRITE setDesktop NOTIFY desktopChanged)
|
||||
Q_PROPERTY(QRect geometry READ geometry)
|
||||
Q_PROPERTY(int height READ height)
|
||||
|
@ -119,7 +118,6 @@ public:
|
|||
virtual ~AuroraeClient();
|
||||
virtual bool eventFilter(QObject *object, QEvent *event);
|
||||
virtual void borders(int& left, int& right, int& top, int& bottom) const;
|
||||
virtual void captionChange();
|
||||
virtual void desktopChange();
|
||||
virtual void iconChange();
|
||||
virtual void init();
|
||||
|
@ -138,7 +136,6 @@ public:
|
|||
Q_INVOKABLE QVariant readConfig(const QString &key, const QVariant &defaultValue = QVariant());
|
||||
|
||||
Q_SIGNALS:
|
||||
void captionChanged();
|
||||
void desktopChanged();
|
||||
void iconChanged();
|
||||
void maximizeChanged();
|
||||
|
|
|
@ -58,6 +58,7 @@ KCommonDecoration::KCommonDecoration(KDecorationBridge* bridge, KDecorationFacto
|
|||
connect(wrapper, &KDecoration::decorationButtonsChanged,
|
||||
this, &KCommonDecoration::buttonsChanged);
|
||||
connect(wrapper, &KDecoration::activeChanged, this, &KCommonDecoration::activeChange);
|
||||
connect(wrapper, &KDecoration::captionChanged, this, &KCommonDecoration::captionChange);
|
||||
}
|
||||
|
||||
KCommonDecoration::~KCommonDecoration()
|
||||
|
|
|
@ -260,9 +260,9 @@ public:
|
|||
virtual void desktopChange();
|
||||
virtual void shadeChange();
|
||||
virtual void iconChange();
|
||||
virtual void captionChange();
|
||||
public Q_SLOTS:
|
||||
virtual void activeChange();
|
||||
virtual void captionChange();
|
||||
void keepAboveChange(bool above);
|
||||
void keepBelowChange(bool below);
|
||||
void slotMaximize();
|
||||
|
|
|
@ -68,11 +68,6 @@ QSize KCommonDecorationWrapper::minimumSize() const
|
|||
return decoration->minimumSize();
|
||||
}
|
||||
|
||||
void KCommonDecorationWrapper::captionChange()
|
||||
{
|
||||
return decoration->captionChange();
|
||||
}
|
||||
|
||||
void KCommonDecorationWrapper::iconChange()
|
||||
{
|
||||
return decoration->iconChange();
|
||||
|
|
|
@ -49,7 +49,6 @@ public:
|
|||
virtual void borders(int& left, int& right, int& top, int& bottom) const;
|
||||
virtual void resize(const QSize& s);
|
||||
virtual QSize minimumSize() const;
|
||||
virtual void captionChange();
|
||||
virtual void iconChange();
|
||||
virtual void maximizeChange();
|
||||
virtual void desktopChange();
|
||||
|
|
|
@ -491,6 +491,7 @@ class KWIN_EXPORT KDecoration
|
|||
{
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(bool active READ isActive NOTIFY activeChanged)
|
||||
Q_PROPERTY(QString caption READ caption NOTIFY captionChanged)
|
||||
public:
|
||||
/**
|
||||
* Constructs a KDecoration object. Both the arguments are passed from
|
||||
|
@ -815,10 +816,6 @@ public:
|
|||
virtual QSize minimumSize() const = 0;
|
||||
|
||||
public Q_SLOTS:
|
||||
/**
|
||||
* This function is called whenever the caption changes. Use caption() to get it.
|
||||
*/
|
||||
virtual void captionChange() = 0;
|
||||
/**
|
||||
* This function is called whenever the window icon changes. Use icon() to get it.
|
||||
*/
|
||||
|
@ -846,6 +843,10 @@ Q_SIGNALS:
|
|||
* Use isActive() to find out the current state.
|
||||
*/
|
||||
void activeChanged();
|
||||
/**
|
||||
* This signal is emitted whenever the caption changes. Use caption() to get it.
|
||||
*/
|
||||
void captionChanged();
|
||||
/**
|
||||
* This signal is emitted whenever the window's keep-above state changes.
|
||||
*/
|
||||
|
|
Loading…
Reference in a new issue