Simplify maximization.
svn path=/trunk/kdebase/kwin/; revision=331777
This commit is contained in:
parent
1ca1275a37
commit
3bc4193b8a
4 changed files with 6 additions and 24 deletions
|
@ -971,12 +971,7 @@ void KDEDefaultClient::keepBelowChange( bool below )
|
|||
|
||||
void KDEDefaultClient::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 );
|
||||
maximize( button[BtnMax]->last_button );
|
||||
}
|
||||
|
||||
void KDEDefaultClient::slotAbove()
|
||||
|
|
|
@ -55,7 +55,7 @@ class KDEDefaultButton : public QButton, public KDecorationDefines
|
|||
const QString& tip=NULL, const int realizeBtns = LeftButton);
|
||||
~KDEDefaultButton();
|
||||
|
||||
int last_button;
|
||||
ButtonState last_button;
|
||||
void turnOn( bool isOn );
|
||||
void setBitmap(const unsigned char *bitmap);
|
||||
QSize sizeHint() const;
|
||||
|
|
|
@ -733,7 +733,7 @@ QValueList< KeramikHandler::BorderSize > KeramikHandler::borderSizes() const
|
|||
|
||||
KeramikButton::KeramikButton( KeramikClient* c, const char *name, Button btn, const QString &tip, const int realizeBtns )
|
||||
: QButton( c->widget(), name ),
|
||||
client( c ), button( btn ), hover( false ), lastbutton( 0 )
|
||||
client( c ), button( btn ), hover( false ), lastbutton( NoButton )
|
||||
{
|
||||
realizeButtons = realizeBtns;
|
||||
|
||||
|
@ -1447,20 +1447,7 @@ void KeramikClient::menuButtonPressed()
|
|||
|
||||
void KeramikClient::slotMaximize()
|
||||
{
|
||||
switch ( button[ MaxButton ]->lastButton() )
|
||||
{
|
||||
case MidButton:
|
||||
maximize( maximizeMode() ^ MaximizeVertical );
|
||||
break;
|
||||
|
||||
case RightButton:
|
||||
maximize( maximizeMode() ^ MaximizeHorizontal );
|
||||
break;
|
||||
|
||||
case LeftButton:
|
||||
maximize( maximizeMode() == MaximizeFull ? MaximizeRestore : MaximizeFull );
|
||||
break;
|
||||
}
|
||||
maximize( button[ MaxButton ]->lastButton() );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -117,7 +117,7 @@ namespace Keramik {
|
|||
KeramikButton( KeramikClient *, const char *, Button, const QString &, const int realizeBtns = LeftButton );
|
||||
~KeramikButton();
|
||||
|
||||
int lastButton() const { return lastbutton; }
|
||||
ButtonState lastButton() const { return lastbutton; }
|
||||
|
||||
private:
|
||||
void enterEvent( QEvent * );
|
||||
|
@ -130,7 +130,7 @@ namespace Keramik {
|
|||
KeramikClient *client;
|
||||
Button button;
|
||||
bool hover;
|
||||
int lastbutton;
|
||||
ButtonState lastbutton;
|
||||
int realizeButtons;
|
||||
}; // class KeramikButton
|
||||
|
||||
|
|
Loading…
Reference in a new issue