[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-07-25 14:38:33
Message-ID: 20040725143833.76C6099EC () office ! kde ! org
[Download RAW message or body]

CVS commit by montanaro: 

Implemented resize button.


  M +45 -11    nextclient.cpp   1.50
  M +2 -0      nextclient.h   1.25


--- kdeartwork/kwin-styles/kstep/nextclient.cpp  #1.49:1.50
@@ -47,5 +47,6 @@ static const unsigned char shade_bits[] 
     0x00,0x00,
     0x00,0x00,
-    0x00,0x00 };
+    0x00,0x00 
+};
     
 static const unsigned char unshade_bits[] = {
@@ -59,5 +60,6 @@ static const unsigned char unshade_bits[
     0x03,0x03,
     0xff,0x03,
-    0xff,0x03 };
+    0xff,0x03 
+};
 
 static const unsigned char keep_above_bits[] = {
@@ -71,5 +73,6 @@ static const unsigned char keep_above_bi
     0x00,0x00,
     0x00,0x00,
-    0x00,0x00 };
+    0x00,0x00 
+};
 
 static const unsigned char from_above_bits[] = {
@@ -83,5 +86,6 @@ static const unsigned char from_above_bi
     0x00,0x00,
     0x00,0x00,
-    0x00,0x00 };
+    0x00,0x00 
+};
     
 static const unsigned char keep_below_bits[] = {
@@ -111,4 +115,18 @@ static const unsigned char from_below_bi
 };
 
+static const unsigned char resize_bits[] = {
+    0xff, 0x03, 
+    0xff, 0x03, 
+    0x33, 0x03, 
+    0x33, 0x03, 
+    0xf3, 0x03, 
+    0xf3, 0x03,
+    0x03, 0x03, 
+    0x03, 0x03, 
+    0xff, 0x03, 
+    0xff, 0x03
+};
+
+
 // If the maximize graphic above (which I did quickly in about a
 // minute, just so I could have something) doesn't please, maybe one
@@ -539,14 +557,25 @@ void NextClient::addButtons(QBoxLayout* 
         
         case 'X':
-            if( isCloseable()) {
+            if (isCloseable()) {
             button[CLOSE_IDX] =
                 new NextButton(this, "close", close_bits, 10, 10,
                                i18n("Close"));
-            titleLayout->addWidget( button[CLOSE_IDX] );
-            connect( button[CLOSE_IDX], SIGNAL(clicked()),
-                     this, SLOT(closeWindow()) );
+                titleLayout->addWidget(button[CLOSE_IDX]);
+                connect(button[CLOSE_IDX], SIGNAL(clicked()),
+                         this, SLOT(closeWindow()));
             }
             break;
 
+        case 'R':
+            if (isResizable()) {
+                button[RESIZE_IDX] =
+                    new NextButton(this, "resize", resize_bits, 10, 10,
+                                   i18n("Resize"));
+                titleLayout->addWidget(button[RESIZE_IDX]);
+                // NOTE DIFFERENCE: capture pressed(), not clicked()
+                connect(button[RESIZE_IDX], SIGNAL(pressed()),
+                         this, SLOT(resizePressed()));
+            }
+            break;
         case '_':
             // TODO: Add spacer handling
@@ -609,4 +638,9 @@ void NextClient::belowClicked()
 }
 
+void NextClient::resizePressed()
+{
+    performWindowOperation(ResizeOp);
+}
+
 void NextClient::resizeEvent(QResizeEvent *)
 {

--- kdeartwork/kwin-styles/kstep/nextclient.h  #1.24:1.25
@@ -77,4 +77,5 @@ protected slots:
     void aboveClicked();
     void belowClicked();
+    void resizePressed();
 
     void keepAboveChange(bool above);
@@ -96,4 +97,5 @@ private:
            ABOVE_IDX,
            BELOW_IDX,
+           RESIZE_IDX,
            STICKY_IDX,
            MAX_NUM_BUTTONS = STICKY_IDX + 1 };


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

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