diff --git a/plugins/decoration/button.cpp b/plugins/decoration/button.cpp index 167df7a..3368202 100644 --- a/plugins/decoration/button.cpp +++ b/plugins/decoration/button.cpp @@ -73,8 +73,8 @@ void Button::paint(QPainter *painter, const QRect &repaintRegion) painter->save(); painter->setRenderHints(QPainter::Antialiasing); - QRect btnRect(0, 0, 28 * decoration->devicePixelRatio(), - 28 * decoration->devicePixelRatio()); + QRect btnRect(0, 0, 29 * decoration->devicePixelRatio(), + 29 * decoration->devicePixelRatio()); btnRect.moveCenter(rect.center()); if (isHovered() || isPressed()) { diff --git a/plugins/decoration/decoration.cpp b/plugins/decoration/decoration.cpp index 1b1a83d..e456587 100644 --- a/plugins/decoration/decoration.cpp +++ b/plugins/decoration/decoration.cpp @@ -106,6 +106,7 @@ void Decoration::init() auto s = settings(); m_devicePixelRatio = m_settings->value("PixelRatio", 1.0).toReal(); + m_frameRadius = 12 * m_devicePixelRatio; reconfigure(); updateTitleBar(); @@ -254,13 +255,12 @@ void Decoration::updateShadow() // assign global shadow if exists and parameters match if (!g_sShadow) { // assign parameters - g_shadowSize = 70; - g_shadowStrength = 30; + g_shadowSize = 90; + g_shadowStrength = 35; g_shadowColor = Qt::black; - const int frameRadius = 12; - const int shadowOverlap = frameRadius; + const int shadowOverlap = m_frameRadius; // const int shadowOffset = qMax(6 * g_shadowSize / 16, shadowOverlap * 2); - const int shadowOffset = shadowOverlap; + const int shadowOffset = shadowOverlap / 2; // create image QImage image(2 * g_shadowSize, 2 * g_shadowSize, QImage::Format_ARGB32_Premultiplied); @@ -301,13 +301,13 @@ void Decoration::updateShadow() painter.setPen( gradientStopColor(g_shadowColor, g_shadowStrength * 0.5)); painter.setBrush(Qt::NoBrush); - painter.drawRoundedRect(innerRect, -0.5 + frameRadius, -0.5 + frameRadius); + painter.drawRoundedRect(innerRect, -0.5 + m_frameRadius, -0.5 + m_frameRadius); // mask out inner rect painter.setPen(Qt::NoPen); painter.setBrush(Qt::black); painter.setCompositionMode(QPainter::CompositionMode_DestinationOut); - painter.drawRoundedRect(innerRect, 0.5 + frameRadius, 0.5 + frameRadius); + painter.drawRoundedRect(innerRect, 0.5 + m_frameRadius, 0.5 + m_frameRadius); painter.end(); g_sShadow = QSharedPointer::create(); diff --git a/plugins/roundedwindow/roundedwindow.cpp b/plugins/roundedwindow/roundedwindow.cpp index fe29132..52ca2bb 100644 --- a/plugins/roundedwindow/roundedwindow.cpp +++ b/plugins/roundedwindow/roundedwindow.cpp @@ -27,6 +27,8 @@ #include #include +#include + Q_DECLARE_METATYPE(QPainterPath) typedef void (* SetDepth)(void *, int); @@ -187,6 +189,10 @@ RoundedWindow::RoundedWindow(QObject *, const QVariantList &) : KWin::Effect() , m_frameRadius(12) { + QSettings settings(QSettings::UserScope, "cutefishos", "theme"); + qreal devicePixelRatio = settings.value("PixelRatio", 1.0).toReal(); + m_frameRadius = 12 * devicePixelRatio; + setDepthfunc = (SetDepth) QLibrary::resolve("kwin.so." + qApp->applicationVersion(), "_ZN4KWin8Toplevel8setDepthEi"); QString name = "_NET_WM_STATE";