author | alwin <alwin> | 2005-03-07 09:42:21 (UTC) |
---|---|---|
committer | alwin <alwin> | 2005-03-07 09:42:21 (UTC) |
commit | d6fc7417f752867c14a0b6555c32f2d768736fe8 (patch) (unidiff) | |
tree | 29b1780ed157b799cbcf8133f846b74da248e8e5 | |
parent | f312f32d624c6198c63890e141e8658bc492cf37 (diff) | |
download | opie-d6fc7417f752867c14a0b6555c32f2d768736fe8.zip opie-d6fc7417f752867c14a0b6555c32f2d768736fe8.tar.gz opie-d6fc7417f752867c14a0b6555c32f2d768736fe8.tar.bz2 |
applied patch from Paul Eggleton
-rw-r--r-- | noncore/styles/phase/phasestyle.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/styles/phase/phasestyle.cpp b/noncore/styles/phase/phasestyle.cpp index 906ccee..746354e 100644 --- a/noncore/styles/phase/phasestyle.cpp +++ b/noncore/styles/phase/phasestyle.cpp | |||
@@ -131,97 +131,97 @@ PhaseStyle::~PhaseStyle() { | |||
131 | void PhaseStyle::drawCheckMark ( QPainter * p, int x, int y, int w, | 131 | void PhaseStyle::drawCheckMark ( QPainter * p, int x, int y, int w, |
132 | int h, const QColorGroup & g, | 132 | int h, const QColorGroup & g, |
133 | bool , bool) { | 133 | bool , bool) { |
134 | p->setPen(g.text()); | 134 | p->setPen(g.text()); |
135 | p->drawPixmap(x+w/2-4, y+h/2-4, bcheck); | 135 | p->drawPixmap(x+w/2-4, y+h/2-4, bcheck); |
136 | } | 136 | } |
137 | 137 | ||
138 | void PhaseStyle::drawArrow(QPainter *painter, Qt::ArrowType type, bool down, | 138 | void PhaseStyle::drawArrow(QPainter *painter, Qt::ArrowType type, bool down, |
139 | int x, int y, int w, int h, const QColorGroup &group, | 139 | int x, int y, int w, int h, const QColorGroup &group, |
140 | bool enabled , const QBrush * ) { | 140 | bool enabled , const QBrush * ) { |
141 | switch( type ) { | 141 | switch( type ) { |
142 | case UpArrow: | 142 | case UpArrow: |
143 | if (enabled) | 143 | if (enabled) |
144 | painter->setPen(down ? group.midlight() : group.dark()); | 144 | painter->setPen(down ? group.midlight() : group.dark()); |
145 | else painter->setPen(group.mid()); | 145 | else painter->setPen(group.mid()); |
146 | painter->drawPixmap(x+w/2-3, y+h/2-3, uarrow); | 146 | painter->drawPixmap(x+w/2-3, y+h/2-3, uarrow); |
147 | break; | 147 | break; |
148 | case DownArrow: | 148 | case DownArrow: |
149 | if (enabled) painter->setPen(down ? group.midlight() : group.dark()); | 149 | if (enabled) painter->setPen(down ? group.midlight() : group.dark()); |
150 | else painter->setPen(group.mid()); | 150 | else painter->setPen(group.mid()); |
151 | painter->drawPixmap(x+w/2-3, y+h/2-3, darrow); | 151 | painter->drawPixmap(x+w/2-3, y+h/2-3, darrow); |
152 | break; | 152 | break; |
153 | case LeftArrow: | 153 | case LeftArrow: |
154 | if (enabled) painter->setPen(down ? group.midlight() : group.dark()); | 154 | if (enabled) painter->setPen(down ? group.midlight() : group.dark()); |
155 | else painter->setPen(group.mid()); | 155 | else painter->setPen(group.mid()); |
156 | painter->drawPixmap(x+w/2-3, y+h/2-3, larrow); | 156 | painter->drawPixmap(x+w/2-3, y+h/2-3, larrow); |
157 | break; | 157 | break; |
158 | case RightArrow: | 158 | case RightArrow: |
159 | if (enabled) painter->setPen(down ? group.midlight() : group.dark()); | 159 | if (enabled) painter->setPen(down ? group.midlight() : group.dark()); |
160 | else painter->setPen(group.mid()); | 160 | else painter->setPen(group.mid()); |
161 | painter->drawPixmap(x+w/2-3, y+h/2-3, rarrow); | 161 | painter->drawPixmap(x+w/2-3, y+h/2-3, rarrow); |
162 | break; | 162 | break; |
163 | } | 163 | } |
164 | } | 164 | } |
165 | 165 | ||
166 | void PhaseStyle::drawPushButton(QPushButton *btn, QPainter *painter) { | 166 | void PhaseStyle::drawPushButton(QPushButton *btn, QPainter *painter) { |
167 | QRect r = btn->rect(); | 167 | QRect r = btn->rect(); |
168 | int x = r.x(); | 168 | int x = r.x(); |
169 | int y = r.y(); | 169 | int y = r.y(); |
170 | int h = r.height(); | 170 | int h = r.height(); |
171 | int w = r.width(); | 171 | int w = r.width(); |
172 | bool depress = btn->isOn() || btn->isDown(); | 172 | bool depress = btn->isOn() || btn->isDown(); |
173 | QColorGroup group = btn->colorGroup(); | 173 | QColorGroup group = btn->colorGroup(); |
174 | QBrush brush(group.button() ); | 174 | QBrush brush(group.button() ); |
175 | // int bd = pixelMetric(PM_ButtonDefaultIndicator, widget) + 1; | 175 | // int bd = pixelMetric(PM_ButtonDefaultIndicator, widget) + 1; |
176 | static int bd = 2; | 176 | static int bd = 2; |
177 | 177 | ||
178 | if (btn->isDefault() && !depress) { | 178 | if (btn->isDefault() && !depress) { |
179 | drawPanel(painter, x, y, h, w, group, | 179 | drawPanel(painter, x, y, w, h, group, |
180 | &group.brush(QColorGroup::Mid), true); | 180 | &group.brush(QColorGroup::Mid), true); |
181 | drawBevelButton(painter, x+bd, y+bd, w-bd*2, h-bd*2, group, | 181 | drawBevelButton(painter, x+bd, y+bd, w-bd*2, h-bd*2, group, |
182 | false, &brush ); | 182 | false, &brush ); |
183 | } else { | 183 | } else { |
184 | drawButton(painter, x, y, w, h, group, depress, | 184 | drawButton(painter, x, y, w, h, group, depress, |
185 | &brush ); | 185 | &brush ); |
186 | } | 186 | } |
187 | 187 | ||
188 | if (btn->hasFocus() ) { // draw focus | 188 | if (btn->hasFocus() ) { // draw focus |
189 | QColor col; | 189 | QColor col; |
190 | drawFocusRect(painter, r, group, | 190 | drawFocusRect(painter, r, group, |
191 | &col, false ); | 191 | &col, false ); |
192 | } | 192 | } |
193 | } | 193 | } |
194 | 194 | ||
195 | 195 | ||
196 | void PhaseStyle::drawPanel(QPainter* painter, int x, int y, int w, int h, | 196 | void PhaseStyle::drawPanel(QPainter* painter, int x, int y, int w, int h, |
197 | const QColorGroup& group, bool sunken, | 197 | const QColorGroup& group, bool sunken, |
198 | int , const QBrush* fill) { | 198 | int , const QBrush* fill) { |
199 | int x2 = x + w - 1; | 199 | int x2 = x + w - 1; |
200 | int y2 = y + h - 1; | 200 | int y2 = y + h - 1; |
201 | painter->save(); | 201 | painter->save(); |
202 | 202 | ||
203 | if (sunken) { | 203 | if (sunken) { |
204 | painter->setPen(group.dark()); | 204 | painter->setPen(group.dark()); |
205 | painter->drawRect(x+1, y+1, w-2, h-2); | 205 | painter->drawRect(x+1, y+1, w-2, h-2); |
206 | painter->setPen(group.midlight()); | 206 | painter->setPen(group.midlight()); |
207 | painter->drawLine(x+1, y2, x2, y2); | 207 | painter->drawLine(x+1, y2, x2, y2); |
208 | painter->drawLine(x2, y+1, x2, y2-1); | 208 | painter->drawLine(x2, y+1, x2, y2-1); |
209 | painter->setPen(group.mid()); | 209 | painter->setPen(group.mid()); |
210 | painter->drawLine(x, y, x, y2-1); | 210 | painter->drawLine(x, y, x, y2-1); |
211 | painter->drawLine(x+1, y, x2-1, y); | 211 | painter->drawLine(x+1, y, x2-1, y); |
212 | painter->setPen(group.background()); | 212 | painter->setPen(group.background()); |
213 | painter->drawPoint(x, y2); | 213 | painter->drawPoint(x, y2); |
214 | painter->drawPoint(x2, y); | 214 | painter->drawPoint(x2, y); |
215 | } else { | 215 | } else { |
216 | painter->setPen(group.dark()); | 216 | painter->setPen(group.dark()); |
217 | painter->drawRect(x, y, w, h); | 217 | painter->drawRect(x, y, w, h); |
218 | painter->setPen(group.midlight()); | 218 | painter->setPen(group.midlight()); |
219 | painter->drawLine(x+1, y+1, x2-2, y+1); | 219 | painter->drawLine(x+1, y+1, x2-2, y+1); |
220 | painter->drawLine(x+1, y+2, x+1, y2-2); | 220 | painter->drawLine(x+1, y+2, x+1, y2-2); |
221 | painter->setPen(group.mid()); | 221 | painter->setPen(group.mid()); |
222 | painter->drawLine(x+2, y2-1, x2-1, y2-1); | 222 | painter->drawLine(x+2, y2-1, x2-1, y2-1); |
223 | painter->drawLine(x2-1, y+2, x2-1, y2-2); | 223 | painter->drawLine(x2-1, y+2, x2-1, y2-2); |
224 | painter->setPen(group.background()); | 224 | painter->setPen(group.background()); |
225 | painter->drawPoint(x+1, y2-1); | 225 | painter->drawPoint(x+1, y2-1); |
226 | painter->drawPoint(x2-1, y+1); | 226 | painter->drawPoint(x2-1, y+1); |
227 | } | 227 | } |