Hide resize handles for unresizable windows

svn path=/trunk/kdebase/kwin/; revision=249446
This commit is contained in:
Luciano Montanaro 2003-09-08 15:54:55 +00:00
parent c72429a37e
commit e46772fe73
2 changed files with 13 additions and 7 deletions

View file

@ -618,7 +618,7 @@ KDEDefaultClient::KDEDefaultClient( Workspace *ws, WId w, QWidget *parent,
}
// Pack the windowWrapper() window within a grid
QGridLayout* g = new QGridLayout(this, 0, 0, 0);
g = new QGridLayout(this, 0, 0, 0);
g->setResizeMode(QLayout::FreeResize);
g->addRowSpacing(0, 3); // Top grab bar
g->addRowSpacing(2, 1); // line under titlebar
@ -630,10 +630,10 @@ KDEDefaultClient::KDEDefaultClient( Workspace *ws, WId w, QWidget *parent,
g->setRowStretch(3, 10); // Wrapped window
// Determine the size of the lower grab bar
if ( showGrabBar && (!isTool()) )
g->addRowSpacing(4, 8); // bottom handles
else
g->addRowSpacing(4, 4); // bottom handles
spacer = new QSpacerItem(10,
showGrabBar && isResizable() && (!isTool()) ? 8 : 4,
QSizePolicy::Expanding, QSizePolicy::Minimum);
g->addItem(spacer, 4, 1);
g->addColSpacing(0, 4);
g->addColSpacing(2, 4);
@ -881,7 +881,7 @@ void KDEDefaultClient::paintEvent( QPaintEvent* )
p.drawLine(x2-2, y+titleHeight+3, x2-2, y2-2);
// Draw the bottom handle if required
if (showGrabBar && (!isTool()) )
if (showGrabBar && isResizable() && (!isTool()) )
{
if(w > 50)
{
@ -996,6 +996,9 @@ void KDEDefaultClient::maximizeChange(bool m)
button[BtnMax]->setBitmap(m ? minmax_bits : maximize_bits);
button[BtnMax]->setTipText(m ? i18n("Restore") : i18n("Maximize"));
}
spacer->changeSize(10, showGrabBar && isResizable() && !isTool() ? 8 : 4,
QSizePolicy::Expanding, QSizePolicy::Minimum);
g->activate();
}
@ -1054,7 +1057,7 @@ Client::MousePosition KDEDefaultClient::mousePosition( const QPoint& p ) const
MousePosition m = Nowhere;
// Modify the mouse position if we are using a grab bar.
if (showGrabBar && (!isTool()) )
if (showGrabBar && isResizable() && (!isTool()) )
if (p.y() < (height() - 8))
m = Client::mousePosition(p);
else

View file

@ -16,6 +16,7 @@
#include <qbutton.h>
#include <qbitmap.h>
#include <qdatetime.h>
#include <kpixmap.h>
#include "../../client.h"
#include "../../kwinbutton.h"
@ -112,8 +113,10 @@ class KDEDefaultClient : public Client
int lastButtonWidth;
int titleHeight;
bool largeButtons;
QGridLayout* g;
QBoxLayout* hb;
QSpacerItem* titlebar;
QSpacerItem* spacer;
bool m_closing;
};