Simplify HunkLabel

This commit is contained in:
Ryan Jensen 2024-03-10 23:24:38 -05:00
parent cec48ca95d
commit 5e124bd363
2 changed files with 1 additions and 3 deletions

View File

@ -42,8 +42,7 @@ void _HunkWidget::HunkLabel::paintEvent(QPaintEvent *event) {
QPainter painter(this); QPainter painter(this);
painter.setRenderHint(QPainter::Antialiasing); painter.setRenderHint(QPainter::Antialiasing);
QFontMetrics fm = fontMetrics(); QFontMetrics fm = fontMetrics();
QRect rect = fm.boundingRect(0, 0, this->rect().width(), 300, QRect rect = fm.boundingRect(0, 0, this->rect().width(), 300, 0, mName);
Qt::AlignLeft | Qt::ElideRight, mName);
painter.drawText(rect, Qt::AlignLeft | Qt::ElideRight, mName); painter.drawText(rect, Qt::AlignLeft | Qt::ElideRight, mName);
} }

View File

@ -19,7 +19,6 @@ class DisclosureButton;
class Line; class Line;
namespace _HunkWidget { namespace _HunkWidget {
class HunkLabel : public QWidget { class HunkLabel : public QWidget {
public: public:
HunkLabel(const QString &name, bool submodule, QWidget *parent = nullptr); HunkLabel(const QString &name, bool submodule, QWidget *parent = nullptr);