Changeset View
Changeset View
Standalone View
Standalone View
src/projects/k3baudioeditorwidget.cpp
Show First 20 Lines • Show All 264 Lines • ▼ Show 20 Line(s) | 264 | int K3b::AudioEditorWidget::addRange( const K3b::Msf& start, const K3b::Msf& end, | |||
---|---|---|---|---|---|
265 | bool startFixed, bool endFixed, | 265 | bool startFixed, bool endFixed, | ||
266 | const QString& toolTip, | 266 | const QString& toolTip, | ||
267 | const QBrush& brush ) | 267 | const QBrush& brush ) | ||
268 | { | 268 | { | ||
269 | if( start > end || end > d->length-1 ) | 269 | if( start > end || end > d->length-1 ) | ||
270 | return -1; | 270 | return -1; | ||
271 | 271 | | |||
272 | Range r( d->idCnt++, start, end, startFixed, endFixed, toolTip, | 272 | Range r( d->idCnt++, start, end, startFixed, endFixed, toolTip, | ||
273 | brush.style() != Qt::NoBrush ? brush : palette().background() ); | 273 | brush.style() != Qt::NoBrush ? brush : palette().window() ); | ||
274 | d->ranges.append( r ); | 274 | d->ranges.append( r ); | ||
275 | 275 | | |||
276 | // only update the changed range | 276 | // only update the changed range | ||
277 | QRect rect = contentsRect(); | 277 | QRect rect = contentsRect(); | ||
278 | rect.setLeft( msfToPos( start ) ); | 278 | rect.setLeft( msfToPos( start ) ); | ||
279 | rect.setRight( msfToPos( end ) ); | 279 | rect.setRight( msfToPos( end ) ); | ||
280 | update( rect ); | 280 | update( rect ); | ||
281 | 281 | | |||
▲ Show 20 Lines • Show All 115 Lines • ▼ Show 20 Line(s) | 396 | while( d->markers.count() > qMax( 1, d->maxMarkers ) ) { | |||
397 | removeMarker( d->markers.last().id ); | 397 | removeMarker( d->markers.last().id ); | ||
398 | } | 398 | } | ||
399 | } | 399 | } | ||
400 | 400 | | |||
401 | 401 | | |||
402 | int K3b::AudioEditorWidget::addMarker( const K3b::Msf& pos, bool fixed, const QString& toolTip, const QColor& color ) | 402 | int K3b::AudioEditorWidget::addMarker( const K3b::Msf& pos, bool fixed, const QString& toolTip, const QColor& color ) | ||
403 | { | 403 | { | ||
404 | if( pos < d->length ) { | 404 | if( pos < d->length ) { | ||
405 | Marker m( d->idCnt++, pos, fixed, color.isValid() ? color : palette().foreground().color(), toolTip ); | 405 | Marker m( d->idCnt++, pos, fixed, color.isValid() ? color : palette().windowText().color(), toolTip ); | ||
406 | d->markers.append( m ); | 406 | d->markers.append( m ); | ||
407 | return m.id; | 407 | return m.id; | ||
408 | } | 408 | } | ||
409 | else | 409 | else | ||
410 | return -1; | 410 | return -1; | ||
411 | } | 411 | } | ||
412 | 412 | | |||
413 | 413 | | |||
▲ Show 20 Lines • Show All 467 Lines • Show Last 20 Lines |