Skip to content

Commit

Permalink
bigger padding + bold font text in custom button
Browse files Browse the repository at this point in the history
Signed-off-by: KhalilSelyan <[email protected]>
  • Loading branch information
KhalilSelyan committed May 17, 2024
1 parent b758423 commit 3cb4b1a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions common/tier4_state_rviz_plugin/src/custom_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,12 @@ CustomElevatedButton::CustomElevatedButton(
setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
setCursor(Qt::PointingHandCursor);

// set font weight to bold and size to 12
QFont font = this->font();
font.setWeight(QFont::Bold);
font.setFamily("Roboto");
setFont(font);

// Set up drop shadow effect
QGraphicsDropShadowEffect * shadowEffect = new QGraphicsDropShadowEffect(this);
shadowEffect->setBlurRadius(15);
Expand All @@ -20,8 +26,8 @@ QSize CustomElevatedButton::sizeHint() const
QFontMetrics fm(font());
int textWidth = fm.horizontalAdvance(text());
int textHeight = fm.height();
int width = textWidth + 40; // Adding padding
int height = textHeight + 20; // Adding padding
int width = textWidth + 45; // Adding padding
int height = textHeight + 25; // Adding padding
return QSize(width, height);
}

Expand Down

0 comments on commit 3cb4b1a

Please sign in to comment.