-rw-r--r-- | noncore/styles/web/webstyle.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/styles/web/webstyle.cpp b/noncore/styles/web/webstyle.cpp index 10d9791..cd3cf08 100644 --- a/noncore/styles/web/webstyle.cpp +++ b/noncore/styles/web/webstyle.cpp | |||
@@ -13,49 +13,49 @@ | |||
13 | * | 13 | * |
14 | * You should have received a copy of the GNU Library General Public License | 14 | * You should have received a copy of the GNU Library General Public License |
15 | * along with this library; see the file COPYING.LIB. If not, write to | 15 | * along with this library; see the file COPYING.LIB. If not, write to |
16 | * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, | 16 | * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
17 | * Boston, MA 02111-1307, USA. | 17 | * Boston, MA 02111-1307, USA. |
18 | */ | 18 | */ |
19 | 19 | ||
20 | #ifndef INCLUDE_MENUITEM_DEF | 20 | #ifndef INCLUDE_MENUITEM_DEF |
21 | #define INCLUDE_MENUITEM_DEF | 21 | #define INCLUDE_MENUITEM_DEF |
22 | #endif | 22 | #endif |
23 | 23 | ||
24 | #include <qmenudata.h> | 24 | #include <qmenudata.h> |
25 | #include <qpalette.h> | 25 | #include <qpalette.h> |
26 | #include <qbitmap.h> | 26 | #include <qbitmap.h> |
27 | #include <qtabbar.h> | 27 | #include <qtabbar.h> |
28 | #include <qpointarray.h> | 28 | #include <qpointarray.h> |
29 | #include <qscrollbar.h> | 29 | #include <qscrollbar.h> |
30 | #include <qframe.h> | 30 | #include <qframe.h> |
31 | #include <qpushbutton.h> | 31 | #include <qpushbutton.h> |
32 | #include <qdrawutil.h> | 32 | #include <qdrawutil.h> |
33 | #include <qpainter.h> | 33 | #include <qpainter.h> |
34 | 34 | ||
35 | #include "webstyle.h" | 35 | #include "webstyle.h" |
36 | 36 | ||
37 | static const int _indicatorSize = 13; | 37 | static const int _indicatorSize = 9; |
38 | static QButton * _highlightedButton = 0; | 38 | static QButton * _highlightedButton = 0; |
39 | static const int _scrollBarExtent = 12; | 39 | static const int _scrollBarExtent = 12; |
40 | 40 | ||
41 | static QFrame * _currentFrame = 0; | 41 | static QFrame * _currentFrame = 0; |
42 | static int _savedFrameLineWidth; | 42 | static int _savedFrameLineWidth; |
43 | static int _savedFrameMidLineWidth; | 43 | static int _savedFrameMidLineWidth; |
44 | static ulong _savedFrameStyle; | 44 | static ulong _savedFrameStyle; |
45 | 45 | ||
46 | static QColor contrastingForeground(const QColor & fg, const QColor & bg) | 46 | static QColor contrastingForeground(const QColor & fg, const QColor & bg) |
47 | { | 47 | { |
48 | int h, s, vbg, vfg; | 48 | int h, s, vbg, vfg; |
49 | 49 | ||
50 | bg.hsv(&h, &s, &vbg); | 50 | bg.hsv(&h, &s, &vbg); |
51 | fg.hsv(&h, &s, &vfg); | 51 | fg.hsv(&h, &s, &vfg); |
52 | 52 | ||
53 | int diff(vbg - vfg); | 53 | int diff(vbg - vfg); |
54 | 54 | ||
55 | if ((diff > -72) && (diff < 72)) | 55 | if ((diff > -72) && (diff < 72)) |
56 | { | 56 | { |
57 | return (vbg < 128) ? Qt::white : Qt::black; | 57 | return (vbg < 128) ? Qt::white : Qt::black; |
58 | } | 58 | } |
59 | else | 59 | else |
60 | { | 60 | { |
61 | return fg; | 61 | return fg; |
@@ -700,49 +700,49 @@ WebStyle::drawIndicator | |||
700 | } | 700 | } |
701 | else | 701 | else |
702 | { | 702 | { |
703 | g.mid(); | 703 | g.mid(); |
704 | } | 704 | } |
705 | 705 | ||
706 | p->drawRect(x, y, w, h); | 706 | p->drawRect(x, y, w, h); |
707 | 707 | ||
708 | if (state != QButton::Off) | 708 | if (state != QButton::Off) |
709 | { | 709 | { |
710 | p->fillRect(x + 2, y + 2, w - 4, h - 4, enabled ? g.highlight() : g.mid()); | 710 | p->fillRect(x + 2, y + 2, w - 4, h - 4, enabled ? g.highlight() : g.mid()); |
711 | 711 | ||
712 | if (state == QButton::NoChange) | 712 | if (state == QButton::NoChange) |
713 | { | 713 | { |
714 | p->fillRect(x + 4, y + 4, w - 8, h - 8, g.background()); | 714 | p->fillRect(x + 4, y + 4, w - 8, h - 8, g.background()); |
715 | } | 715 | } |
716 | } | 716 | } |
717 | 717 | ||
718 | p->restore(); | 718 | p->restore(); |
719 | } | 719 | } |
720 | 720 | ||
721 | QSize | 721 | QSize |
722 | WebStyle::exclusiveIndicatorSize() const | 722 | WebStyle::exclusiveIndicatorSize() const |
723 | { | 723 | { |
724 | return QSize(_indicatorSize, _indicatorSize); | 724 | return QSize(_indicatorSize+2, _indicatorSize+2); |
725 | } | 725 | } |
726 | 726 | ||
727 | void | 727 | void |
728 | WebStyle::drawExclusiveIndicator | 728 | WebStyle::drawExclusiveIndicator |
729 | ( | 729 | ( |
730 | QPainter * p, | 730 | QPainter * p, |
731 | int x, | 731 | int x, |
732 | int y, | 732 | int y, |
733 | int w, | 733 | int w, |
734 | int h, | 734 | int h, |
735 | const QColorGroup & g, | 735 | const QColorGroup & g, |
736 | bool on, | 736 | bool on, |
737 | bool down, | 737 | bool down, |
738 | bool enabled | 738 | bool enabled |
739 | ) | 739 | ) |
740 | { | 740 | { |
741 | p->save(); | 741 | p->save(); |
742 | 742 | ||
743 | p->fillRect(x, y, w, h, g.background()); | 743 | p->fillRect(x, y, w, h, g.background()); |
744 | 744 | ||
745 | if (enabled) | 745 | if (enabled) |
746 | { | 746 | { |
747 | p->setPen(down ? g.highlight() : contrastingForeground(g.dark(), g.background())); | 747 | p->setPen(down ? g.highlight() : contrastingForeground(g.dark(), g.background())); |
748 | } | 748 | } |