-rw-r--r-- | noncore/styles/phase/phasestyle.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/noncore/styles/phase/phasestyle.cpp b/noncore/styles/phase/phasestyle.cpp index fb6411c..139505f 100644 --- a/noncore/styles/phase/phasestyle.cpp +++ b/noncore/styles/phase/phasestyle.cpp | |||
@@ -691,101 +691,100 @@ void PhaseStyle::drawPopupMenuItem ( QPainter * p, bool checkable, | |||
691 | ITEMHMARGIN - ITEMFRAME; | 691 | ITEMHMARGIN - ITEMFRAME; |
692 | p->drawText(tabx, y+ITEMVMARGIN, tabwidth, | 692 | p->drawText(tabx, y+ITEMVMARGIN, tabwidth, |
693 | h-2*ITEMVMARGIN, tflags, | 693 | h-2*ITEMVMARGIN, tflags, |
694 | text.mid(t+1) ); | 694 | text.mid(t+1) ); |
695 | text = text.left(t ); | 695 | text = text.left(t ); |
696 | } | 696 | } |
697 | 697 | ||
698 | // draw left label | 698 | // draw left label |
699 | p->drawText(xp, y+ITEMVMARGIN, | 699 | p->drawText(xp, y+ITEMVMARGIN, |
700 | tw, h-2*ITEMVMARGIN, | 700 | tw, h-2*ITEMVMARGIN, |
701 | tflags, text, t); | 701 | tflags, text, t); |
702 | }else if ( mi->pixmap() ) { // pixmap as label | 702 | }else if ( mi->pixmap() ) { // pixmap as label |
703 | QPixmap pixmap = *mi->pixmap(); | 703 | QPixmap pixmap = *mi->pixmap(); |
704 | if ( pixmap.depth() == 1 ) | 704 | if ( pixmap.depth() == 1 ) |
705 | p->setBackgroundMode( OpaqueMode ); | 705 | p->setBackgroundMode( OpaqueMode ); |
706 | 706 | ||
707 | int dx = ((w-pixmap.width() ) /2 ) + | 707 | int dx = ((w-pixmap.width() ) /2 ) + |
708 | ((w - pixmap.width()) %2 ); | 708 | ((w - pixmap.width()) %2 ); |
709 | p->drawPixmap(x+dx, y+ITEMFRAME, pixmap ); | 709 | p->drawPixmap(x+dx, y+ITEMFRAME, pixmap ); |
710 | 710 | ||
711 | if ( pixmap.depth() == 1 ) | 711 | if ( pixmap.depth() == 1 ) |
712 | p->setBackgroundMode( TransparentMode ); | 712 | p->setBackgroundMode( TransparentMode ); |
713 | } | 713 | } |
714 | } | 714 | } |
715 | 715 | ||
716 | if ( mi->popup() ) { // draw submenu arrow | 716 | if ( mi->popup() ) { // draw submenu arrow |
717 | int dim = (h-2*ITEMFRAME) / 2; | 717 | int dim = (h-2*ITEMFRAME) / 2; |
718 | drawArrow( p, RightArrow, false, | 718 | drawArrow( p, RightArrow, false, |
719 | x+w-ARROWMARGIN-ITEMFRAME-dim, | 719 | x+w-ARROWMARGIN-ITEMFRAME-dim, |
720 | y+h/2-dim/2, dim, dim, g, enabled ); | 720 | y+h/2-dim/2, dim, dim, g, enabled ); |
721 | } | 721 | } |
722 | } | 722 | } |
723 | 723 | ||
724 | 724 | ||
725 | QRect PhaseStyle::comboButtonRect ( int x, int y, int w, int h ) { | 725 | QRect PhaseStyle::comboButtonRect ( int x, int y, int w, int h ) { |
726 | return QRect(x+2, y+2, w-4-17, h-5 ); | 726 | return QRect(x+2, y+2, w-4-17, h-5 ); |
727 | } | 727 | } |
728 | 728 | ||
729 | void PhaseStyle::drawComboButton( QPainter * p, int x, int y, | 729 | void PhaseStyle::drawComboButton( QPainter * p, int x, int y, |
730 | int w, int h, | 730 | int w, int h, |
731 | const QColorGroup & g, | 731 | const QColorGroup & g, |
732 | bool sunken, | 732 | bool sunken, |
733 | bool editable, | 733 | bool editable, |
734 | bool, | 734 | bool, |
735 | const QBrush *) { | 735 | const QBrush *) { |
736 | drawButton(p, x, y, w, h, g, | 736 | drawButton(p, x, y, w, h, g, |
737 | sunken, &g.brush(QColorGroup::Button )); | 737 | sunken, &g.brush(QColorGroup::Button )); |
738 | 738 | ||
739 | for ( int n = 0; n < 2; ++n ) | ||
740 | kColorBitmaps(p, g, w-16+(6*n), y+(h/2)-2, | ||
741 | 0, &doodad_mid, &doodad_light, 0, 0, 0 ); | ||
739 | 742 | ||
740 | bool odd = (h % 2); | ||
741 | drawPanel(p, w-15 , y+(h/2)-3, 10, (odd ? 7 : 6 ), | ||
742 | g, true , 1, sunken ? &g.brush(QColorGroup::Midlight) | ||
743 | : &g.brush(QColorGroup::Mid) ); | ||
744 | 743 | ||
745 | if (editable ) { | 744 | if (editable ) { |
746 | const int x2 = x+w-1; const int y2 = y+h-1; | 745 | const int x2 = x+w-1; const int y2 = y+h-1; |
747 | p->setPen(g.dark()); | 746 | p->setPen(g.dark()); |
748 | p->drawLine(x2+1, y, x2+1, y2); | 747 | p->drawLine(x2+1, y, x2+1, y2); |
749 | p->setPen(g.midlight()); | 748 | p->setPen(g.midlight()); |
750 | p->drawLine(x2+2, y, x2+2, y2-1); | 749 | p->drawLine(x2+2, y, x2+2, y2-1); |
751 | p->setPen(g.button()); | 750 | p->setPen(g.button()); |
752 | p->drawPoint(x2+2, y2); | 751 | p->drawPoint(x2+2, y2); |
753 | } | 752 | } |
754 | 753 | ||
755 | p->setPen(g.buttonText() ); | 754 | p->setPen(g.buttonText() ); |
756 | } | 755 | } |
757 | 756 | ||
758 | 757 | ||
759 | void PhaseStyle::drawTab(QPainter* painter, const QTabBar* bar, QTab* tab, | 758 | void PhaseStyle::drawTab(QPainter* painter, const QTabBar* bar, QTab* tab, |
760 | bool selected ) { | 759 | bool selected ) { |
761 | bool edge = false; | 760 | bool edge = false; |
762 | int x, y, w, h; | 761 | int x, y, w, h; |
763 | QRect r = tab->rect(); | 762 | QRect r = tab->rect(); |
764 | r.rect(&x,&y,&w,&h); | 763 | r.rect(&x,&y,&w,&h); |
765 | const int x2 = x+w-1; | 764 | const int x2 = x+w-1; |
766 | const int y2 = y+h-1; | 765 | const int y2 = y+h-1; |
767 | const QColorGroup &group = bar->colorGroup(); | 766 | const QColorGroup &group = bar->colorGroup(); |
768 | 767 | ||
769 | 768 | ||
770 | painter->save(); | 769 | painter->save(); |
771 | 770 | ||
772 | // what position is the tab? | 771 | // what position is the tab? |
773 | if ((bar->count() == 1 )) | 772 | if ((bar->count() == 1 )) |
774 | edge = true; | 773 | edge = true; |
775 | else | 774 | else |
776 | edge = false; | 775 | edge = false; |
777 | 776 | ||
778 | switch (QTabBar::Shape(bar->shape())) { | 777 | switch (QTabBar::Shape(bar->shape())) { |
779 | case QTabBar::RoundedAbove: | 778 | case QTabBar::RoundedAbove: |
780 | case QTabBar::TriangularAbove: { | 779 | case QTabBar::TriangularAbove: { |
781 | if (!selected) { // shorten | 780 | if (!selected) { // shorten |
782 | y += 2; h -= 2; | 781 | y += 2; h -= 2; |
783 | } | 782 | } |
784 | if (selected) { | 783 | if (selected) { |
785 | painter->setPen(Qt::NoPen); | 784 | painter->setPen(Qt::NoPen); |
786 | painter->fillRect(x+1, y+1, w-1, h-1, | 785 | painter->fillRect(x+1, y+1, w-1, h-1, |
787 | group.brush(QColorGroup::Background)); | 786 | group.brush(QColorGroup::Background)); |
788 | } else | 787 | } else |
789 | drawPhaseGradient(painter, QRect(x+1, y+1, w-1, h-2), | 788 | drawPhaseGradient(painter, QRect(x+1, y+1, w-1, h-2), |
790 | group.background().dark(contrast) ); | 789 | group.background().dark(contrast) ); |
791 | 790 | ||