summaryrefslogtreecommitdiff
authorllornkcor <llornkcor>2002-11-03 21:39:35 (UTC)
committer llornkcor <llornkcor>2002-11-03 21:39:35 (UTC)
commit5ba841a12e67b326833751ea502cf054e423114d (patch) (unidiff)
tree7fadf7e584b9298663328e2aa96ec207e3be4bda
parentfe933da66a39ae964f44d0f057fabece5bdf077b (diff)
downloadopie-5ba841a12e67b326833751ea502cf054e423114d.zip
opie-5ba841a12e67b326833751ea502cf054e423114d.tar.gz
opie-5ba841a12e67b326833751ea502cf054e423114d.tar.bz2
added public methods for background, foreground colors and framestyle
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/oticker.cpp32
-rw-r--r--libopie/oticker.h5
2 files changed, 29 insertions, 8 deletions
diff --git a/libopie/oticker.cpp b/libopie/oticker.cpp
index 774a49d..3fcef5d 100644
--- a/libopie/oticker.cpp
+++ b/libopie/oticker.cpp
@@ -46,4 +46,11 @@
46 46
47OTicker::OTicker( QWidget* parent=0 ) : QFrame( parent ) { 47OTicker::OTicker( QWidget* parent=0 )
48 setFrameStyle( NoFrame/*WinPanel | Sunken */); 48 : QFrame( parent ) {
49
50// setFrameStyle( NoFrame/*WinPanel | Sunken */);
51
52 Config cfg("qpe");
53 cfg.setGroup("Appearance");
54 backgroundcolor = QColor( cfg.readEntry( "Background", "#E5E1D5" ) );
55 foregroundcolor= Qt::black;
49} 56}
@@ -53,6 +60,15 @@ OTicker::~OTicker() {
53 60
61void OTicker::setBackgroundColor(QColor backcolor) {
62 backgroundcolor = backcolor;
63}
64
65void OTicker::setForegroundColor(QColor backcolor) {
66 foregroundcolor = backcolor;
67}
68
69void OTicker::setFrame(int frameStyle) {
70 setFrameStyle( frameStyle/*WinPanel | Sunken */);
71}
72
54void OTicker::setText( const QString& text ) { 73void OTicker::setText( const QString& text ) {
55 Config cfg("qpe");
56 cfg.setGroup("Appearance");
57
58 pos = 0; // reset it everytime the text is changed 74 pos = 0; // reset it everytime the text is changed
@@ -64,5 +80,5 @@ void OTicker::setText( const QString& text ) {
64 80
65 pm.fill( QColor( cfg.readEntry( "Background", "#E5E1D5" ) )); 81 pm.fill(backgroundcolor);
66 QPainter pmp( &pm ); 82 QPainter pmp( &pm );
67 pmp.setPen( Qt::black ); 83 pmp.setPen(foregroundcolor );
68 pmp.drawText( 0, 0, pixelLen, contentsRect().height(), AlignVCenter, scrollText ); 84 pmp.drawText( 0, 0, pixelLen, contentsRect().height(), AlignVCenter, scrollText );
@@ -90,3 +106,3 @@ void OTicker::drawContents( QPainter *p ) {
90 106
91void OTicker::mouseReleaseEvent( QMouseEvent * e) { 107void OTicker::mouseReleaseEvent( QMouseEvent * ) {
92// qDebug("<<<<<<<>>>>>>>>>"); 108// qDebug("<<<<<<<>>>>>>>>>");
diff --git a/libopie/oticker.h b/libopie/oticker.h
index 4f0ed11..92a4be4 100644
--- a/libopie/oticker.h
+++ b/libopie/oticker.h
@@ -11,2 +11,3 @@
11#include <qlineedit.h> 11#include <qlineedit.h>
12#include <qcolor.h>
12 13
@@ -19,2 +20,5 @@ public:
19 void setText( const QString& text ) ; 20 void setText( const QString& text ) ;
21 void setBackgroundColor(QColor color);
22 void setForegroundColor(QColor color);
23 void setFrame(int);
20signals: 24signals:
@@ -26,2 +30,3 @@ protected:
26private: 30private:
31 QColor backgroundcolor, foregroundcolor;
27 QString scrollText; 32 QString scrollText;