Diffstat (limited to 'noncore/styles/fresh/fresh.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/styles/fresh/fresh.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/noncore/styles/fresh/fresh.cpp b/noncore/styles/fresh/fresh.cpp index 831b620..856f68b 100644 --- a/noncore/styles/fresh/fresh.cpp +++ b/noncore/styles/fresh/fresh.cpp | |||
@@ -144,14 +144,14 @@ void FreshStyle::drawBevelButton( QPainter *p, int x, int y, int w, int h, | |||
144 | } | 144 | } |
145 | 145 | ||
146 | QRect FreshStyle::comboButtonRect( int x, int y, int w, int h) | 146 | QRect FreshStyle::comboButtonRect( int x, int y, int w, int h) |
147 | { | 147 | { |
148 | return QRect(x+1, y+1, w-2-14, h-2); | 148 | return QRect(x+1, y+1, w-2-14, h-2); |
149 | } | 149 | } |
150 | 150 | ||
151 | 151 | ||
152 | QRect FreshStyle::comboButtonFocusRect( int x, int y, int w, int h) | 152 | QRect FreshStyle::comboButtonFocusRect( int x, int y, int w, int h) |
153 | { | 153 | { |
154 | return QRect(x+2, y+2, w-4-14, h-4); | 154 | return QRect(x+2, y+2, w-4-14, h-4); |
155 | } | 155 | } |
156 | 156 | ||
157 | void FreshStyle::drawComboButton( QPainter *p, int x, int y, int w, int h, | 157 | void FreshStyle::drawComboButton( QPainter *p, int x, int y, int w, int h, |
@@ -525,13 +525,13 @@ void FreshStyle::drawTab( QPainter *p, const QTabBar *tb, QTab *t, bool selected | |||
525 | p->setPen( tb->colorGroup().button() ); | 525 | p->setPen( tb->colorGroup().button() ); |
526 | p->drawLine( r.left()+2, r.top()+1, r.right()-2, r.top()+1 ); | 526 | p->drawLine( r.left()+2, r.top()+1, r.right()-2, r.top()+1 ); |
527 | p->fillRect( QRect( r.left()+1, r.top()+2, r.width()-2, r.height()-3), | 527 | p->fillRect( QRect( r.left()+1, r.top()+2, r.width()-2, r.height()-3), |
528 | tb->colorGroup().brush( QColorGroup::Button )); | 528 | tb->colorGroup().brush( QColorGroup::Button )); |
529 | 529 | ||
530 | //do shading; will not work for pixmap brushes | 530 | //do shading; will not work for pixmap brushes |
531 | QColor bg = tb->colorGroup().button(); | 531 | QColor bg = tb->colorGroup().button(); |
532 | // int h,s,v; | 532 | // int h,s,v; |
533 | // bg.hsv( &h, &s, &v ); | 533 | // bg.hsv( &h, &s, &v ); |
534 | int n = r.height()/2; | 534 | int n = r.height()/2; |
535 | int dark = 100; | 535 | int dark = 100; |
536 | for ( int i = 1; i < n; i++ ) { | 536 | for ( int i = 1; i < n; i++ ) { |
537 | dark = (dark * (100+(i*15)/n) )/100; | 537 | dark = (dark * (100+(i*15)/n) )/100; |
@@ -635,35 +635,35 @@ int FreshStyle::extraPopupMenuItemWidth( bool checkable, int maxpmw, QMenuItem* | |||
635 | } | 635 | } |
636 | 636 | ||
637 | /*! \reimp | 637 | /*! \reimp |
638 | */ | 638 | */ |
639 | int FreshStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFontMetrics& fm ) | 639 | int FreshStyle::popupMenuItemHeight( bool /*checkable*/, QMenuItem* mi, const QFontMetrics& fm ) |
640 | { | 640 | { |
641 | #ifndef QT_NO_MENUDATA | 641 | #ifndef QT_NO_MENUDATA |
642 | int h = 0; | 642 | int h = 0; |
643 | if ( mi->isSeparator() ) // separator height | 643 | if ( mi->isSeparator() ) // separator height |
644 | h = motifSepHeight; | 644 | h = motifSepHeight; |
645 | else if ( mi->pixmap() ) // pixmap height | 645 | else if ( mi->pixmap() ) // pixmap height |
646 | h = mi->pixmap()->height() + 2*motifItemFrame; | 646 | h = mi->pixmap()->height() + 2*motifItemFrame; |
647 | else // text height | 647 | else // text height |
648 | h = fm.height() + 2*motifItemVMargin + 2*motifItemFrame - 1; | 648 | h = fm.height() + 2*motifItemVMargin + 2*motifItemFrame - 1; |
649 | 649 | ||
650 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { | 650 | if ( !mi->isSeparator() && mi->iconSet() != 0 ) { |
651 | h = QMAX( h, mi->iconSet()->pixmap( QIconSet::Small, QIconSet::Normal ).height() + 2*motifItemFrame ); | 651 | h = QMAX( h, mi->iconSet()->pixmap().height() + 2*motifItemFrame ); |
652 | } | 652 | } |
653 | if ( mi->custom() ) | 653 | if ( mi->custom() ) |
654 | h = QMAX( h, mi->custom()->sizeHint().height() + 2*motifItemVMargin + 2*motifItemFrame ) - 1; | 654 | h = QMAX( h, mi->custom()->sizeHint().height() + 2*motifItemVMargin + 2*motifItemFrame ) - 1; |
655 | return h; | 655 | return h; |
656 | #endif | 656 | #endif |
657 | } | 657 | } |
658 | 658 | ||
659 | void FreshStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi, | 659 | void FreshStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int tab, QMenuItem* mi, |
660 | const QPalette& pal, | 660 | const QPalette& pal, |
661 | bool act, bool enabled, int x, int y, int w, int h) | 661 | bool act, bool enabled, int x, int y, int w, int h) |
662 | { | 662 | { |
663 | #ifndef QT_NO_MENUDATA | 663 | #ifndef QT_NO_MENUDATA |
664 | const QColorGroup & g = pal.active(); | 664 | const QColorGroup & g = pal.active(); |
665 | bool dis = !enabled; | 665 | bool dis = !enabled; |
666 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); | 666 | QColorGroup itemg = dis ? pal.disabled() : pal.active(); |
667 | 667 | ||
668 | if ( checkable ) | 668 | if ( checkable ) |
669 | maxpmw = QMAX( maxpmw, 8 ); // space for the checkmarks | 669 | maxpmw = QMAX( maxpmw, 8 ); // space for the checkmarks |
@@ -699,13 +699,17 @@ void FreshStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int | |||
699 | } | 699 | } |
700 | 700 | ||
701 | if ( mi->iconSet() ) { // draw iconset | 701 | if ( mi->iconSet() ) { // draw iconset |
702 | QIconSet::Mode mode = dis ? QIconSet::Disabled : QIconSet::Normal; | 702 | QIconSet::Mode mode = dis ? QIconSet::Disabled : QIconSet::Normal; |
703 | if (act && !dis ) | 703 | if (act && !dis ) |
704 | mode = QIconSet::Active; | 704 | mode = QIconSet::Active; |
705 | QPixmap pixmap = mi->iconSet()->pixmap( QIconSet::Small, mode ); | 705 | QPixmap pixmap; |
706 | if ( mode == QIconSet::Disabled ) | ||
707 | pixmap = mi->iconSet()->pixmap( QIconSet::Automatic, mode ); | ||
708 | else | ||
709 | pixmap = mi->iconSet()->pixmap(); | ||
706 | int pixw = pixmap.width(); | 710 | int pixw = pixmap.width(); |
707 | int pixh = pixmap.height(); | 711 | int pixh = pixmap.height(); |
708 | if ( act && !dis ) { | 712 | if ( act && !dis ) { |
709 | if ( !mi->isChecked() ) | 713 | if ( !mi->isChecked() ) |
710 | qDrawShadePanel( p, x, y, checkcol, h, g, FALSE, 1, &g.brush( QColorGroup::Button ) ); | 714 | qDrawShadePanel( p, x, y, checkcol, h, g, FALSE, 1, &g.brush( QColorGroup::Button ) ); |
711 | } | 715 | } |