Mercurial > hg > svgui
comparison widgets/AudioDial.cpp @ 738:d26545a2a02d tonioni
Rather than undrawing the bottom bit of the dial, don't draw it in the first place (necessary on shaded background)
author | Chris Cannam |
---|---|
date | Thu, 06 Mar 2014 13:52:33 +0000 |
parents | 1a0dfcbffaf1 |
children | 4a578a360011 |
comparison
equal
deleted
inserted
replaced
737:0c1ef0d05c82 | 738:d26545a2a02d |
---|---|
229 paint.drawArc(indent, indent, | 229 paint.drawArc(indent, indent, |
230 width-2*indent, width-2*indent, shadowAngle - arc, 240); | 230 width-2*indent, width-2*indent, shadowAngle - arc, 240); |
231 c = c.light(110); | 231 c = c.light(110); |
232 } | 232 } |
233 | 233 |
234 // Scale shadow... | 234 // Scale shadow, omitting the bottom part... |
235 | 235 |
236 shadowAngle = 2160; | 236 shadowAngle = 2160; |
237 c = palette().dark().color(); | 237 c = palette().shadow().color(); |
238 for (int arc = 120; arc < 2880; arc += 240) { | 238 for (int i = 0; i < 5; ++i) { |
239 pen.setColor(c); | 239 pen.setColor(c); |
240 paint.setPen(pen); | 240 paint.setPen(pen); |
241 int arc = i * 240 + 120; | |
241 paint.drawArc(scale/2, scale/2, | 242 paint.drawArc(scale/2, scale/2, |
242 width-scale, width-scale, shadowAngle + arc, 240); | 243 width-scale, width-scale, shadowAngle + arc, 240); |
244 c = c.light(110); | |
245 } | |
246 c = palette().shadow().color(); | |
247 for (int i = 0; i < 12; ++i) { | |
248 pen.setColor(c); | |
249 paint.setPen(pen); | |
250 int arc = i * 240 + 120; | |
243 paint.drawArc(scale/2, scale/2, | 251 paint.drawArc(scale/2, scale/2, |
244 width-scale, width-scale, shadowAngle - arc, 240); | 252 width-scale, width-scale, shadowAngle - arc, 240); |
245 c = c.light(108); | 253 c = c.light(110); |
246 } | 254 } |
247 | |
248 // Undraw the bottom part... | |
249 | |
250 pen.setColor(palette().background().color()); | |
251 pen.setWidth(scale * 4); | |
252 paint.setPen(pen); | |
253 paint.drawArc(scale/2, scale/2, | |
254 width-scale, width-scale, -45 * 16, -92 * 16); | |
255 | 255 |
256 // Scale ends... | 256 // Scale ends... |
257 | 257 |
258 pen.setColor(palette().dark().color()); | 258 pen.setColor(palette().shadow().color()); |
259 pen.setWidth(scale); | 259 pen.setWidth(scale); |
260 paint.setPen(pen); | 260 paint.setPen(pen); |
261 for (int i = 0; i < numTicks; ++i) { | 261 for (int i = 0; i < numTicks; ++i) { |
262 if (i != 0 && i != numTicks - 1) continue; | 262 if (i != 0 && i != numTicks - 1) continue; |
263 int div = numTicks; | 263 int div = numTicks; |