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

List:       kde-commits
Subject:    playground/artwork/Oxygen/style/code
From:       Riccardo Iaconelli <ruphy () fsfe ! org>
Date:       2007-06-03 0:12:17
Message-ID: 1180829537.109965.31172.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 670921 by ruphy:

Change the view of lineedits and friends.
Still need to clean up the mess it causes elsewhere



 M  +3 -4      drawprimitive.cpp  
 M  +34 -19    genpixmaps.cpp  
 M  +2 -2      sizefromcontents.cpp  


--- trunk/playground/artwork/Oxygen/style/code/drawprimitive.cpp #670920:670921
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2006-2007 by Thomas Lübking                             *
+ *   Copyright (C) 2006-2007 by Thomas L�bking                             *
  *   thomas.luebking@web.de                                                *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -88,7 +88,7 @@
          GradientType gt = isOn ? GradSunken : ( isDefault ? config.gradientStrong : \
                config.gradBtn);
          fillWithMask(painter, r, gradient(c, r.height(), Qt::Vertical, gt), \
&masks.button);  // border - glass has over or underlightened borders,
-         // we assume 360° overlight - looks nicer with the shadows ;)
+         // we assume 360� overlight - looks nicer with the shadows ;)
          masks.button.outline(r, painter, Qt::white, true);
       }
       else
@@ -122,8 +122,7 @@
          painter->fillRect(RECT, COLOR(Base)); break;
       }
       if (isEnabled) {
-         fillWithMask(painter, RECT.adjusted(0,0,0,-dpi.$2), COLOR(Base),
-                      &masks.button);
+         fillWithMask(painter, RECT.adjusted(0,0,0,0), COLOR(Base), &masks.button);
          if (hasFocus) {
             painter->save();
             painter->setPen(QPen(COLOR(Highlight), dpi.$2));
--- trunk/playground/artwork/Oxygen/style/code/genpixmaps.cpp #670920:670921
@@ -59,7 +59,7 @@
    
    // -> sunken
    QLinearGradient lg; QGradientStops stops;
-   QImage tmpImg($9,$9, QImage::Format_ARGB32);
+   QImage tmpImg($9,$9+$9, QImage::Format_ARGB32);
    
    for (int i = 0; i < 2; ++i) {
       int add = i*30;
@@ -68,30 +68,45 @@
       p.begin(&tmpImg);
       p.setPen(Qt::NoPen);
       p.setRenderHint(QPainter::Antialiasing);
-      p.setBrush(QColor(0,0,0,55+add)); p.drawRoundRect(0,0,$9,$7,80,80);
-      p.setCompositionMode( QPainter::CompositionMode_DestinationOut );
-      add = 30 - add;
-      p.setBrush(QColor(0,0,0,120+add)); p.drawRoundRect(0,$1,$9,dpi.$6,75,75);
-      p.setBrush(QColor(0,0,0,140+add)); p.drawRoundRect(0,$2,$9,dpi.$5,80,80);
-      p.setBrush(QColor(0,0,0,160+add)); p.drawRoundRect($1,$3,$7,dpi.$4,85,85);
-      p.setBrush(QColor(0,0,0,180+add)); p.drawRoundRect($2,dpi.$4,dpi.$5,$3,90,90);
+      QRadialGradient rg = QRadialGradient($9/2.0,$9/2.0, dpi.$5, \
$9/2.0,$9/2.0+1.5*$1); +      stops << QGradientStop( 0, QColor(0,0,0, 0) )
+         << QGradientStop( 0.4, QColor(0,0,0, 0) )
+         << QGradientStop( 0.58, QColor(0,0,0, 40/2) )
+         << QGradientStop( 0.75, QColor(0,0,0, 103/3) )
+         << QGradientStop( 0.88, QColor(0,0,0, 161/3) )
+         << QGradientStop( 1, QColor(0,0,0, 255/3) );
+      rg.setStops(stops);
+      p.setBrush(rg);
+
+      //p.setBrush(QColor(255,0,0,160));
+      p.drawRoundRect(0,0,$9,$9,80,80);
+
+      // draw white edge at bottom
+      p.setBrush(QColor(255,255,255,160));
+      p.drawRoundRect(0,$9,$9,$9,80,80);
+
+      // erase innerpart of the white
+      p.setCompositionMode( QPainter::CompositionMode_Clear );
+      p.drawRoundRect(0,$9,$9,$9-$1,80,80);
+      p.eraseRect($2,$9_2,dpi.$5,dpi.$1);
       p.setCompositionMode( QPainter::CompositionMode_SourceOver );
-      lg = QLinearGradient(0,0,0,$9);
-      stops << QGradientStop( 0, QColor(255,255,255, 90) )
-         << QGradientStop( 0.5, QColor(255,255,255, 190) )
-         << QGradientStop( 1, QColor(255,255,255, 90) );
-      lg.setStops(stops);
-      p.fillRect($3,$9-$2,$3,$1, lg);
+
+      // move the bottom part
+      p.drawImage(QPoint(0,$9+dpi.$4), tmpImg, QRect(0,dpi.$5,$9,$9_2));
+
+p.eraseRect(0,dpi.$5,$9,dpi.$9); // repeat the side edges
+p.drawImage(QRect(0,dpi.$5,$9,dpi.$9), tmpImg, QRect(0,$9_2,$9,$1));
+      lg = QLinearGradient(0,$3,0,dpi.$12);
       stops.clear();
-      stops << QGradientStop( 0, QColor(255,255,255, 30) )
-         << QGradientStop( 0.5, QColor(255,255,255, 100) )
-         << QGradientStop( 1, QColor(255,255,255, 30) );
+      stops << QGradientStop( 0, QColor(106,56,0, 15) )
+         << QGradientStop( 1.0, QColor(106,56,0, 0) );
+
       lg.setStops(stops);
-      p.fillRect($3,$9-$1,$3,$1, lg);
+      p.fillRect($2,$3,dpi.$5,dpi.$10, lg);
       stops.clear();
       p.end();
    
-      shadows.lineEdit[i] = \
Tile::Set(QPixmap::fromImage(tmpImg),$9_2,$9_2,$9-2*$9_2,$9-2*$9_2); +      \
shadows.lineEdit[i] = \
Tile::Set(QPixmap::fromImage(tmpImg),$9_2,$9_2+$9,$9-2*$9_2,$9-2*$9_2);  }
    
    // relief
--- trunk/playground/artwork/Oxygen/style/code/sizefromcontents.cpp #670920:670921
@@ -1,5 +1,5 @@
 /***************************************************************************
- *   Copyright (C) 2006-2007 by Thomas Lübking                             *
+ *   Copyright (C) 2006-2007 by Thomas L�bking                             *
  *   thomas.luebking@web.de                                                *
  *                                                                         *
  *   This program is free software; you can redistribute it and/or modify  *
@@ -60,7 +60,7 @@
          return sz;
       }
    case CT_LineEdit: // A line edit, like QLineEdit
-      return contentsSize + QSize(dpi.$4,dpi.$5);
+      return contentsSize ;//+ QSize(dpi.$2,dpi.$2);
    case CT_MenuBarItem: // A menu bar item, like the buttons in a QMenuBar
       return QSize(qMax(contentsSize.width()+dpi.$18, \
(contentsSize.height()+dpi.$8)*8/5), contentsSize.height()+dpi.$8);  case \
CT_MenuItem: // A menu item, like QMenuItem


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

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