-rw-r--r-- | library/qpestyle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/qpestyle.cpp b/library/qpestyle.cpp index b61ada4..0566f6b 100644 --- a/library/qpestyle.cpp +++ b/library/qpestyle.cpp | |||
@@ -1,58 +1,58 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "qpestyle.h" | 21 | #include "qpestyle.h" |
22 | 22 | ||
23 | 23 | ||
24 | #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) | 24 | #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) |
25 | 25 | ||
26 | #if QT_VERSION >= 300 | 26 | #if QT_VERSION >= 0x030000 |
27 | 27 | ||
28 | #include <qdrawutil.h> | 28 | #include <qdrawutil.h> |
29 | #include <qcombobox.h> | 29 | #include <qcombobox.h> |
30 | #include <qtabbar.h> | 30 | #include <qtabbar.h> |
31 | 31 | ||
32 | QPEStyle::QPEStyle() | 32 | QPEStyle::QPEStyle() |
33 | { | 33 | { |
34 | } | 34 | } |
35 | 35 | ||
36 | QPEStyle::~QPEStyle() | 36 | QPEStyle::~QPEStyle() |
37 | { | 37 | { |
38 | } | 38 | } |
39 | 39 | ||
40 | void QPEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, | 40 | void QPEStyle::drawPrimitive( PrimitiveElement pe, QPainter *p, const QRect &r, |
41 | const QColorGroup &cg, SFlags flags, const QStyleOption &data) const | 41 | const QColorGroup &cg, SFlags flags, const QStyleOption &data) const |
42 | { | 42 | { |
43 | switch ( pe ) { | 43 | switch ( pe ) { |
44 | case PE_ButtonTool: | 44 | case PE_ButtonTool: |
45 | { | 45 | { |
46 | QColorGroup mycg = cg; | 46 | QColorGroup mycg = cg; |
47 | if ( flags & Style_On ) { | 47 | if ( flags & Style_On ) { |
48 | QBrush fill( cg.mid(), Dense4Pattern ); | 48 | QBrush fill( cg.mid(), Dense4Pattern ); |
49 | mycg.setBrush( QColorGroup::Button, fill ); | 49 | mycg.setBrush( QColorGroup::Button, fill ); |
50 | } | 50 | } |
51 | drawPrimitive( PE_ButtonBevel, p, r, mycg, flags, data ); | 51 | drawPrimitive( PE_ButtonBevel, p, r, mycg, flags, data ); |
52 | break; | 52 | break; |
53 | } | 53 | } |
54 | case PE_ButtonCommand: | 54 | case PE_ButtonCommand: |
55 | case PE_ButtonDefault: | 55 | case PE_ButtonDefault: |
56 | case PE_ButtonBevel: | 56 | case PE_ButtonBevel: |
57 | case PE_HeaderSection: | 57 | case PE_HeaderSection: |
58 | { | 58 | { |
@@ -400,65 +400,65 @@ QSize QPEStyle::sizeFromContents( ContentsType contents, const QWidget *widget, | |||
400 | switch ( contents ) { | 400 | switch ( contents ) { |
401 | case CT_PopupMenuItem: | 401 | case CT_PopupMenuItem: |
402 | { | 402 | { |
403 | if ( !widget || data.isDefault() ) | 403 | if ( !widget || data.isDefault() ) |
404 | break; | 404 | break; |
405 | sz = QWindowsStyle::sizeFromContents( contents, widget, contentsSize, data ); | 405 | sz = QWindowsStyle::sizeFromContents( contents, widget, contentsSize, data ); |
406 | sz = QSize( sz.width(), sz.height()-2 ); | 406 | sz = QSize( sz.width(), sz.height()-2 ); |
407 | break; | 407 | break; |
408 | } | 408 | } |
409 | default: | 409 | default: |
410 | sz = QWindowsStyle::sizeFromContents( contents, widget, contentsSize, data ); | 410 | sz = QWindowsStyle::sizeFromContents( contents, widget, contentsSize, data ); |
411 | break; | 411 | break; |
412 | } | 412 | } |
413 | 413 | ||
414 | return sz; | 414 | return sz; |
415 | } | 415 | } |
416 | 416 | ||
417 | #else | 417 | #else |
418 | 418 | ||
419 | #include <qfontmetrics.h> | 419 | #include <qfontmetrics.h> |
420 | #include <qpalette.h> | 420 | #include <qpalette.h> |
421 | #include <qdrawutil.h> | 421 | #include <qdrawutil.h> |
422 | #include <qscrollbar.h> | 422 | #include <qscrollbar.h> |
423 | #include <qbutton.h> | 423 | #include <qbutton.h> |
424 | #include <qframe.h> | 424 | #include <qframe.h> |
425 | #include <qtabbar.h> | 425 | #include <qtabbar.h> |
426 | 426 | ||
427 | #define INCLUDE_MENUITEM_DEF | 427 | #define INCLUDE_MENUITEM_DEF |
428 | #include <qmenudata.h> | 428 | #include <qmenudata.h> |
429 | 429 | ||
430 | QPEStyle::QPEStyle() | 430 | QPEStyle::QPEStyle() |
431 | { | 431 | { |
432 | #if QT_VERSION < 300 | 432 | #if QT_VERSION < 0x030000 |
433 | setButtonMargin(buttonMargin()); | 433 | setButtonMargin(buttonMargin()); |
434 | setScrollBarExtent(scrollBarExtent().width(),scrollBarExtent().height()); | 434 | setScrollBarExtent(scrollBarExtent().width(),scrollBarExtent().height()); |
435 | #endif | 435 | #endif |
436 | } | 436 | } |
437 | 437 | ||
438 | QPEStyle::~QPEStyle() | 438 | QPEStyle::~QPEStyle() |
439 | { | 439 | { |
440 | } | 440 | } |
441 | 441 | ||
442 | int QPEStyle::buttonMargin() const | 442 | int QPEStyle::buttonMargin() const |
443 | { | 443 | { |
444 | return 2; | 444 | return 2; |
445 | } | 445 | } |
446 | 446 | ||
447 | QSize QPEStyle::scrollBarExtent() const | 447 | QSize QPEStyle::scrollBarExtent() const |
448 | { | 448 | { |
449 | return QSize(13,13); | 449 | return QSize(13,13); |
450 | } | 450 | } |
451 | 451 | ||
452 | void QPEStyle::polish ( QPalette & ) | 452 | void QPEStyle::polish ( QPalette & ) |
453 | { | 453 | { |
454 | } | 454 | } |
455 | 455 | ||
456 | void QPEStyle::polish( QWidget *w ) | 456 | void QPEStyle::polish( QWidget *w ) |
457 | { | 457 | { |
458 | if ( w->inherits( "QListBox" ) || | 458 | if ( w->inherits( "QListBox" ) || |
459 | w->inherits( "QListView" ) || | 459 | w->inherits( "QListView" ) || |
460 | w->inherits( "QPopupMenu" ) || | 460 | w->inherits( "QPopupMenu" ) || |
461 | w->inherits( "QSpinBox" ) ) { | 461 | w->inherits( "QSpinBox" ) ) { |
462 | QFrame *f = (QFrame *)w; | 462 | QFrame *f = (QFrame *)w; |
463 | f->setFrameShape( QFrame::StyledPanel ); | 463 | f->setFrameShape( QFrame::StyledPanel ); |
464 | f->setLineWidth( 1 ); | 464 | f->setLineWidth( 1 ); |