//
// Created by arjun-flowylabs on 1/13/2026.
//

#include "VerticalLabel.h"
#include <QPainter>

VerticalLabel::VerticalLabel(const QString &text, QWidget *parent) : QLabel(text, parent)
{

}

QSize VerticalLabel::sizeHint() const
{
    QSize s = QLabel::sizeHint();
    return QSize(s.height(), s.width());
}

QSize VerticalLabel::minimumSizeHint() const
{
    QSize s = QLabel::minimumSizeHint();
    return QSize(s.height(), s.width());
}

void VerticalLabel::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    painter.setRenderHint(QPainter::Antialiasing);
    painter.setPen(palette().color(QPalette::WindowText));
    painter.setFont(font());
    painter.translate(0, height());
    painter.rotate(-90);
    painter.drawText(QRect(0, 0, height(), width()), Qt::AlignCenter, text());
}
