From 12149d50893c69f3a5f07dcb12fffb951e05dd92 Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 22 Jan 2014 23:02:51 +0100 Subject: [PATCH] LedCheckBox: fixed label alignment After switching to wide rectangular LED pixmaps and increasing the font size we need to adjust aligment of label. --- src/gui/widgets/led_checkbox.cpp | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/gui/widgets/led_checkbox.cpp b/src/gui/widgets/led_checkbox.cpp index 37b91bf6b..142bee740 100644 --- a/src/gui/widgets/led_checkbox.cpp +++ b/src/gui/widgets/led_checkbox.cpp @@ -1,7 +1,7 @@ /* * led_checkbox.cpp - class ledCheckBox, an improved QCheckBox * - * Copyright (c) 2005-2009 Tobias Doerffel + * Copyright (c) 2005-2014 Tobias Doerffel * * This file is part of Linux MultiMedia Studio - http://lmms.sourceforge.net * @@ -54,9 +54,7 @@ ledCheckBox::ledCheckBox( const QString & _text, QWidget * _parent, m_ledOffPixmap = new QPixmap( embed::getIconPixmap( "led_off" ) ); setFont( pointSize<7>( font() ) ); - setFixedSize( m_ledOffPixmap->width() + 4 + - QFontMetrics( font() ).width( text() ), - m_ledOffPixmap->height() ); + setFixedSize( m_ledOffPixmap->width() + 5 + QFontMetrics( font() ).width( text() ), m_ledOffPixmap->height() ); } @@ -86,9 +84,9 @@ void ledCheckBox::paintEvent( QPaintEvent * ) } p.setPen( QColor( 64, 64, 64 ) ); - p.drawText( m_ledOffPixmap->width() + 3, 10, text() ); + p.drawText( m_ledOffPixmap->width() + 4, 11, text() ); p.setPen( QColor( 255, 255, 255 ) ); - p.drawText( m_ledOffPixmap->width() + 2, 9, text() ); + p.drawText( m_ledOffPixmap->width() + 3, 10, text() ); }