| 31 | } |
| 32 | |
| 33 | void ElaTheme::drawEffectShadow(QPainter* painter, const QRect& widgetRect, int shadowBorderWidth, int borderRadius) |
| 34 | { |
| 35 | Q_D(ElaTheme); |
| 36 | painter->save(); |
| 37 | painter->setRenderHints(QPainter::Antialiasing); |
| 38 | QPainterPath path; |
| 39 | path.setFillRule(Qt::WindingFill); |
| 40 | QColor color = d->_themeMode == ElaThemeType::Light ? QColor(0x70, 0x70, 0x70) : QColor(0x9C, 0x9B, 0x9E); |
| 41 | for (int i = 0; i < shadowBorderWidth; i++) |
| 42 | { |
| 43 | path.addRoundedRect(widgetRect.x() + shadowBorderWidth - i, widgetRect.y() + shadowBorderWidth - i, widgetRect.width() - (shadowBorderWidth - i) * 2, widgetRect.height() - (shadowBorderWidth - i) * 2, borderRadius + i, borderRadius + i); |
| 44 | int alpha = 1 * (shadowBorderWidth - i + 1); |
| 45 | color.setAlpha(alpha > 255 ? 255 : alpha); |
| 46 | painter->setPen(color); |
| 47 | painter->drawPath(path); |
| 48 | } |
| 49 | painter->restore(); |
| 50 | } |
| 51 | |
| 52 | void ElaTheme::setThemeColor(ElaThemeType::ThemeMode themeMode, ElaThemeType::ThemeColor themeColor, const QColor& newColor) |
| 53 | { |
no outgoing calls
no test coverage detected