summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/metal/metal.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/noncore/styles/metal/metal.cpp b/noncore/styles/metal/metal.cpp
index 5cb2d22..e13a249 100644
--- a/noncore/styles/metal/metal.cpp
+++ b/noncore/styles/metal/metal.cpp
@@ -1,130 +1,129 @@
1/**************************************************************************** 1/****************************************************************************
2** $Id$
3** 2**
4** Copyright (C) 1992-2000 Trolltech AS. All rights reserved. 3** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
5** 4**
6** This file is part of an example program for Qt. This example 5** This file is part of an example program for Qt. This example
7** program may be used, distributed and modified without limitation. 6** program may be used, distributed and modified without limitation.
8** 7**
9*****************************************************************************/ 8*****************************************************************************/
10 9
11#include "metal.h" 10#include "metal.h"
12#include <qapplication.h> 11#include <qapplication.h>
13#include <qpushbutton.h> 12#include <qpushbutton.h>
14#include <qscrollbar.h> 13#include <qscrollbar.h>
15#include <limits.h> 14#include <limits.h>
16 15
17 16
18///////////////////////////////////////////////////////// 17/////////////////////////////////////////////////////////
19#include "stonedark.xpm" 18#include "stonedark.xpm"
20#include "stone1.xpm" 19#include "stone1.xpm"
21#include "marble.xpm" 20#include "marble.xpm"
22/////////////////////////////////////////////////////// 21///////////////////////////////////////////////////////
23 22
24 23
25 24
26MetalStyle::MetalStyle() : QWindowsStyle() { } 25MetalStyle::MetalStyle() : QWindowsStyle() { }
27 26
28/*! 27/*!
29 Reimplementation from QStyle 28 Reimplementation from QStyle
30 */ 29 */
31void MetalStyle::polish( QApplication *app) 30void MetalStyle::polish( QApplication *app)
32{ 31{
33 oldPalette = app->palette(); 32 oldPalette = app->palette();
34 33
35 // we simply create a nice QColorGroup with a couple of fancy 34 // we simply create a nice QColorGroup with a couple of fancy
36 // pixmaps here and apply to it all widgets 35 // pixmaps here and apply to it all widgets
37 36
38 QFont f("times", app->font().pointSize() ); 37 QFont f("times", app->font().pointSize() );
39 f.setBold( TRUE ); 38 f.setBold( TRUE );
40 f.setItalic( TRUE ); 39 f.setItalic( TRUE );
41 app->setFont( f, TRUE, "QMenuBar"); 40 app->setFont( f, TRUE, "QMenuBar");
42 app->setFont( f, TRUE, "QPopupMenu"); 41 app->setFont( f, TRUE, "QPopupMenu");
43 42
44 43
45 //QPixmap button( stone1_xpm ); 44 //QPixmap button( stone1_xpm );
46 QPixmap button( stonedark_xpm ); 45 QPixmap button( stonedark_xpm );
47 QPixmap background(marble_xpm); 46 QPixmap background(marble_xpm);
48#if 0 47#if 0
49 48
50 int i; 49 int i;
51 for (i=0; i<img.numColors(); i++) { 50 for (i=0; i<img.numColors(); i++) {
52 QRgb rgb = img.color(i); 51 QRgb rgb = img.color(i);
53 QColor c(rgb); 52 QColor c(rgb);
54 rgb = c.dark().rgb(); 53 rgb = c.dark().rgb();
55 img.setColor(i,rgb); 54 img.setColor(i,rgb);
56 } 55 }
57 QPixmap mid; 56 QPixmap mid;
58 mid.convertFromImage(img); 57 mid.convertFromImage(img);
59 58
60 img = orig; 59 img = orig;
61 for (i=0; i<img.numColors(); i++) { 60 for (i=0; i<img.numColors(); i++) {
62 QRgb rgb = img.color(i); 61 QRgb rgb = img.color(i);
63 QColor c(rgb); 62 QColor c(rgb);
64 rgb = c.light().rgb(); 63 rgb = c.light().rgb();
65 img.setColor(i,rgb); 64 img.setColor(i,rgb);
66 } 65 }
67 QPixmap light; 66 QPixmap light;
68 light.convertFromImage(img); 67 light.convertFromImage(img);
69 68
70 img = orig; 69 img = orig;
71 for (i=0; i<img.numColors(); i++) { 70 for (i=0; i<img.numColors(); i++) {
72 QRgb rgb = img.color(i); 71 QRgb rgb = img.color(i);
73 QColor c(rgb); 72 QColor c(rgb);
74 rgb = c.dark().rgb(); 73 rgb = c.dark().rgb();
75 img.setColor(i,rgb); 74 img.setColor(i,rgb);
76 } 75 }
77 QPixmap dark; 76 QPixmap dark;
78 dark.convertFromImage(img); 77 dark.convertFromImage(img);
79#else 78#else
80 QPixmap dark( 1, 1 ); dark.fill( red.dark() ); 79 QPixmap dark( 1, 1 ); dark.fill( red.dark() );
81 QPixmap mid( stone1_xpm ); 80 QPixmap mid( stone1_xpm );
82 QPixmap light( stone1_xpm );//1, 1 ); light.fill( green ); 81 QPixmap light( stone1_xpm );//1, 1 ); light.fill( green );
83#endif 82#endif
84 QPalette op = app->palette(); 83 QPalette op = app->palette();
85 84
86 QColor backCol( 227,227,227 ); 85 QColor backCol( 227,227,227 );
87 86
88 // QPalette op(white); 87 // QPalette op(white);
89 QColorGroup active (op.normal().foreground(), 88 QColorGroup active (op.normal().foreground(),
90 QBrush(op.normal().button(),button), 89 QBrush(op.normal().button(),button),
91 QBrush(op.normal().light(), light), 90 QBrush(op.normal().light(), light),
92 QBrush(op.normal().dark(), dark), 91 QBrush(op.normal().dark(), dark),
93 QBrush(op.normal().mid(), mid), 92 QBrush(op.normal().mid(), mid),
94 op.normal().text(), 93 op.normal().text(),
95 Qt::white, 94 Qt::white,
96 op.normal().base(),// QColor(236,182,120), 95 op.normal().base(),// QColor(236,182,120),
97 QBrush(backCol, background) 96 QBrush(backCol, background)
98 ); 97 );
99 active.setColor( QColorGroup::ButtonText, Qt::white ); 98 active.setColor( QColorGroup::ButtonText, Qt::white );
100 active.setColor( QColorGroup::Shadow, Qt::black ); 99 active.setColor( QColorGroup::Shadow, Qt::black );
101 QColorGroup disabled (op.disabled().foreground(), 100 QColorGroup disabled (op.disabled().foreground(),
102 QBrush(op.disabled().button(),button), 101 QBrush(op.disabled().button(),button),
103 QBrush(op.disabled().light(), light), 102 QBrush(op.disabled().light(), light),
104 op.disabled().dark(), 103 op.disabled().dark(),
105 QBrush(op.disabled().mid(), mid), 104 QBrush(op.disabled().mid(), mid),
106 op.disabled().text(), 105 op.disabled().text(),
107 Qt::white, 106 Qt::white,
108 op.disabled().base(),// QColor(236,182,120), 107 op.disabled().base(),// QColor(236,182,120),
109 QBrush(backCol, background) 108 QBrush(backCol, background)
110 ); 109 );
111 110
112 QPalette newPalette( active, disabled, active ); 111 QPalette newPalette( active, disabled, active );
113 app->setPalette( newPalette, TRUE ); 112 app->setPalette( newPalette, TRUE );
114} 113}
115 114
116/*! 115/*!
117 Reimplementation from QStyle 116 Reimplementation from QStyle
118 */ 117 */
119void MetalStyle::unPolish( QApplication *app) 118void MetalStyle::unPolish( QApplication *app)
120{ 119{
121 app->setPalette(oldPalette, TRUE); 120 app->setPalette(oldPalette, TRUE);
122 app->setFont( app->font(), TRUE ); 121 app->setFont( app->font(), TRUE );
123} 122}
124 123
125/*! 124/*!
126 Reimplementation from QStyle 125 Reimplementation from QStyle
127 */ 126 */
128void MetalStyle::polish( QWidget* w) 127void MetalStyle::polish( QWidget* w)
129{ 128{
130 129