[vlc-commits] Qt: EPGChannels: drop the program number
Francois Cartegnie
git at videolan.org
Sat Mar 5 16:25:48 CET 2011
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sat Mar 5 15:34:47 2011 +0100| [c0a8feb30f7cad005d70ed0558b1521601bcdc43] | committer: Francois Cartegnie
Qt: EPGChannels: drop the program number
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=c0a8feb30f7cad005d70ed0558b1521601bcdc43
---
modules/gui/qt4/components/epg/EPGChannels.cpp | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/modules/gui/qt4/components/epg/EPGChannels.cpp b/modules/gui/qt4/components/epg/EPGChannels.cpp
index 50dc062..4010106 100644
--- a/modules/gui/qt4/components/epg/EPGChannels.cpp
+++ b/modules/gui/qt4/components/epg/EPGChannels.cpp
@@ -52,10 +52,16 @@ void EPGChannels::paintEvent( QPaintEvent *event )
for( int i = 0; i < channels.count(); ++i )
{
+ QString text( channels[i] );
+ /* try to remove the " [Program xxx]" end */
+ int i_idx_channel = text.lastIndexOf(" [Program ");
+ if (i_idx_channel > 0)
+ text = text.left( i_idx_channel );
+
p.drawText( 0, - m_offset + ( i + 0.5 ) * TRACKS_HEIGHT - 4,
- width(), 20, Qt::AlignLeft, channels[i] );
+ width(), 20, Qt::AlignLeft, text );
- int i_width = fontMetrics().width( channels[i] );
+ int i_width = fontMetrics().width( text );
if( width() < i_width )
setMinimumWidth( i_width );
}
More information about the vlc-commits
mailing list