-rw-r--r-- | libqtaux/oticker.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libqtaux/oticker.cpp b/libqtaux/oticker.cpp index e954cc8..29478fd 100644 --- a/libqtaux/oticker.cpp +++ b/libqtaux/oticker.cpp | |||
@@ -28,12 +28,14 @@ | |||
28 | 28 | ||
29 | */ | 29 | */ |
30 | 30 | ||
31 | #include "oticker.h" | 31 | #include "oticker.h" |
32 | 32 | ||
33 | /* OPIE */ | 33 | /* OPIE */ |
34 | #include <opie2/odebug.h> | ||
35 | |||
34 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
35 | 37 | ||
36 | using namespace Opie::Ui; | 38 | using namespace Opie::Ui; |
37 | 39 | ||
38 | OTicker::OTicker( QWidget* parent ) | 40 | OTicker::OTicker( QWidget* parent ) |
39 | : QLabel( parent ) | 41 | : QLabel( parent ) |
@@ -69,20 +71,20 @@ void OTicker::setFrame( int frameStyle ) | |||
69 | } | 71 | } |
70 | 72 | ||
71 | void OTicker::setText( const QString& text ) | 73 | void OTicker::setText( const QString& text ) |
72 | { | 74 | { |
73 | pos = 0; // reset it everytime the text is changed | 75 | pos = 0; // reset it everytime the text is changed |
74 | scrollText = text; | 76 | scrollText = text; |
75 | qDebug( scrollText ); | 77 | odebug << scrollText << oendl; |
76 | 78 | ||
77 | int pixelLen = 0; | 79 | int pixelLen = 0; |
78 | bool bigger = false; | 80 | bool bigger = false; |
79 | int contWidth = contentsRect().width(); | 81 | int contWidth = contentsRect().width(); |
80 | int contHeight = contentsRect().height(); | 82 | int contHeight = contentsRect().height(); |
81 | int pixelTextLen = fontMetrics().width( text ); | 83 | int pixelTextLen = fontMetrics().width( text ); |
82 | qDebug( "<<<<<<<height %d, width %d, text width %d %d\n", contHeight, contWidth, pixelTextLen, scrollText.length() ); | 84 | odebug << "<<<<<<<height " << contHeight << ", width " << contWidth << ", text width " << pixelTextLen << " " << scrollText.length() << "\n" << oendl; |
83 | if ( pixelTextLen < contWidth ) | 85 | if ( pixelTextLen < contWidth ) |
84 | { | 86 | { |
85 | pixelLen = contWidth; | 87 | pixelLen = contWidth; |
86 | } | 88 | } |
87 | else | 89 | else |
88 | { | 90 | { |
@@ -97,13 +99,13 @@ void OTicker::setText( const QString& text ) | |||
97 | pmp.setPen( foregroundcolor ); | 99 | pmp.setPen( foregroundcolor ); |
98 | pmp.drawText( 0, 0, pixelTextLen, contHeight, AlignVCenter, scrollText ); | 100 | pmp.drawText( 0, 0, pixelTextLen, contHeight, AlignVCenter, scrollText ); |
99 | pmp.end(); | 101 | pmp.end(); |
100 | scrollTextPixmap = pm; | 102 | scrollTextPixmap = pm; |
101 | 103 | ||
102 | killTimers(); | 104 | killTimers(); |
103 | // qDebug("Scrollupdate %d", updateTimerTime); | 105 | // odebug << "Scrollupdate " << updateTimerTime << "" << oendl; |
104 | if ( bigger /*pixelTextLen > contWidth*/ ) | 106 | if ( bigger /*pixelTextLen > contWidth*/ ) |
105 | startTimer( updateTimerTime ); | 107 | startTimer( updateTimerTime ); |
106 | update(); | 108 | update(); |
107 | } | 109 | } |
108 | 110 | ||
109 | 111 | ||
@@ -120,13 +122,13 @@ void OTicker::drawContents( QPainter *p ) | |||
120 | if ( pixelLen > contentsRect().width() ) // Scrolling | 122 | if ( pixelLen > contentsRect().width() ) // Scrolling |
121 | p->drawPixmap( pos - pixelLen, contentsRect().y(), scrollTextPixmap ); | 123 | p->drawPixmap( pos - pixelLen, contentsRect().y(), scrollTextPixmap ); |
122 | } | 124 | } |
123 | 125 | ||
124 | void OTicker::mouseReleaseEvent( QMouseEvent * ) | 126 | void OTicker::mouseReleaseEvent( QMouseEvent * ) |
125 | { | 127 | { |
126 | // qDebug("<<<<<<<>>>>>>>>>"); | 128 | // odebug << "<<<<<<<>>>>>>>>>" << oendl; |
127 | emit mousePressed(); | 129 | emit mousePressed(); |
128 | } | 130 | } |
129 | 131 | ||
130 | void OTicker::setUpdateTime( int time ) | 132 | void OTicker::setUpdateTime( int time ) |
131 | { | 133 | { |
132 | updateTimerTime = time; | 134 | updateTimerTime = time; |