Commit 276efb8e authored by Dmitry Kazakov's avatar Dmitry Kazakov

Draw the markers in gray when the widget is not enabled

parent 772d3465
...@@ -370,8 +370,12 @@ void KoMarker::applyShapeStroke(KoShape *parentShape, KoShapeStroke *stroke, con ...@@ -370,8 +370,12 @@ void KoMarker::applyShapeStroke(KoShape *parentShape, KoShapeStroke *stroke, con
// Unwrap the gradient to work in global mode // Unwrap the gradient to work in global mode
if (g->coordinateMode() == QGradient::ObjectBoundingMode) { if (g->coordinateMode() == QGradient::ObjectBoundingMode) {
const QRectF boundingRect = QRectF boundingRect =
KisAlgebra2D::ensureRectNotSmaller(parentShape->outline().boundingRect(), QSizeF(1.0, 1.0)); parentShape ?
parentShape->outline().boundingRect() :
this->boundingRect(strokeWidth, nodeAngle);
boundingRect = KisAlgebra2D::ensureRectNotSmaller(boundingRect, QSizeF(1.0, 1.0));
gradientToUser = QTransform(boundingRect.width(), 0, 0, boundingRect.height(), gradientToUser = QTransform(boundingRect.width(), 0, 0, boundingRect.height(),
boundingRect.x(), boundingRect.y()); boundingRect.x(), boundingRect.y());
......
...@@ -59,10 +59,12 @@ void KoLineStyleSelector::paintEvent(QPaintEvent *pe) ...@@ -59,10 +59,12 @@ void KoLineStyleSelector::paintEvent(QPaintEvent *pe)
r.adjust(-14, 0, 14, 1); r.adjust(-14, 0, 14, 1);
QPen pen = itemData(currentIndex(), Qt::DecorationRole).value<QPen>(); QPen pen = itemData(currentIndex(), Qt::DecorationRole).value<QPen>();
pen.setBrush(option.palette.text()); // use the view-specific palette; the model hardcodes this to black
QPainter painter(this); QPainter painter(this);
painter.setPen(pen); painter.setPen(pen);
if (!(option.state & QStyle::State_Enabled)) {
painter.setOpacity(0.5);
}
painter.drawLine(r.left(), r.center().y(), r.right(), r.center().y()); painter.drawLine(r.left(), r.center().y(), r.right(), r.center().y());
} }
......
...@@ -68,7 +68,10 @@ void KoMarkerSelector::paintEvent(QPaintEvent *pe) ...@@ -68,7 +68,10 @@ void KoMarkerSelector::paintEvent(QPaintEvent *pe)
painter.setRenderHint(QPainter::Antialiasing, true); painter.setRenderHint(QPainter::Antialiasing, true);
} }
QPen pen(option.palette.text(), 2); if (!(option.state & QStyle::State_Enabled)) {
painter.setOpacity(0.5);
}
QPen pen(Qt::black, 2);
KoMarker *marker = itemData(currentIndex(), Qt::DecorationRole).value<KoMarker*>(); KoMarker *marker = itemData(currentIndex(), Qt::DecorationRole).value<KoMarker*>();
KoMarkerItemDelegate::drawMarkerPreview(&painter, rect, pen, marker, d->model->position()); KoMarkerItemDelegate::drawMarkerPreview(&painter, rect, pen, marker, d->model->position());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment