Skip to content

Commit

Permalink
Move commit message closer to commit graph
Browse files Browse the repository at this point in the history
  • Loading branch information
jensenr30 committed Feb 23, 2024
1 parent d37a32f commit ea64181
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion LICENSE.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2018 Scientific Toolworks, Inc.
Copyright (c) 2021-2023 Gittyup contributors
Copyright (c) 2021-2024 Gittyup contributors

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
28 changes: 14 additions & 14 deletions src/ui/CommitList.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,20 @@ class CommitDelegate : public QStyledItemDelegate {
rect.setWidth(rect.width() - timestampWidth - constants.hMargin);
}

// Draw Name.
if (showAuthor) {
QString name = commit.author().name() + " ";
painter->save();
QFont bold = opt.font;
bold.setBold(true);
painter->setFont(bold);
painter->drawText(rect, Qt::AlignRight, name);
painter->restore();
const QFontMetrics boldFm(bold);
rect.setWidth(rect.width() - boldFm.horizontalAdvance(name) -
constants.hMargin);
}

// Calculate remaining width for the references.
QRect ref = rect;
int refsWidth = ref.width() - minWidthDesc;
Expand All @@ -847,20 +861,6 @@ class CommitDelegate : public QStyledItemDelegate {
badgesWidth = Badge::paint(painter, refs, ref, &opt, Qt::AlignLeft);
rect.setX(badgesWidth); // Comes right after the badges

// Draw Name.
if (showAuthor) {
QString name = commit.author().name();
painter->save();
QFont bold = opt.font;
bold.setBold(true);
painter->setFont(bold);
painter->drawText(rect, Qt::AlignLeft, name);
painter->restore();
const QFontMetrics boldFm(bold);
rect.setX(rect.x() + boldFm.horizontalAdvance(name) +
constants.hMargin);
}

// Draw message.
painter->save();
painter->setPen(bright);
Expand Down

0 comments on commit ea64181

Please sign in to comment.