summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/oticker.cpp23
-rw-r--r--libopie/oticker.h46
2 files changed, 57 insertions, 12 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 @@
47OTicker::OTicker( QWidget* parent ) 47OTicker::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 ) {
98void OTicker::timerEvent( QTimerEvent * ) { 100void 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
117void OTicker::setUpdateTime(int time) {
118 updateTimerTime=time;
119}
120
121void OTicker::setScrollLength(int len) {
122scrollLength=len;
123}
124
diff --git a/libopie/oticker.h b/libopie/oticker.h
index 92a4be4..b7499e3 100644
--- a/libopie/oticker.h
+++ b/libopie/oticker.h
@@ -1 +1,31 @@
1/*
2                This file is part of the Opie Project
3 Copyright (c) 2002 L. Potter <ljp@llornkcor.com>
4 =.
5 .=l.
6           .>+-=
7 _;:,     .>    :=|. This program is free software; you can
8.> <`_,   >  .   <= redistribute it and/or modify it under
9:`=1 )Y*s>-.--   : the terms of the GNU General Public
10.="- .-=="i,     .._ License as published by the Free Software
11 - .   .-<_>     .<> Foundation; either version 2 of the License,
12     ._= =}       : or (at your option) any later version.
13    .%`+i>       _;_.
14    .i_,=:_.      -<s. This program is distributed in the hope that
15     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
16    : ..    .:,     . . . without even the implied warranty of
17    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
18  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
19..}^=.=       =       ; Library General Public License for more
20++=   -.     .`     .: details.
21 :     =  ...= . :.=-
22 -.   .:....=;==+<; You should have received a copy of the GNU
23  -_. . .   )=.  = Library General Public License along with
24    --        :-=` this library; see the file COPYING.LIB.
25 If not, write to the Free Software Foundation,
26 Inc., 59 Temple Place - Suite 330,
27 Boston, MA 02111-1307, USA.
28
29*/
30
1#ifndef OTICKER_H 31#ifndef OTICKER_H
@@ -9,2 +39,3 @@
9#include <qslider.h> 39#include <qslider.h>
40#include <qlabel.h>
10#include <qframe.h> 41#include <qframe.h>
@@ -13,3 +44,4 @@
13 44
14class OTicker : public QFrame { 45class OTicker : public QLabel {
46//class OTicker : public QFrame {
15 Q_OBJECT 47 Q_OBJECT
@@ -20,7 +52,9 @@ public:
20 void setText( const QString& text ) ; 52 void setText( const QString& text ) ;
21 void setBackgroundColor(QColor color); 53 void setBackgroundColor(QColor color); //sets background
22 void setForegroundColor(QColor color); 54 void setForegroundColor(QColor color); //sets text color
23 void setFrame(int); 55 void setFrame(int); //sets frame style
56 void setUpdateTime(int); //sets timeout for redraws default is 50 ms
57 void setScrollLength(int); //sets amount of scrolling default is 1
24signals: 58signals:
25 void mousePressed(); 59 void mousePressed(); // for mouse press events
26protected: 60protected:
@@ -33,3 +67,3 @@ private:
33 QPixmap scrollTextPixmap; 67 QPixmap scrollTextPixmap;
34 int pos;//, pixelLen; 68 int pos, updateTimerTime, scrollLength;
35}; 69};