summaryrefslogtreecommitdiff
path: root/libopie2/opieui/oselector.cpp
Side-by-side diff
Diffstat (limited to 'libopie2/opieui/oselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opieui/oselector.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/libopie2/opieui/oselector.cpp b/libopie2/opieui/oselector.cpp
index 23b3ce3..5f6f10f 100644
--- a/libopie2/opieui/oselector.cpp
+++ b/libopie2/opieui/oselector.cpp
@@ -35,8 +35,10 @@
* 2D value selector.
* The contents of the selector are drawn by derived class.
*/
+using namespace Opie::Ui;
+
OXYSelector::OXYSelector( QWidget *parent, const char *name )
: QWidget( parent, name )
{
xPos = 0;
@@ -72,9 +74,9 @@ void OXYSelector::setValues( int _xPos, int _yPos )
if ( xPos > maxX )
xPos = maxX;
else if ( xPos < minX )
xPos = minX;
-
+
if ( yPos > maxY )
yPos = maxY;
else if ( yPos < minY )
yPos = minY;
@@ -257,9 +259,9 @@ void OSelector::paintEvent( QPaintEvent * )
colorGroup(), TRUE, 2, &brush );
}
QPoint pos = calcArrowPos( value() );
- drawArrow( &painter, TRUE, pos );
+ drawArrow( &painter, TRUE, pos );
painter.end();
}
@@ -287,12 +289,12 @@ void OSelector::valueChange()
painter.begin( this );
pos = calcArrowPos( prevValue() );
- drawArrow( &painter, FALSE, pos );
+ drawArrow( &painter, FALSE, pos );
pos = calcArrowPos( value() );
- drawArrow( &painter, TRUE, pos );
+ drawArrow( &painter, TRUE, pos );
painter.end();
}
@@ -360,10 +362,10 @@ void OSelector::drawArrow( QPainter *painter, bool show, const QPoint &pos )
array.setPoint( 2, pos.x()-5, pos.y()+5 );
}
painter->drawPolygon( array );
- }
- else
+ }
+ else
{
if ( orientation() == Vertical )
{
repaint(pos.x(), pos.y()-5, 6, 11, true);
@@ -399,9 +401,9 @@ OGradientSelector::~OGradientSelector()
void OGradientSelector::init()
{
color1.setRgb( 0, 0, 0 );
color2.setRgb( 255, 255, 255 );
-
+
text1 = text2 = "";
}
@@ -471,9 +473,9 @@ void OGradientSelector::drawContents( QPainter *painter )
painter->setPen( pen );
painter->drawText( xPos, yPos, text2 );
yPos = contentsRect().bottom() - painter->fontMetrics().descent() - 2;
- xPos = contentsRect().left() + (contentsRect().width() -
+ xPos = contentsRect().left() + (contentsRect().width() -
painter->fontMetrics().width( text1 )) / 2;
pen.setColor( color1 );
painter->setPen( pen );
painter->drawText( xPos, yPos, text1 );