author | llornkcor <llornkcor> | 2002-11-10 23:46:23 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2002-11-10 23:46:23 (UTC) |
commit | 41c15dff26825ba13233d84583080e6bceee470f (patch) (unidiff) | |
tree | ee2d9de09d5903e970d3260edfb0f0aa8bd1f1e6 /libopie/oticker.cpp | |
parent | 9337c912158da3ad2fcda7ee1120c9357faddf8b (diff) | |
download | opie-41c15dff26825ba13233d84583080e6bceee470f.zip opie-41c15dff26825ba13233d84583080e6bceee470f.tar.gz opie-41c15dff26825ba13233d84583080e6bceee470f.tar.bz2 |
added scroll speed and scroll amount and changed to QLabel for richtext, but it doesnt work.. yet.. for whatever reason
-rw-r--r-- | libopie/oticker.cpp | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/libopie/oticker.cpp b/libopie/oticker.cpp index b4afbf9..6cd0dc8 100644 --- a/libopie/oticker.cpp +++ b/libopie/oticker.cpp | |||
@@ -47,6 +47,5 @@ | |||
47 | OTicker::OTicker( QWidget* parent ) | 47 | OTicker::OTicker( QWidget* parent ) |
48 | : QFrame( parent ) { | 48 | : QLabel( parent ) { |
49 | 49 | // : QFrame( parent ) { | |
50 | // setFrameStyle( NoFrame/*WinPanel | Sunken */); | 50 | setTextFormat(Qt::RichText); |
51 | |||
52 | Config cfg("qpe"); | 51 | Config cfg("qpe"); |
@@ -55,2 +54,4 @@ OTicker::OTicker( QWidget* parent ) | |||
55 | foregroundcolor= Qt::black; | 54 | foregroundcolor= Qt::black; |
55 | updateTimerTime = 50; | ||
56 | scrollLength = 1; | ||
56 | } | 57 | } |
@@ -91,4 +92,5 @@ void OTicker::setText( const QString& text ) { | |||
91 | killTimers(); | 92 | killTimers(); |
93 | // qDebug("Scrollupdate %d", updateTimerTime); | ||
92 | if ( pixelLen > contentsRect().width() ) | 94 | if ( pixelLen > contentsRect().width() ) |
93 | startTimer( 50 ); | 95 | startTimer( updateTimerTime); |
94 | update(); | 96 | update(); |
@@ -98,3 +100,3 @@ void OTicker::setText( const QString& text ) { | |||
98 | void OTicker::timerEvent( QTimerEvent * ) { | 100 | void OTicker::timerEvent( QTimerEvent * ) { |
99 | pos = ( pos <= 0 ) ? scrollTextPixmap.width() : pos - 1; | 101 | pos = ( pos <= 0 ) ? scrollTextPixmap.width() : pos - scrollLength;//1; |
100 | repaint( FALSE ); | 102 | repaint( FALSE ); |
@@ -113 +115,10 @@ void OTicker::mouseReleaseEvent( QMouseEvent * ) { | |||
113 | } | 115 | } |
116 | |||
117 | void OTicker::setUpdateTime(int time) { | ||
118 | updateTimerTime=time; | ||
119 | } | ||
120 | |||
121 | void OTicker::setScrollLength(int len) { | ||
122 | scrollLength=len; | ||
123 | } | ||
124 | |||