[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdeartwork/kwin-styles/kstep
From:       Luciano Montanaro <mikelima () cirulla ! net>
Date:       2004-08-01 11:06:21
Message-ID: 20040801110621.C438499E0 () office ! kde ! org
[Download RAW message or body]

CVS commit by montanaro: 

Fix maximized border calculation.


  M +16 -6     nextclient.cpp   1.51
  M +1 -0      nextclient.h   1.26


--- kdeartwork/kwin-styles/kstep/nextclient.cpp  #1.50:1.51
@@ -408,5 +408,5 @@ void NextClient::init()
     mainLayout->addLayout(titleLayout);
     mainLayout->addLayout(windowLayout, 1);
-    mainLayout->addSpacing(isResizable() ? handleSize : 1);
+    mainLayout->addSpacing(mustDrawHandle() ? handleSize : 1);
 
     windowLayout->addSpacing(1);
@@ -568,5 +568,5 @@ void NextClient::addButtons(QBoxLayout* 
 
         case 'R':
-            if (isResizable()) {
+            if (mustDrawHandle()) {
                 button[RESIZE_IDX] =
                     new NextButton(this, "resize", resize_bits, 10, 10,
@@ -590,4 +590,14 @@ void NextClient::addButtons(QBoxLayout* 
 }
 
+bool NextClient::mustDrawHandle() const 
+{ 
+    bool drawSmallBorders = !options()->moveResizeMaximizedWindows();
+    if (drawSmallBorders && (maximizeMode() & MaximizeVertical)) {
+        return false;
+    } else {
+        return isResizable();
+    }
+}
+
 void NextClient::iconChange()
 {
@@ -703,5 +713,5 @@ void NextClient::paintEvent( QPaintEvent
 
     // Draw resize handle
-    if (isResizable()) {
+    if (mustDrawHandle()) {
         int corner = 16 + 3*handleSize/2;
         qDrawShadePanel(&p,
@@ -760,5 +770,5 @@ void NextClient::maximizeChange()
                 m ? i18n("Restore") : i18n("Maximize"));
     }
-    //spacer->changeSize(10, isResizable() ? handleSize : 1,
+    //spacer->changeSize(10, mustDrawHandle() ? handleSize : 1,
     //              QSizePolicy::Expanding, QSizePolicy::Minimum);
     //mainLayout->activate();
@@ -805,5 +815,5 @@ void NextClient::borders(int &left, int 
     left = right = 1;
     top = titleHeight; // FRAME is this ok?
-    bottom = isResizable() ? handleSize : 1;
+    bottom = mustDrawHandle() ? handleSize : 1;
 }
 
@@ -893,5 +903,5 @@ bool NextClient::drawbound(const QRect& 
     p.fillRect(leftMargin, geom.top() + titleHeight - 1,
             geom.width() - 4, 3, Qt::white);
-    if (isResizable()) {
+    if (mustDrawHandle()) {
         p.fillRect(leftMargin, geom.bottom() - handleSize - 1,
                 geom.width() - 4, 3, Qt::white);

--- kdeartwork/kwin-styles/kstep/nextclient.h  #1.25:1.26
@@ -85,4 +85,5 @@ private:
     void initializeButtonsAndTitlebar(QBoxLayout* titleLayout);
     void addButtons(QBoxLayout* titleLayout, const QString& buttons);
+    bool mustDrawHandle() const;
 
     QSpacerItem* titlebar;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic