Commit d3a13c63 authored by Francois Cartegnie's avatar Francois Cartegnie

Qt: TimeLabel: use padding, not margin and spaces

parent ea4e38b5
...@@ -585,7 +585,7 @@ TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType ) ...@@ -585,7 +585,7 @@ TimeLabel::TimeLabel( intf_thread_t *_p_intf, TimeLabel::Display _displayType )
this, updateBuffering( float ) ); this, updateBuffering( float ) );
CONNECT( bufTimer, timeout(), this, updateBuffering() ); CONNECT( bufTimer, timeout(), this, updateBuffering() );
this->setContentsMargins( 4, 0, 4, 0 ); setStyleSheet( "padding-left: 4px; padding-right: 4px;" );
} }
void TimeLabel::setDisplayPosition( float pos, int64_t t, int length ) void TimeLabel::setDisplayPosition( float pos, int64_t t, int length )
...@@ -596,9 +596,9 @@ void TimeLabel::setDisplayPosition( float pos, int64_t t, int length ) ...@@ -596,9 +596,9 @@ void TimeLabel::setDisplayPosition( float pos, int64_t t, int length )
if( pos == -1.f ) if( pos == -1.f )
{ {
if( displayType == TimeLabel::Both ) if( displayType == TimeLabel::Both )
setText( " --:--/--:-- " ); setText( "--:--/--:--" );
else else
setText( " --:-- " ); setText( "--:--" );
return; return;
} }
...@@ -610,17 +610,17 @@ void TimeLabel::setDisplayPosition( float pos, int64_t t, int length ) ...@@ -610,17 +610,17 @@ void TimeLabel::setDisplayPosition( float pos, int64_t t, int length )
switch( displayType ) switch( displayType )
{ {
case TimeLabel::Elapsed: case TimeLabel::Elapsed:
setText( QString(" ") + QString( psz_time ) + QString(" ") ); setText( QString( psz_time ) );
break; break;
case TimeLabel::Remaining: case TimeLabel::Remaining:
if( b_remainingTime ) if( b_remainingTime )
setText( QString(" -") + QString( psz_time ) + QString(" ") ); setText( QString("-") + QString( psz_time ) );
else else
setText( QString(" ") + QString( psz_length ) + QString(" ") ); setText( QString( psz_length ) );
break; break;
case TimeLabel::Both: case TimeLabel::Both:
default: default:
QString timestr = QString( " %1%2/%3 " ) QString timestr = QString( "%1%2/%3" )
.arg( QString( (b_remainingTime && length) ? "-" : "" ) ) .arg( QString( (b_remainingTime && length) ? "-" : "" ) )
.arg( QString( psz_time ) ) .arg( QString( psz_time ) )
.arg( QString( ( !length && time ) ? "--:--" : psz_length ) ); .arg( QString( ( !length && time ) ? "--:--" : psz_length ) );
...@@ -643,7 +643,7 @@ void TimeLabel::setDisplayPosition( float pos ) ...@@ -643,7 +643,7 @@ void TimeLabel::setDisplayPosition( float pos )
secstotimestr( psz_time, secstotimestr( psz_time,
( b_remainingTime && cachedLength ? ( b_remainingTime && cachedLength ?
cachedLength - time : time ) ); cachedLength - time : time ) );
QString timestr = QString( " %1%2/%3 " ) QString timestr = QString( "%1%2/%3" )
.arg( QString( (b_remainingTime && cachedLength) ? "-" : "" ) ) .arg( QString( (b_remainingTime && cachedLength) ? "-" : "" ) )
.arg( QString( psz_time ) ) .arg( QString( psz_time ) )
.arg( QString( ( !cachedLength && time ) ? "--:--" : psz_length ) ); .arg( QString( ( !cachedLength && time ) ? "--:--" : psz_length ) );
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment