#include "kyhline.h"

KyHLine::KyHLine(QWidget *parent) : QFrame(parent)
{
    this->setFixedHeight(1);
    if(QGSettings::isSchemaInstalled("org.ukui.style")) {
        StyleSettings = new QGSettings("org.ukui.style");
        connect(StyleSettings,&QGSettings::changed,this,[=](const QString &key) {
            if(key == "styleName")
                this->update();
        });
    }
}

void KyHLine::paintEvent(QPaintEvent * e)
{
    QPainter p(this);
    QColor color = qApp->palette().color(QPalette::BrightText);
    color.setAlphaF(0.08);
    p.save();
    p.setBrush(color);
    p.setPen(Qt::transparent);
    p.drawRoundedRect(this->rect(), 6, 6);
    p.restore();
    return QFrame::paintEvent(e);
}
