Skip to content

Commit

Permalink
style: increase right padding for key color rectangle
Browse files Browse the repository at this point in the history
  • Loading branch information
danferns committed Jun 19, 2024
1 parent 680c86f commit dc9a32f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/library/tabledelegates/keydelegate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,16 @@ void KeyDelegate::paintItem(
qcolor);
}

const int rectWidth = 10; // 2px left padding + 4px width + 4px right padding

QString elidedText = option.fontMetrics.elidedText(
index.data().toString(),
Qt::ElideLeft,
columnWidth(index) - 8); // Subtracting total width of the rectangle
columnWidth(index) - rectWidth);

painter->drawText(option.rect.x() + 8,
painter->drawText(option.rect.x() + rectWidth,
option.rect.y(),
option.rect.width() - 8,
option.rect.width() - rectWidth,
option.rect.height(),
Qt::AlignVCenter,
elidedText);
Expand Down

0 comments on commit dc9a32f

Please # to comment.