<commit_before>#include "musicbackgroundlistwidget.h"

#include <QPainter>

MusicBackgroundListItem::MusicBackgroundListItem(QWidget *parent)
    : QLabel(parent)
{
    setFixedSize(137, 100);
    setCursor(Qt::PointingHandCursor);

    m_printMask = false;
    m_isSelected = false;
}

QString MusicBackgroundListItem::getClassName()
{
    return staticMetaObject.className();
}

void MusicBackgroundListItem::select(bool select)
{
    m_isSelected = select;
    update();
}

void MusicBackgroundListItem::mousePressEvent(QMouseEvent *event)
{
    QLabel::mousePressEvent(event);
    emit itemClicked(this);
}

void MusicBackgroundListItem::leaveEvent(QEvent *event)
{
    QLabel::leaveEvent(event);
    m_printMask = false;
    update();
}

void MusicBackgroundListItem::enterEvent(QEvent *event)
{
    QLabel::enterEvent(event);
    m_printMask = true;
    update();
}

void MusicBackgroundListItem::paintEvent(QPaintEvent *event)
{
    QLabel::paintEvent(event);

    if(m_isSelected)
    {
        QPainter painter(this);
        painter.drawPixmap(width() - 17, height() - 17, 17, 17, QPixmap(":/tiny/lb_selected"));
    }

    if(m_printMask)
    {
        QPainter painter(this);
        painter.setBrush(QColor(0, 0, 0, 155));
        painter.drawRect(rect());


        QFont f = painter.font();
        f.setPixelSize(15);
        painter.setFont(f);
        QFontMetrics metric(painter.font());

        painter.setPen(Qt::white);
        painter.drawText((width() - metric.width(m_name))/2, 32, m_name);
        painter.drawText((width() - metric.width(tr("Used By 88888")))/2, 50, tr("Used By 88888"));
        painter.drawText((width() - metric.width(tr("Au: Greedysky")))/2, 68, tr("Au: Greedysky"));
    }
}


MusicBackgroundListWidget::MusicBackgroundListWidget(QWidget *parent)
    : QWidget(parent)
{
    m_layout = new QGridLayout(this);
    m_layout->setContentsMargins(7, 7, 7, 7);
    setLayout(m_layout);

    m_currentItem = nullptr;
}

MusicBackgroundListWidget::~MusicBackgroundListWidget()
{
    clearAllItems();<commit_msg>set background skin dialog item font size to 13[611014]<commit_after>#include "musicbackgroundlistwidget.h"

#include <QPainter>

MusicBackgroundListItem::MusicBackgroundListItem(QWidget *parent)
    : QLabel(parent)
{
    setFixedSize(137, 100);
    setCursor(Qt::PointingHandCursor);

    m_printMask = false;
    m_isSelected = false;
}

QString MusicBackgroundListItem::getClassName()
{
    return staticMetaObject.className();
}

void MusicBackgroundListItem::select(bool select)
{
    m_isSelected = select;
    update();
}

void MusicBackgroundListItem::mousePressEvent(QMouseEvent *event)
{
    QLabel::mousePressEvent(event);
    emit itemClicked(this);
}

void MusicBackgroundListItem::leaveEvent(QEvent *event)
{
    QLabel::leaveEvent(event);
    m_printMask = false;
    update();
}

void MusicBackgroundListItem::enterEvent(QEvent *event)
{
    QLabel::enterEvent(event);
    m_printMask = true;
    update();
}

void MusicBackgroundListItem::paintEvent(QPaintEvent *event)
{
    QLabel::paintEvent(event);

    if(m_isSelected)
    {
        QPainter painter(this);
        painter.drawPixmap(width() - 17, height() - 17, 17, 17, QPixmap(":/tiny/lb_selected"));
    }

    if(m_printMask)
    {
        QPainter painter(this);
        painter.setBrush(QColor(0, 0, 0, 155));
        painter.drawRect(rect());


        QFont f = painter.font();
        f.setPixelSize(13);
        painter.setFont(f);
        QFontMetrics metric(painter.font());

        painter.setPen(Qt::white);
        painter.drawText((width() - metric.width(m_name))/2, 32, m_name);
        painter.drawText((width() - metric.width(tr("Used By 88888")))/2, 50, tr("Used By 88888"));
        painter.drawText((width() - metric.width(tr("Au: Greedysky")))/2, 68, tr("Au: Greedysky"));
    }
}


MusicBackgroundListWidget::MusicBackgroundListWidget(QWidget *parent)
    : QWidget(parent)
{
    m_layout = new QGridLayout(this);
    m_layout->setContentsMargins(7, 7, 7, 7);
    setLayout(m_layout);

    m_currentItem = nullptr;
}

MusicBackgroundListWidget::~MusicBackgroundListWidget()
{
    clearAllItems();
{'fraction_non_alphanumeric': 0.1398264223722276, 'fraction_numerical': 0.023625843780135006, 'mean_word_length': 4.041312272174969, 'pattern_counts': {'":': 2, '<': 5, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2552424', 'n_tokens_mistral': 1466, 'n_tokens_neox': 1365, 'n_words': 221}