Changeset View
Changeset View
Standalone View
Standalone View
kdecoration/breezebutton.cpp
Show First 20 Lines • Show All 402 Lines • ▼ Show 20 Line(s) | 402 | if( !d ) { | |||
---|---|---|---|---|---|
403 | 403 | | |||
404 | return QColor(); | 404 | return QColor(); | ||
405 | 405 | | |||
406 | } | 406 | } | ||
407 | 407 | | |||
408 | auto c = d->client().data(); | 408 | auto c = d->client().data(); | ||
409 | if( isPressed() ) { | 409 | if( isPressed() ) { | ||
410 | 410 | | |||
411 | if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ); | 411 | if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ).darker(); | ||
412 | else return KColorUtils::mix( d->titleBarColor(), d->fontColor(), 0.3 ); | 412 | else return KColorUtils::mix( d->titleBarColor(), d->fontColor(), 0.3 ); | ||
413 | 413 | | |||
414 | } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade ) && isChecked() ) { | 414 | } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade ) && isChecked() ) { | ||
415 | 415 | | |||
416 | return d->fontColor(); | 416 | return d->fontColor(); | ||
417 | 417 | | |||
418 | } else if( m_animation->state() == QAbstractAnimation::Running ) { | 418 | } else if( m_animation->state() == QAbstractAnimation::Running ) { | ||
419 | 419 | | |||
420 | if( type() == DecorationButtonType::Close ) | 420 | if( type() == DecorationButtonType::Close ) | ||
421 | { | 421 | { | ||
422 | if( d->internalSettings()->outlineCloseButton() ) | 422 | if( d->internalSettings()->outlineCloseButton() ) | ||
423 | { | 423 | { | ||
424 | 424 | | |||
425 | return KColorUtils::mix( d->fontColor(), c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter(), m_opacity ); | 425 | QColor redColor( c->color( ColorGroup::Warning, ColorRole::Foreground ) ); | ||
426 | return KColorUtils::mix( redColor, redColor.lighter(), m_opacity ); | ||||
426 | 427 | | |||
427 | } else { | 428 | } else { | ||
428 | 429 | | |||
429 | QColor color( c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter() ); | 430 | QColor color( c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter() ); | ||
430 | color.setAlpha( color.alpha()*m_opacity ); | 431 | color.setAlpha( color.alpha()*m_opacity ); | ||
431 | return color; | 432 | return color; | ||
432 | 433 | | |||
433 | } | 434 | } | ||
434 | 435 | | |||
435 | } else { | 436 | } else { | ||
436 | 437 | | |||
437 | QColor color( d->fontColor() ); | 438 | QColor color( d->fontColor() ); | ||
438 | color.setAlpha( color.alpha()*m_opacity ); | 439 | color.setAlpha( color.alpha()*m_opacity ); | ||
439 | return color; | 440 | return color; | ||
440 | 441 | | |||
441 | } | 442 | } | ||
442 | 443 | | |||
443 | } else if( isHovered() ) { | 444 | } else if( isHovered() ) { | ||
444 | 445 | | |||
445 | if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter(); | 446 | if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ).lighter(); | ||
446 | else return d->fontColor(); | 447 | else return d->fontColor(); | ||
447 | 448 | | |||
448 | } else if( type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton() ) { | 449 | } else if( type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton() ) { | ||
449 | 450 | | |||
450 | return d->fontColor(); | 451 | return c->color( ColorGroup::Warning, ColorRole::Foreground ); | ||
451 | 452 | | |||
452 | } else { | 453 | } else { | ||
453 | 454 | | |||
454 | return QColor(); | 455 | return QColor(); | ||
455 | 456 | | |||
456 | } | 457 | } | ||
457 | 458 | | |||
458 | } | 459 | } | ||
Show All 24 Lines |