Change the title for SideBarWidgets to be vertically centered related… (#6833)

* Change the title for SideBarWidgets to be vertically centered related to icon and with no underlining

* Update src/gui/SideBarWidget.cpp

Co-authored-by: saker <sakertooth@gmail.com>

---------

Co-authored-by: saker <sakertooth@gmail.com>
This commit is contained in:
MrTopom
2023-08-27 20:11:41 +02:00
committed by GitHub
parent 0e93f1332b
commit e2fd288ae7

View File

@@ -62,16 +62,16 @@ void SideBarWidget::paintEvent( QPaintEvent * )
QFont f = p.font();
f.setBold( true );
f.setUnderline( true );
f.setUnderline(false);
f.setPointSize( f.pointSize() + 2 );
p.setFont( f );
p.setPen( palette().highlightedText().color() );
const int tx = m_icon.width()+4;
const int tx = m_icon.width() + 8;
QFontMetrics metrics( f );
const int ty = metrics.ascent();
const int ty = (metrics.ascent() + m_icon.height()) / 2;
p.drawText( tx, ty, m_title );
p.drawPixmap( 2, 2, m_icon.transformed( QTransform().rotate( -90 ) ) );