-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index fc925b8..87b5488 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -1931,137 +1931,137 @@ void LiquidStyle::drawIndicatorMask(QPainter *p, int x, int y, int /*w*/, int /* | |||
1931 | void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, | 1931 | void LiquidStyle::drawSlider(QPainter *p, int x, int y, int w, int h, |
1932 | const QColorGroup &/*g*/, Orientation orient, | 1932 | const QColorGroup &/*g*/, Orientation orient, |
1933 | bool, bool) | 1933 | bool, bool) |
1934 | { | 1934 | { |
1935 | QWidget *parent = (QWidget *)p->device(); | 1935 | QWidget *parent = (QWidget *)p->device(); |
1936 | p->setBrushOrigin(parent->pos()); | 1936 | p->setBrushOrigin(parent->pos()); |
1937 | parent->erase(x, y, w, h); | 1937 | parent->erase(x, y, w, h); |
1938 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : | 1938 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider) : |
1939 | *getPixmap(VSlider)); | 1939 | *getPixmap(VSlider)); |
1940 | } | 1940 | } |
1941 | 1941 | ||
1942 | void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, | 1942 | void LiquidStyle::drawSliderMask(QPainter *p, int x, int y, int /*w*/, int /*h*/, |
1943 | Orientation orient, bool, bool) | 1943 | Orientation orient, bool, bool) |
1944 | { | 1944 | { |
1945 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : | 1945 | p->drawPixmap(x, y, orient == Qt::Horizontal ? *getPixmap(HSlider)->mask() : |
1946 | *getPixmap(VSlider)->mask()); | 1946 | *getPixmap(VSlider)->mask()); |
1947 | } | 1947 | } |
1948 | 1948 | ||
1949 | int LiquidStyle::sliderLength() const | 1949 | int LiquidStyle::sliderLength() const |
1950 | { | 1950 | { |
1951 | return(10); | 1951 | return(10); |
1952 | } | 1952 | } |
1953 | 1953 | ||
1954 | #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) | 1954 | #define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2) |
1955 | 1955 | ||
1956 | void LiquidStyle::drawArrow(QPainter *p, Qt::ArrowType type, bool on, int x, | 1956 | void LiquidStyle::drawArrow(QPainter *p, Qt::ArrowType type, bool on, int x, |
1957 | int y, int w, int h, const QColorGroup &g, | 1957 | int y, int w, int h, const QColorGroup &g, |
1958 | bool enabled, const QBrush *) | 1958 | bool enabled, const QBrush *) |
1959 | { | 1959 | { |
1960 | static const QCOORD u_arrow[]={3,1, 4,1, 2,2, 5,2, 1,3, 6,3, 0,4, 7,4, 0,5, 7,5}; | 1960 | static const QCOORD u_arrow[]={3,1, 4,1, 2,2, 5,2, 1,3, 6,3, 0,4, 7,4, 0,5, 7,5}; |
1961 | static const QCOORD d_arrow[]={0,2, 7,2, 0,3, 7,3, 1,4, 6,4, 2,5, 5,5, 3,6, 4,6}; | 1961 | static const QCOORD d_arrow[]={0,2, 7,2, 0,3, 7,3, 1,4, 6,4, 2,5, 5,5, 3,6, 4,6}; |
1962 | static const QCOORD l_arrow[]={1,3, 1,4, 2,2, 2,5, 3,1, 3,6, 4,0, 4,7, 5,0, 5,7}; | 1962 | static const QCOORD l_arrow[]={1,3, 1,4, 2,2, 2,5, 3,1, 3,6, 4,0, 4,7, 5,0, 5,7}; |
1963 | static const QCOORD r_arrow[]={2,0, 2,7, 3,0, 3,7, 4,1, 4,6, 5,2, 5,5, 6,3, 6,4}; | 1963 | static const QCOORD r_arrow[]={2,0, 2,7, 3,0, 3,7, 4,1, 4,6, 5,2, 5,5, 6,3, 6,4}; |
1964 | 1964 | ||
1965 | p->setPen(enabled ? on ? g.light() : g.buttonText() : g.mid()); | 1965 | p->setPen(enabled ? on ? g.light() : g.buttonText() : g.mid()); |
1966 | if(w > 8){ | 1966 | if(w > 8){ |
1967 | x = x + (w-8)/2; | 1967 | x = x + (w-8)/2; |
1968 | y = y + (h-8)/2; | 1968 | y = y + (h-8)/2; |
1969 | } | 1969 | } |
1970 | 1970 | ||
1971 | QPointArray a; | 1971 | QPointArray a; |
1972 | switch(type){ | 1972 | switch(type){ |
1973 | case Qt::UpArrow: | 1973 | case Qt::UpArrow: |
1974 | a.setPoints(QCOORDARRLEN(u_arrow), u_arrow); | 1974 | a.setPoints(QCOORDARRLEN(u_arrow), u_arrow); |
1975 | break; | 1975 | break; |
1976 | case Qt::DownArrow: | 1976 | case Qt::DownArrow: |
1977 | a.setPoints(QCOORDARRLEN(d_arrow), d_arrow); | 1977 | a.setPoints(QCOORDARRLEN(d_arrow), d_arrow); |
1978 | break; | 1978 | break; |
1979 | case Qt::LeftArrow: | 1979 | case Qt::LeftArrow: |
1980 | a.setPoints(QCOORDARRLEN(l_arrow), l_arrow); | 1980 | a.setPoints(QCOORDARRLEN(l_arrow), l_arrow); |
1981 | break; | 1981 | break; |
1982 | default: | 1982 | default: |
1983 | a.setPoints(QCOORDARRLEN(r_arrow), r_arrow); | 1983 | a.setPoints(QCOORDARRLEN(r_arrow), r_arrow); |
1984 | break; | 1984 | break; |
1985 | } | 1985 | } |
1986 | 1986 | ||
1987 | a.translate(x, y); | 1987 | a.translate(x, y); |
1988 | p->drawLineSegments(a); | 1988 | p->drawLineSegments(a); |
1989 | } | 1989 | } |
1990 | 1990 | ||
1991 | 1991 | ||
1992 | void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, | 1992 | void LiquidStyle::drawMenuBarItem(QPainter *p, int x, int y, int w, int h, |
1993 | QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) | 1993 | QMenuItem *mi, QColorGroup &g, bool /*enabled*/, bool active ) |
1994 | { | 1994 | { |
1995 | x -= 2; // Bug in Qt/E | 1995 | if(active){ |
1996 | y -= 2; | 1996 | x -= 2; // Bug in Qt/E |
1997 | w += 2; | 1997 | y -= 2; |
1998 | h += 2; | 1998 | w += 2; |
1999 | h += 2; | ||
2000 | } | ||
1999 | 2001 | ||
2000 | p-> fillRect ( x, y, w, h, g.brush(QColorGroup::Background)); | 2002 | p-> fillRect ( x, y, w, h, g.brush(QColorGroup::Background)); |
2001 | 2003 | ||
2002 | w -= 2; | ||
2003 | |||
2004 | if(menuHandler->useShadowText()){ | 2004 | if(menuHandler->useShadowText()){ |
2005 | QColor shadow; | 2005 | QColor shadow; |
2006 | if(p->device() && p->device()->devType() == QInternal::Widget && | 2006 | if(p->device() && p->device()->devType() == QInternal::Widget && |
2007 | ((QWidget *)p->device())->inherits("QMenuBar")){ | 2007 | ((QWidget *)p->device())->inherits("QMenuBar")){ |
2008 | shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : | 2008 | shadow = ((QMenuBar*)p->device())->isTopLevel() ? g.button().dark(130) : |
2009 | g.background().dark(130); | 2009 | g.background().dark(130); |
2010 | } | 2010 | } |
2011 | else | 2011 | else |
2012 | shadow = g.background().dark(130); | 2012 | shadow = g.background().dark(130); |
2013 | 2013 | ||
2014 | if(active){ | 2014 | if(active){ |
2015 | drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); | 2015 | drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); |
2016 | QApplication::style().drawItem(p, x+1, y+1, w, h, | 2016 | QApplication::style().drawItem(p, x+1, y+1, w, h, |
2017 | AlignCenter|ShowPrefix|DontClip|SingleLine, | 2017 | AlignCenter|ShowPrefix|DontClip|SingleLine, |
2018 | g, mi->isEnabled(), NULL, mi->text(), | 2018 | g, mi->isEnabled(), NULL, mi->text(), |
2019 | -1, &shadow); | 2019 | -1, &shadow); |
2020 | QApplication::style().drawItem(p, x, y, w, h, | 2020 | QApplication::style().drawItem(p, x, y, w, h, |
2021 | AlignCenter|ShowPrefix|DontClip|SingleLine, | 2021 | AlignCenter|ShowPrefix|DontClip|SingleLine, |
2022 | g, mi->isEnabled(), NULL, mi->text(), | 2022 | g, mi->isEnabled(), NULL, mi->text(), |
2023 | -1, &g.text()); | 2023 | -1, &g.text()); |
2024 | } | 2024 | } |
2025 | else{ | 2025 | else{ |
2026 | QApplication::style().drawItem(p, x+1, y+1, w, h, | 2026 | QApplication::style().drawItem(p, x+1, y+1, w, h, |
2027 | AlignCenter|ShowPrefix|DontClip|SingleLine, | 2027 | AlignCenter|ShowPrefix|DontClip|SingleLine, |
2028 | g, mi->isEnabled(), NULL, mi->text(), | 2028 | g, mi->isEnabled(), NULL, mi->text(), |
2029 | -1, &shadow); | 2029 | -1, &shadow); |
2030 | QApplication::style().drawItem(p, x, y, w, h, | 2030 | QApplication::style().drawItem(p, x, y, w, h, |
2031 | AlignCenter|ShowPrefix|DontClip|SingleLine, | 2031 | AlignCenter|ShowPrefix|DontClip|SingleLine, |
2032 | g, mi->isEnabled(), NULL, mi->text(), | 2032 | g, mi->isEnabled(), NULL, mi->text(), |
2033 | -1, &g.text()); | 2033 | -1, &g.text()); |
2034 | } | 2034 | } |
2035 | } | 2035 | } |
2036 | else{ | 2036 | else{ |
2037 | if(active) | 2037 | if(active) |
2038 | drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); | 2038 | drawClearBevel(p, x+1, y+1, w-1, h-1, g.button(), g.background()); |
2039 | QApplication::style().drawItem(p, x, y, w, h, | 2039 | QApplication::style().drawItem(p, x, y, w, h, |
2040 | AlignCenter|ShowPrefix|DontClip|SingleLine, | 2040 | AlignCenter|ShowPrefix|DontClip|SingleLine, |
2041 | g, mi->isEnabled(), NULL, mi->text(), | 2041 | g, mi->isEnabled(), NULL, mi->text(), |
2042 | -1, &g.text()); | 2042 | -1, &g.text()); |
2043 | } | 2043 | } |
2044 | } | 2044 | } |
2045 | 2045 | ||
2046 | void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, | 2046 | void LiquidStyle::drawPopupPanel(QPainter *p, int x, int y, int w, int h, |
2047 | const QColorGroup &g, int /*lineWidth*/, | 2047 | const QColorGroup &g, int /*lineWidth*/, |
2048 | const QBrush * /*fill*/) | 2048 | const QBrush * /*fill*/) |
2049 | { | 2049 | { |
2050 | QColor c; | 2050 | QColor c; |
2051 | switch(menuHandler->transType()){ | 2051 | switch(menuHandler->transType()){ |
2052 | case None: | 2052 | case None: |
2053 | case StippledBg: | 2053 | case StippledBg: |
2054 | case TransStippleBg: | 2054 | case TransStippleBg: |
2055 | c = g.background(); | 2055 | c = g.background(); |
2056 | break; | 2056 | break; |
2057 | case StippledBtn: | 2057 | case StippledBtn: |
2058 | case TransStippleBtn: | 2058 | case TransStippleBtn: |
2059 | c = g.button(); | 2059 | c = g.button(); |
2060 | break; | 2060 | break; |
2061 | default: | 2061 | default: |
2062 | c = menuHandler->bgColor(); | 2062 | c = menuHandler->bgColor(); |
2063 | } | 2063 | } |
2064 | p->setPen(c.dark(140)); | 2064 | p->setPen(c.dark(140)); |
2065 | p->drawRect(x, y, w, h); | 2065 | p->drawRect(x, y, w, h); |
2066 | p->setPen(c.light(120)); | 2066 | p->setPen(c.light(120)); |
2067 | p->drawRect(x+1, y+1, w-2, h-2); | 2067 | p->drawRect(x+1, y+1, w-2, h-2); |