-rw-r--r-- | library/qpestyle.cpp | 3 |
1 files changed, 0 insertions, 3 deletions
diff --git a/library/qpestyle.cpp b/library/qpestyle.cpp index 665910c..b61ada4 100644 --- a/library/qpestyle.cpp +++ b/library/qpestyle.cpp @@ -1,121 +1,118 @@ /********************************************************************** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** ** This file is part of Qtopia Environment. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "qpestyle.h" -#include <qpe/qpeapplication.h> -#include <qpushbutton.h> -#include <qpainter.h> #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) #if QT_VERSION >= 300 #include <qdrawutil.h> #include <qcombobox.h> #include <qtabbar.h> QPEStyle::QPEStyle() { } QPEStyle::~QPEStyle() { } void QPEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, const QColorGroup &cg, SFlags flags, const QStyleOption &data) const { switch ( pe ) { case PE_ButtonTool: { QColorGroup mycg = cg; if ( flags & Style_On ) { QBrush fill( cg.mid(), Dense4Pattern ); mycg.setBrush( QColorGroup::Button, fill ); } drawPrimitive( PE_ButtonBevel, p, r, mycg, flags, data ); break; } case PE_ButtonCommand: case PE_ButtonDefault: case PE_ButtonBevel: case PE_HeaderSection: { QPen oldPen = p->pen(); p->fillRect( r.x()+1, r.y()+1, r.width()-2, r.height()-2, cg.brush(QColorGroup::Button) ); int x2 = r.right(); int y2 = r.bottom(); if ( flags & (Style_Sunken | Style_Down | Style_On) ) p->setPen( cg.dark() ); else p->setPen( cg.light() ); p->drawLine( r.x(), r.y()+1, r.x(), y2-1 ); p->drawLine( r.x()+1, r.y(), x2-1, r.y() ); if ( flags & (Style_Sunken | Style_Down | Style_On) ) p->setPen( cg.light() ); else p->setPen( cg.dark() ); p->drawLine( x2, r.y()+1, x2, y2-1 ); p->drawLine( r.x()+1, y2, x2-1, y2 ); p->setPen( oldPen ); break; } case PE_FocusRect: break; case PE_Indicator: { QColorGroup mycg( cg ); QBrush fill; if ( flags & Style_Down ) fill = cg.brush( QColorGroup::Button ); else fill = cg.brush( (flags&Style_Enabled) ? QColorGroup::Base : QColorGroup::Background ); mycg.setBrush( QColorGroup::Button, fill ); if ( flags&Style_Enabled ) flags |= Style_Sunken; drawPrimitive( PE_ButtonBevel, p, r, mycg, flags ); if ( flags & Style_On ) { QPointArray a( 7*2 ); int i, xx, yy; xx = r.x()+3; yy = r.y()+5; for ( i=0; i<3; i++ ) { a.setPoint( 2*i, xx, yy ); a.setPoint( 2*i+1, xx, yy+2 ); xx++; yy++; } yy -= 2; for ( i=3; i<7; i++ ) { a.setPoint( 2*i, xx, yy ); a.setPoint( 2*i+1, xx, yy+2 ); xx++; yy--; } if ( flags & Style_NoChange ) { p->setPen( mycg.dark() ); } else { p->setPen( mycg.text() ); } p->drawLineSegments( a ); } break; |