-rw-r--r-- | noncore/styles/liquid/liquid.cpp | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/noncore/styles/liquid/liquid.cpp b/noncore/styles/liquid/liquid.cpp index acf0a42..67e53e9 100644 --- a/noncore/styles/liquid/liquid.cpp +++ b/noncore/styles/liquid/liquid.cpp | |||
@@ -1515,17 +1515,17 @@ void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | |||
1515 | } | 1515 | } |
1516 | else { | 1516 | else { |
1517 | subX = addX = ( extent - buttonDim ) / 2; | 1517 | subX = addX = ( extent - buttonDim ) / 2; |
1518 | subY = 0; | 1518 | subY = 0; |
1519 | addY = len - buttonDim; | 1519 | addY = len - buttonDim; |
1520 | if(sbBuffer.size() != sb->size()) | 1520 | if(sbBuffer.size() != sb->size()) |
1521 | sbBuffer.resize(sb->size()); | 1521 | sbBuffer.resize(sb->size()); |
1522 | } | 1522 | } |
1523 | subB.setRect( subX,subY,buttonDim,buttonDim ); | 1523 | subB.setRect( subX,subY,0,0); // buttonDim,buttonDim ); |
1524 | addB.setRect( addX,addY,buttonDim,buttonDim ); | 1524 | addB.setRect( addX,addY,buttonDim,buttonDim ); |
1525 | if(horiz) | 1525 | if(horiz) |
1526 | subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); | 1526 | subHC.setRect(addX-buttonDim,addY,buttonDim,buttonDim ); |
1527 | else | 1527 | else |
1528 | subHC.setRect(addX,addY-buttonDim,buttonDim,buttonDim ); | 1528 | subHC.setRect(addX,addY-buttonDim,buttonDim,buttonDim ); |
1529 | 1529 | ||
1530 | int sliderEnd = sliderStart + sliderLength; | 1530 | int sliderEnd = sliderStart + sliderLength; |
1531 | int sliderW = extent; | 1531 | int sliderW = extent; |
@@ -1543,17 +1543,17 @@ void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | |||
1543 | sliderR .setRect( 0, sliderStart, sliderW, sliderLength ); | 1543 | sliderR .setRect( 0, sliderStart, sliderW, sliderLength ); |
1544 | } | 1544 | } |
1545 | 1545 | ||
1546 | bool maxed = sb->maxValue() == sb->minValue(); | 1546 | bool maxed = sb->maxValue() == sb->minValue(); |
1547 | 1547 | ||
1548 | QPainter painter; | 1548 | QPainter painter; |
1549 | if(!horiz){ | 1549 | if(!horiz){ |
1550 | painter.begin(&sbBuffer); | 1550 | painter.begin(&sbBuffer); |
1551 | QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*3))+1); | 1551 | QRect bgR(0, subB.bottom()+1, sb->width(), (len-(buttonDim*2))+1); |
1552 | if(sliderR.height() >= 8){ | 1552 | if(sliderR.height() >= 8){ |
1553 | painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, | 1553 | painter.drawPixmap(bgR.x()+1, bgR.y(), *vsbSliderFillPix, 0, 0, |
1554 | 13, 8); | 1554 | 13, 8); |
1555 | painter.drawPixmap(bgR.x()+1, bgR.y(), *getPixmap(VSBSliderTopBg)); | 1555 | painter.drawPixmap(bgR.x()+1, bgR.y(), *getPixmap(VSBSliderTopBg)); |
1556 | painter.drawTiledPixmap(bgR.x()+1, bgR.y()+8, 13, | 1556 | painter.drawTiledPixmap(bgR.x()+1, bgR.y()+8, 13, |
1557 | bgR.height()-16, *getPixmap(VSBSliderMidBg)); | 1557 | bgR.height()-16, *getPixmap(VSBSliderMidBg)); |
1558 | painter.drawPixmap(bgR.x()+1, bgR.bottom()-8, *vsbSliderFillPix, | 1558 | painter.drawPixmap(bgR.x()+1, bgR.bottom()-8, *vsbSliderFillPix, |
1559 | 0, 0, 13, 8); | 1559 | 0, 0, 13, 8); |
@@ -1609,17 +1609,17 @@ void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | |||
1609 | painter.setPen(g.background()); | 1609 | painter.setPen(g.background()); |
1610 | painter.drawLine(bgR.right()-1, bgR.y(), bgR.right()-1, | 1610 | painter.drawLine(bgR.right()-1, bgR.y(), bgR.right()-1, |
1611 | bgR.bottom()); | 1611 | bgR.bottom()); |
1612 | } | 1612 | } |
1613 | painter.end(); | 1613 | painter.end(); |
1614 | } | 1614 | } |
1615 | else{ | 1615 | else{ |
1616 | painter.begin(&sbBuffer); | 1616 | painter.begin(&sbBuffer); |
1617 | QRect bgR(subB.right()+1, 0, (len-(buttonDim*3))+1, sb->height()); | 1617 | QRect bgR(subB.right()+1, 0, (len-(buttonDim*2))+1, sb->height()); |
1618 | if(sliderR.width() >= 8){ | 1618 | if(sliderR.width() >= 8){ |
1619 | painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, | 1619 | painter.drawPixmap(bgR.x(), bgR.y()+1, *vsbSliderFillPix, 0, 0, |
1620 | 8, 13); | 1620 | 8, 13); |
1621 | painter.drawPixmap(bgR.x(), bgR.y()+1, *getPixmap(HSBSliderTopBg)); | 1621 | painter.drawPixmap(bgR.x(), bgR.y()+1, *getPixmap(HSBSliderTopBg)); |
1622 | painter.drawTiledPixmap(bgR.x()+8, bgR.y()+1, bgR.width()-16, | 1622 | painter.drawTiledPixmap(bgR.x()+8, bgR.y()+1, bgR.width()-16, |
1623 | 13, *getPixmap(HSBSliderMidBg)); | 1623 | 13, *getPixmap(HSBSliderMidBg)); |
1624 | painter.drawPixmap(bgR.right()-8, bgR.y()+1, *vsbSliderFillPix, | 1624 | painter.drawPixmap(bgR.right()-8, bgR.y()+1, *vsbSliderFillPix, |
1625 | 0, 0, 8, 13); | 1625 | 0, 0, 8, 13); |
@@ -1680,20 +1680,20 @@ void LiquidStyle::drawScrollBarControls(QPainter *p, const QScrollBar *sb, | |||
1680 | 1680 | ||
1681 | if ( controls & AddLine ) { | 1681 | if ( controls & AddLine ) { |
1682 | drawSBButton(p, addB, g, activeControl == AddLine); | 1682 | drawSBButton(p, addB, g, activeControl == AddLine); |
1683 | drawArrow( p, horiz ? RightArrow : DownArrow, | 1683 | drawArrow( p, horiz ? RightArrow : DownArrow, |
1684 | false, addB.x()+4, addB.y()+4, | 1684 | false, addB.x()+4, addB.y()+4, |
1685 | addB.width()-8, addB.height()-8, g, !maxed); | 1685 | addB.width()-8, addB.height()-8, g, !maxed); |
1686 | } | 1686 | } |
1687 | if ( controls & SubLine ) { | 1687 | if ( controls & SubLine ) { |
1688 | drawSBButton(p, subB, g, activeControl == SubLine); | 1688 | // drawSBButton(p, subB, g, activeControl == SubLine); |
1689 | drawArrow( p, horiz ? LeftArrow : UpArrow, | 1689 | // drawArrow( p, horiz ? LeftArrow : UpArrow, |
1690 | false, subB.x()+4, subB.y()+4, | 1690 | // false, subB.x()+4, subB.y()+4, |
1691 | subB.width()-8, subB.height()-8, g, !maxed); | 1691 | // subB.width()-8, subB.height()-8, g, !maxed); |
1692 | drawSBButton(p, subHC, g, activeControl == SubLine); | 1692 | drawSBButton(p, subHC, g, activeControl == SubLine); |
1693 | drawArrow( p, horiz ? LeftArrow : UpArrow, | 1693 | drawArrow( p, horiz ? LeftArrow : UpArrow, |
1694 | false, subHC.x()+4, subHC.y()+4, | 1694 | false, subHC.x()+4, subHC.y()+4, |
1695 | subHC.width()-8, subHC.height()-8, g, !maxed); | 1695 | subHC.width()-8, subHC.height()-8, g, !maxed); |
1696 | } | 1696 | } |
1697 | 1697 | ||
1698 | if(controls & AddPage){ | 1698 | if(controls & AddPage){ |
1699 | if(addPageR.width()){ | 1699 | if(addPageR.width()){ |
@@ -1784,18 +1784,18 @@ void LiquidStyle::scrollBarMetrics(const QScrollBar *sb, int &sliderMin, | |||
1784 | int length = horiz ? sb->width() : sb->height(); | 1784 | int length = horiz ? sb->width() : sb->height(); |
1785 | int extent = horiz ? sb->height() : sb->width(); | 1785 | int extent = horiz ? sb->height() : sb->width(); |
1786 | 1786 | ||
1787 | if ( length > ( extent - b*2 - 1 )*2 + b*2 ) | 1787 | if ( length > ( extent - b*2 - 1 )*2 + b*2 ) |
1788 | buttonDim = extent - b*2; | 1788 | buttonDim = extent - b*2; |
1789 | else | 1789 | else |
1790 | buttonDim = ( length - b*2 )/2 - 1; | 1790 | buttonDim = ( length - b*2 )/2 - 1; |
1791 | 1791 | ||
1792 | sliderMin = b + buttonDim; | 1792 | sliderMin = b + 0; // buttonDim; |
1793 | maxLength = length - b*2 - buttonDim*3; | 1793 | maxLength = length - b*2 - buttonDim*2; // 3; |
1794 | 1794 | ||
1795 | if ( sb->maxValue() == sb->minValue() ) { | 1795 | if ( sb->maxValue() == sb->minValue() ) { |
1796 | sliderLength = maxLength; | 1796 | sliderLength = maxLength; |
1797 | } else { | 1797 | } else { |
1798 | sliderLength = (sb->pageStep()*maxLength)/ | 1798 | sliderLength = (sb->pageStep()*maxLength)/ |
1799 | (sb->maxValue()-sb->minValue()+sb->pageStep()); | 1799 | (sb->maxValue()-sb->minValue()+sb->pageStep()); |
1800 | uint range = sb->maxValue()-sb->minValue(); | 1800 | uint range = sb->maxValue()-sb->minValue(); |
1801 | if ( sliderLength < 9 || range > INT_MAX/2 ) | 1801 | if ( sliderLength < 9 || range > INT_MAX/2 ) |