Screwing around with the titlebar layout a little. Windows can now be resized

smaller than the sizeHint of the bar.

Repainting is also messed up with all the clients it seems... dunno how that
happened :P

svn path=/trunk/kdebase/kwin/; revision=43873
This commit is contained in:
Daniel M. Duley 2000-03-18 12:35:05 +00:00
parent 2b0fb2434f
commit 06a809e7ac
2 changed files with 13 additions and 6 deletions

View file

@ -109,6 +109,11 @@ SystemButton::SystemButton(QWidget *parent, const char *name,
setBitmap(bitmap);
}
QSize SystemButton::sizeHint() const
{
return(QSize(14, 14));
}
void SystemButton::reset()
{
QPainter p;
@ -228,33 +233,34 @@ SystemClient::SystemClient( Workspace *ws, WId w, QWidget *parent,
connect( button[3], SIGNAL( clicked() ), this, ( SLOT( maximize() ) ) );
QHBoxLayout* hb = new QHBoxLayout();
hb->setResizeMode(QLayout::FreeResize);
g->addLayout( hb, 0, 1 );
hb->addSpacing(2);
hb->addWidget( button[0] );
hb->addWidget( button[0]);
titlebar = new QSpacerItem(10, 16, QSizePolicy::Expanding,
QSizePolicy::Minimum);
hb->addItem(titlebar);
hb->addSpacing(3);
if(help){
hb->addWidget( button[4] );
hb->addWidget( button[4]);
hb->addSpacing(1);
}
hb->addWidget( button[1] );
hb->addWidget( button[1]);
hb->addSpacing(1);
hb->addWidget( button[2] );
hb->addWidget( button[2]);
hb->addSpacing(1);
hb->addWidget( button[3] );
hb->addWidget( button[3]);
hb->addSpacing(3);
for ( int i = 0; i < (help ? 5 : 4); i++) {
button[i]->setMouseTracking( TRUE );
button[i]->setFixedSize( 14, 14 );
}
}
void SystemClient::resizeEvent( QResizeEvent* e)
{
Client::resizeEvent( e );
doShape();
if ( isVisibleToTLW() && !testWFlags( WNorthWestGravity )) {
QPainter p( this );

View file

@ -17,6 +17,7 @@ public:
const unsigned char *bitmap=NULL);
void setBitmap(const unsigned char *bitmap);
void reset();
QSize sizeHint() const;
protected:
virtual void drawButton(QPainter *p);
void drawButtonLabel(QPainter *){;}