From kde-commits Wed Jul 28 17:06:22 2004 From: Luciano Montanaro Date: Wed, 28 Jul 2004 17:06:22 +0000 To: kde-commits Subject: kdebase/kwin/clients/laptop Message-Id: <20040728170622.43FD099D4 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109103439022349 CVS commit by montanaro: fixed maximized border size. M +32 -22 laptopclient.cpp 1.46 M +1 -0 laptopclient.h 1.23 --- kdebase/kwin/clients/laptop/laptopclient.cpp #1.45:1.46 @@ -359,5 +359,5 @@ void LaptopClient::init() g->setRowStretch(3, 10); - spacer = new QSpacerItem(10, isResizable() ? handleSize : 4, + spacer = new QSpacerItem(10, mustDrawHandle() ? handleSize : 4, QSizePolicy::Expanding, QSizePolicy::Minimum); g->addItem(spacer, 4, 1); @@ -438,5 +438,5 @@ void LaptopClient::resizeEvent(QResizeEv dx = 32 + QABS( e->oldSize().width() - width() ); if ( e->oldSize().height() != height() ) - dy = isResizable() ? handleSize : 4 + + dy = mustDrawHandle() ? handleSize : 4 + QABS( e->oldSize().height() - height() ); if ( dy ) @@ -478,5 +478,5 @@ void LaptopClient::paintEvent( QPaintEve int bb = handleSize + 2; // Bottom border int bs = handleSize - 2; // inner size of bottom border - if (!isResizable()) { + if (!mustDrawHandle()) { bb = 6; bs = 0; @@ -489,6 +489,6 @@ void LaptopClient::paintEvent( QPaintEve // handles - if (!isResizable()) { - } else if (r.width() > 3*handleSize + 20) { + if (mustDrawHandle()) { + if (r.width() > 3*handleSize + 20) { int range = 8 + 3*handleSize/2; qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, range, @@ -500,11 +500,11 @@ void LaptopClient::paintEvent( QPaintEve qDrawShadePanel(&p, r.right() - range, r.bottom() - bs, range, bs, g, false, 1, &g.brush(QColorGroup::Mid)); - } - else + } else { qDrawShadePanel(&p, r.x() + 1, r.bottom() - bs, r.width() - 2, bs, g, false, 1, isActive() ? &g.brush(QColorGroup::Background) : &g.brush(QColorGroup::Mid)); - + } + } r = titlebar->geometry(); r.setRight(r.right()-1); @@ -575,4 +575,14 @@ void LaptopClient::mouseDoubleClickEvent } +bool LaptopClient::mustDrawHandle() const +{ + bool drawSmallBorders = !options()->moveResizeMaximizedWindows(); + if (drawSmallBorders && (maximizeMode() & MaximizeVertical)) { + return false; + } else { + return isResizable(); + } +} + void LaptopClient::iconChange() { @@ -595,5 +605,5 @@ void LaptopClient::maximizeChange() QToolTip::remove(button[BtnMax]); QToolTip::add(button[BtnMax], m ? i18n("Restore") : i18n("Maximize")); - spacer->changeSize(10, isResizable() ? handleSize : 4, + spacer->changeSize(10, mustDrawHandle() ? handleSize : 4, QSizePolicy::Expanding, QSizePolicy::Minimum); g->activate(); @@ -741,5 +751,5 @@ void LaptopClient::borders(int &left, in left = right = 4; top = titleHeight + 4; - bottom = isResizable() ? handleSize : 4; + bottom = mustDrawHandle() ? handleSize : 4; } --- kdebase/kwin/clients/laptop/laptopclient.h #1.22:1.23 @@ -82,4 +82,5 @@ protected: void updateActiveBuffer(); private: + bool mustDrawHandle() const; bool isTool() const; bool isTransient() const;