Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/widgets/kis_curve_widget.cpp
Context not available. | |||||
266 | int wWidth = width() - 1; | 266 | int wWidth = width() - 1; | ||
---|---|---|---|---|---|
267 | int wHeight = height() - 1; | 267 | int wHeight = height() - 1; | ||
268 | 268 | | |||
269 | QPainter p(this); | | |||
270 | 269 | | |||
271 | QPalette appPalette = QApplication::palette(); | 270 | QPainter p(this); | ||
272 | 271 | | |||
273 | // Antialiasing is not a good idea here, because | 272 | // Antialiasing is not a good idea here, because | ||
274 | // the grid will drift one pixel to any side due to rounding of int | 273 | // the grid will drift one pixel to any side due to rounding of int | ||
275 | // FIXME: let's user tell the last word (in config) | 274 | // FIXME: let's user tell the last word (in config) | ||
276 | //p.setRenderHint(QPainter::Antialiasing); | 275 | //p.setRenderHint(QPainter::Antialiasing); | ||
276 | QPalette appPalette = QApplication::palette(); | ||||
277 | p.fillRect(rect(), appPalette.color(QPalette::Base)); // clear out previous paint call results | ||||
278 | | ||||
279 | // make the entire widget greyed out if it is disabled | ||||
280 | if (!this->isEnabled()) { | ||||
281 | p.setOpacity(0.2); | ||||
282 | } | ||||
283 | | ||||
277 | 284 | | |||
278 | // fill with color to show widget bounds | | |||
279 | p.fillRect(rect(), appPalette.color(QPalette::Base)); | | |||
280 | 285 | | |||
281 | // draw background | 286 | // draw background | ||
282 | if (!d->m_pix.isNull()) { | 287 | if (!d->m_pix.isNull()) { | ||
Context not available. | |||||
359 | QPainterPath widgetBoundsPath; | 364 | QPainterPath widgetBoundsPath; | ||
360 | widgetBoundsPath.addRect(rect()); | 365 | widgetBoundsPath.addRect(rect()); | ||
361 | p.strokePath(widgetBoundsPath, appPalette.color(QPalette::Text)); | 366 | p.strokePath(widgetBoundsPath, appPalette.color(QPalette::Text)); | ||
367 | | ||||
368 | | ||||
369 | p.setOpacity(1.0); // reset to 1.0 in case we were drawing a disabled widget before | ||||
362 | } | 370 | } | ||
363 | 371 | | |||
364 | void KisCurveWidget::mousePressEvent(QMouseEvent * e) | 372 | void KisCurveWidget::mousePressEvent(QMouseEvent * e) | ||
Context not available. |