Fix #69005 - make it possible to differentiate between a window really

being shaded and being set to be shaded (which may differ with hover unshade).

svn path=/trunk/kdebase/kwin/; revision=269526
This commit is contained in:
Luboš Luňák 2003-11-25 15:26:50 +00:00
parent 693d7d77c1
commit 4ee178b277
9 changed files with 39 additions and 3 deletions

View file

@ -62,6 +62,11 @@ QIconSet Bridge::icon() const
return QIconSet( c->miniIcon(), c->icon());
}
bool Bridge::isSetShade() const
{
return c->shadeMode() != Client::ShadeNone;
}
void Bridge::showWindowMenu( QPoint p )
{
c->workspace()->showWindowMenu( p, c );

View file

@ -32,6 +32,7 @@ class Bridge : public KDecorationBridge
virtual bool isModal() const;
virtual bool isShadeable() const;
virtual bool isShade() const;
virtual bool isSetShade() const;
virtual bool keepAbove() const;
virtual bool keepBelow() const;
virtual bool isMovable() const;

View file

@ -117,7 +117,8 @@ class Client : public QObject, public KDecorationDefines
ShadeHover, // "shaded", but visible due to hover unshade
ShadeActivated // "shaded", but visible due to alt+tab to the window
};
bool isShade() const;
bool isShade() const; // true only for ShadeNormal
ShadeMode shadeMode() const; // prefer isShade()
void setShade( ShadeMode mode );
bool isShadeable() const;
@ -612,6 +613,12 @@ bool Client::isShade() const
return shade_mode == ShadeNormal;
}
inline
Client::ShadeMode Client::shadeMode() const
{
return shade_mode;
}
inline QPixmap Client::icon() const
{
return icon_pix;

View file

@ -256,6 +256,11 @@ bool KDecorationPreviewBridge::isShade() const
return false;
}
bool KDecorationPreviewBridge::isSetShade() const
{
return false;
}
bool KDecorationPreviewBridge::keepAbove() const
{
return false;

View file

@ -75,6 +75,7 @@ class KDecorationPreviewBridge
virtual bool isModal() const;
virtual bool isShadeable() const;
virtual bool isShade() const;
virtual bool isSetShade() const;
virtual bool keepAbove() const;
virtual bool keepBelow() const;
virtual bool isMovable() const;

View file

@ -128,6 +128,11 @@ bool KDecoration::isShade() const
return bridge_->isShade();
}
bool KDecoration::isSetShade() const
{
return bridge_->isSetShade();
}
bool KDecoration::keepAbove() const
{
return bridge_->keepAbove();

View file

@ -326,8 +326,19 @@ class KDecoration
bool isShadeable() const;
/**
* Returns @a true if the decorated window is currently shaded.
* If the window is e.g. hover unshaded, it's not considered to be shaded.
*
* @see isSetShade
*/
bool isShade() const;
/**
* Returns @a true if the decorated window was set to be shaded. This function
* returns also true if the window is e.g. hover unshaded, so it doesn't
* always correspond to the actual window state.
*
* @see isShade
*/
bool isSetShade() const;
/**
* Returns @a true if the decorated window should be kept above other windows.
*/

View file

@ -69,6 +69,7 @@ class KDecorationBridge : public KDecorationDefines
virtual bool isModal() const = 0;
virtual bool isShadeable() const = 0;
virtual bool isShade() const = 0;
virtual bool isSetShade() const = 0;
virtual bool keepAbove() const = 0;
virtual bool keepBelow() const = 0;
virtual bool isMovable() const = 0;

View file

@ -103,8 +103,8 @@ void Workspace::clientPopupAboutToShow()
popup->setItemEnabled( Options::MoveOp, popup_client->isMovable() );
popup->setItemEnabled( Options::MaximizeOp, popup_client->isMaximizable() );
popup->setItemChecked( Options::MaximizeOp, popup_client->maximizeMode() == Client::MaximizeFull );
// TODO this doesn't show it's shaded when it's hovered or activated
popup->setItemChecked( Options::ShadeOp, popup_client->isShade() );
// This should be checked also when hover unshaded
popup->setItemChecked( Options::ShadeOp, popup_client->shadeMode() != Client::ShadeNone );
popup->setItemEnabled( Options::ShadeOp, popup_client->isShadeable());
options_popup->setItemChecked( Options::KeepAboveOp, popup_client->keepAbove() );
options_popup->setItemChecked( Options::KeepBelowOp, popup_client->keepBelow() );