Changeset View
Changeset View
Standalone View
Standalone View
kdecoration/breezebutton.cpp
Show First 20 Lines • Show All 304 Lines • ▼ Show 20 Line(s) | 303 | painter->drawPolyline( QPolygonF() | |||
---|---|---|---|---|---|
305 | << QPointF( 9, 14 ) | 305 | << QPointF( 9, 14 ) | ||
306 | << QPointF( 14, 9 ) ); | 306 | << QPointF( 14, 9 ) ); | ||
307 | break; | 307 | break; | ||
308 | 308 | | |||
309 | } | 309 | } | ||
310 | 310 | | |||
311 | case DecorationButtonType::KeepAbove: | 311 | case DecorationButtonType::KeepAbove: | ||
312 | { | 312 | { | ||
313 | if (isChecked()) | ||||
314 | { | ||||
315 | | ||||
316 | painter->drawPolyline( QPolygonF() | ||||
317 | << QPointF( 4, 4 ) | ||||
318 | << QPointF( 9, 9 ) | ||||
319 | << QPointF( 14, 4 ) ); | ||||
320 | | ||||
321 | painter->drawPolyline( QPolygonF() | ||||
322 | << QPointF( 4, 8 ) | ||||
323 | << QPointF( 9, 13 ) | ||||
324 | << QPointF( 14, 8 ) ); | ||||
325 | | ||||
326 | } else { | ||||
327 | | ||||
313 | painter->drawPolyline( QPolygonF() | 328 | painter->drawPolyline( QPolygonF() | ||
314 | << QPointF( 4, 9 ) | 329 | << QPointF( 4, 9 ) | ||
315 | << QPointF( 9, 4 ) | 330 | << QPointF( 9, 4 ) | ||
316 | << QPointF( 14, 9 ) ); | 331 | << QPointF( 14, 9 ) ); | ||
317 | 332 | | |||
318 | painter->drawPolyline( QPolygonF() | 333 | painter->drawPolyline( QPolygonF() | ||
319 | << QPointF( 4, 13 ) | 334 | << QPointF( 4, 13 ) | ||
320 | << QPointF( 9, 8 ) | 335 | << QPointF( 9, 8 ) | ||
321 | << QPointF( 14, 13 ) ); | 336 | << QPointF( 14, 13 ) ); | ||
337 | } | ||||
322 | break; | 338 | break; | ||
323 | } | 339 | } | ||
324 | 340 | | |||
325 | 341 | | |||
326 | case DecorationButtonType::ApplicationMenu: | 342 | case DecorationButtonType::ApplicationMenu: | ||
327 | { | 343 | { | ||
328 | painter->drawLine( QPointF( 3.5, 5 ), QPointF( 14.5, 5 ) ); | 344 | painter->drawLine( QPointF( 3.5, 5 ), QPointF( 14.5, 5 ) ); | ||
329 | painter->drawLine( QPointF( 3.5, 9 ), QPointF( 14.5, 9 ) ); | 345 | painter->drawLine( QPointF( 3.5, 9 ), QPointF( 14.5, 9 ) ); | ||
Show All 33 Lines | 373 | { | |||
363 | } else if( isPressed() ) { | 379 | } else if( isPressed() ) { | ||
364 | 380 | | |||
365 | return d->titleBarColor(); | 381 | return d->titleBarColor(); | ||
366 | 382 | | |||
367 | } else if( type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton() ) { | 383 | } else if( type() == DecorationButtonType::Close && d->internalSettings()->outlineCloseButton() ) { | ||
368 | 384 | | |||
369 | return d->titleBarColor(); | 385 | return d->titleBarColor(); | ||
370 | 386 | | |||
371 | } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove ) && isChecked() ) { | 387 | } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade ) && isChecked() ) { | ||
372 | 388 | | |||
373 | return d->titleBarColor(); | 389 | return d->titleBarColor(); | ||
374 | 390 | | |||
375 | } else if( m_animation->state() == QPropertyAnimation::Running ) { | 391 | } else if( m_animation->state() == QPropertyAnimation::Running ) { | ||
376 | 392 | | |||
377 | return KColorUtils::mix( d->fontColor(), d->titleBarColor(), m_opacity ); | 393 | return KColorUtils::mix( d->fontColor(), d->titleBarColor(), m_opacity ); | ||
378 | 394 | | |||
379 | } else if( isHovered() ) { | 395 | } else if( isHovered() ) { | ||
Show All 19 Lines | 409 | { | |||
399 | } | 415 | } | ||
400 | 416 | | |||
401 | auto c = d->client().data(); | 417 | auto c = d->client().data(); | ||
402 | if( isPressed() ) { | 418 | if( isPressed() ) { | ||
403 | 419 | | |||
404 | if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ); | 420 | if( type() == DecorationButtonType::Close ) return c->color( ColorGroup::Warning, ColorRole::Foreground ); | ||
405 | else return KColorUtils::mix( d->titleBarColor(), d->fontColor(), 0.3 ); | 421 | else return KColorUtils::mix( d->titleBarColor(), d->fontColor(), 0.3 ); | ||
406 | 422 | | |||
407 | } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove ) && isChecked() ) { | 423 | } else if( ( type() == DecorationButtonType::KeepBelow || type() == DecorationButtonType::KeepAbove || type() == DecorationButtonType::Shade ) && isChecked() ) { | ||
408 | 424 | | |||
409 | return d->fontColor(); | 425 | return d->fontColor(); | ||
410 | 426 | | |||
411 | } else if( m_animation->state() == QPropertyAnimation::Running ) { | 427 | } else if( m_animation->state() == QPropertyAnimation::Running ) { | ||
412 | 428 | | |||
413 | if( type() == DecorationButtonType::Close ) | 429 | if( type() == DecorationButtonType::Close ) | ||
414 | { | 430 | { | ||
415 | if( d->internalSettings()->outlineCloseButton() ) | 431 | if( d->internalSettings()->outlineCloseButton() ) | ||
▲ Show 20 Lines • Show All 60 Lines • Show Last 20 Lines |