Changeset View
Changeset View
Standalone View
Standalone View
kstyle/breezehelper.cpp
Show First 20 Lines • Show All 528 Lines • ▼ Show 20 Line(s) | 478 | } | |||
---|---|---|---|---|---|
529 | //______________________________________________________________________________ | 529 | //______________________________________________________________________________ | ||
530 | void Helper::renderSidePanelFrame( QPainter* painter, const QRect& rect, const QColor& outline, Side side ) const | 530 | void Helper::renderSidePanelFrame( QPainter* painter, const QRect& rect, const QColor& outline, Side side ) const | ||
531 | { | 531 | { | ||
532 | 532 | | |||
533 | // check color | 533 | // check color | ||
534 | if( !outline.isValid() ) return; | 534 | if( !outline.isValid() ) return; | ||
535 | 535 | | |||
536 | // adjust rect | 536 | // adjust rect | ||
537 | QRectF frameRect( rect.adjusted( 1, 1, -1, -1 ) ); | 537 | QRectF frameRect( rect ); | ||
538 | frameRect.adjust( 0.5, 0.5, -0.5, -0.5 ); | 538 | frameRect.adjust( 0.5, 0.5, -0.5, -0.5 ); | ||
539 | 539 | | |||
540 | // setup painter | 540 | // setup painter | ||
541 | painter->setRenderHint( QPainter::Antialiasing ); | 541 | painter->setRenderHint( QPainter::Antialiasing ); | ||
542 | painter->setPen( outline ); | 542 | painter->setPen( outline ); | ||
543 | 543 | | |||
544 | // render | 544 | // render | ||
545 | switch( side ) | 545 | switch( side ) | ||
546 | { | 546 | { | ||
547 | default: | 547 | default: | ||
548 | case SideLeft: | 548 | case SideLeft: | ||
549 | frameRect.adjust( 0, 1, 0, -1 ); | | |||
550 | painter->drawLine( frameRect.topRight(), frameRect.bottomRight() ); | 549 | painter->drawLine( frameRect.topRight(), frameRect.bottomRight() ); | ||
551 | break; | 550 | break; | ||
552 | 551 | | |||
553 | case SideTop: | 552 | case SideTop: | ||
554 | frameRect.adjust( 1, 0, -1, 0 ); | | |||
555 | painter->drawLine( frameRect.topLeft(), frameRect.topRight() ); | 553 | painter->drawLine( frameRect.topLeft(), frameRect.topRight() ); | ||
556 | break; | 554 | break; | ||
557 | 555 | | |||
558 | case SideRight: | 556 | case SideRight: | ||
559 | frameRect.adjust( 0, 1, 0, -1 ); | | |||
560 | painter->drawLine( frameRect.topLeft(), frameRect.bottomLeft() ); | 557 | painter->drawLine( frameRect.topLeft(), frameRect.bottomLeft() ); | ||
561 | break; | 558 | break; | ||
562 | 559 | | |||
563 | case SideBottom: | 560 | case SideBottom: | ||
564 | frameRect.adjust( 1, 0, -1, 0 ); | | |||
565 | painter->drawLine( frameRect.bottomLeft(), frameRect.bottomRight() ); | 561 | painter->drawLine( frameRect.bottomLeft(), frameRect.bottomRight() ); | ||
566 | break; | 562 | break; | ||
567 | 563 | | |||
568 | case AllSides: | 564 | case AllSides: | ||
569 | { | 565 | { | ||
570 | const qreal radius( frameRadius( -1.0 ) ); | 566 | const qreal radius( frameRadius( -1.0 ) ); | ||
571 | painter->drawRoundedRect( frameRect, radius, radius ); | 567 | painter->drawRoundedRect( frameRect, radius, radius ); | ||
572 | break; | 568 | break; | ||
▲ Show 20 Lines • Show All 1030 Lines • Show Last 20 Lines |