use new maximize() overload
svn path=/trunk/kdebase/kwin/; revision=332523
This commit is contained in:
parent
5f4ba9cafe
commit
cc6b654b6f
4 changed files with 11 additions and 20 deletions
|
@ -278,7 +278,8 @@ QValueList< ModernSysFactory::BorderSize > ModernSysFactory::borderSizes() const
|
|||
|
||||
ModernButton::ModernButton(ModernSys *parent, const char *name,
|
||||
const unsigned char *bitmap, const QString& tip, const int realizeBtns)
|
||||
: QButton(parent->widget(), name)
|
||||
: QButton(parent->widget(), name),
|
||||
last_button( NoButton )
|
||||
{
|
||||
setBackgroundMode( NoBackground );
|
||||
setCursor( arrowCursor );
|
||||
|
@ -443,16 +444,8 @@ void ModernSys::init()
|
|||
|
||||
void ModernSys::maxButtonClicked( )
|
||||
{
|
||||
switch ( button[BtnMaximize]->last_button ) {
|
||||
case MidButton:
|
||||
maximize( maximizeMode() ^ MaximizeVertical );
|
||||
break;
|
||||
case RightButton:
|
||||
maximize( maximizeMode() ^ MaximizeHorizontal );
|
||||
break;
|
||||
default: //LeftButton:
|
||||
maximize( maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull );
|
||||
break;
|
||||
if (button[BtnMaximize]) {
|
||||
maximize(button[BtnMaximize]->last_button);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ protected:
|
|||
|
||||
int realizeButtons;
|
||||
public:
|
||||
int last_button;
|
||||
ButtonState last_button;
|
||||
};
|
||||
|
||||
class ModernSys : public KDecoration
|
||||
|
|
|
@ -236,7 +236,8 @@ void delete_pixmaps()
|
|||
|
||||
RedmondButton::RedmondButton(RedmondDeco *parent, const char *name,
|
||||
const unsigned char *bitmap, bool menuButton, bool isMini, int size, const QString& tip, const int realizeBtns)
|
||||
: QButton(parent->widget(), name)
|
||||
: QButton(parent->widget(), name),
|
||||
last_button( NoButton )
|
||||
{
|
||||
// Eliminate background flicker
|
||||
setBackgroundMode( NoBackground );
|
||||
|
@ -484,12 +485,9 @@ void RedmondDeco::iconChange()
|
|||
|
||||
void RedmondDeco::slotMaximize()
|
||||
{
|
||||
if ( button[BtnMax]->last_button == MidButton )
|
||||
maximize( maximizeMode() ^ MaximizeVertical );
|
||||
else if ( button[BtnMax]->last_button == RightButton )
|
||||
maximize( maximizeMode() ^ MaximizeHorizontal );
|
||||
else
|
||||
maximize( maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull );
|
||||
if (button[BtnMax]) {
|
||||
maximize(button[BtnMax]->last_button);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public:
|
|||
void reset();
|
||||
|
||||
QSize sizeHint() const;
|
||||
int last_button;
|
||||
ButtonState last_button;
|
||||
|
||||
protected:
|
||||
void mousePressEvent(QMouseEvent* e);
|
||||
|
|
Loading…
Reference in a new issue