summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp4
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h2
-rw-r--r--noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp8
3 files changed, 10 insertions, 4 deletions
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp
index 82dfb13..baf8198 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.cpp
@@ -40,17 +40,19 @@ QString StockTickerPlugin::pixmapNameWidget() const {
40QWidget* StockTickerPlugin::widget( QWidget * wid ) { 40QWidget* StockTickerPlugin::widget( QWidget * wid ) {
41 return new StockTickerPluginWidget( wid, "StockTicker " ); 41 return new StockTickerPluginWidget( wid, "StockTicker " );
42} 42}
43 43
44QString StockTickerPlugin::pixmapNameConfig() const { 44QString StockTickerPlugin::pixmapNameConfig() const {
45 return 0l; 45 return 0l;
46} 46}
47 47
48TodayConfigWidget* StockTickerPlugin::configWidget( QWidget* wid ) { 48TodayConfigWidget* StockTickerPlugin::configWidget( QWidget* wid ) {
49 return 0l; 49 return 0l;
50} 50}
51 51
52QString StockTickerPlugin::appName() const { 52QString StockTickerPlugin::appName() const {
53 return "stockticker"; 53 return "stockticker";
54} 54}
55 55
56 56bool StockTickerPlugin::excludeFromRefresh() const {
57return true;
58}
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h
index 9f174bf..7e7698f 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h
+++ b/noncore/todayplugins/stockticker/stocktickerlib/stocktickerplugin.h
@@ -27,21 +27,21 @@
27#include <opie/todayplugininterface.h> 27#include <opie/todayplugininterface.h>
28#include <opie/todayconfigwidget.h> 28#include <opie/todayconfigwidget.h>
29 29
30class StockTickerPlugin : public TodayPluginObject { 30class StockTickerPlugin : public TodayPluginObject {
31 31
32public: 32public:
33 StockTickerPlugin(); 33 StockTickerPlugin();
34 ~StockTickerPlugin(); 34 ~StockTickerPlugin();
35 35
36 QString pluginName() const; 36 QString pluginName() const;
37 double versionNumber() const; 37 double versionNumber() const;
38 QString pixmapNameWidget() const; 38 QString pixmapNameWidget() const;
39 QWidget* widget(QWidget *); 39 QWidget* widget(QWidget *);
40 QString pixmapNameConfig() const; 40 QString pixmapNameConfig() const;
41 TodayConfigWidget* configWidget(QWidget *); 41 TodayConfigWidget* configWidget(QWidget *);
42 QString appName() const; 42 QString appName() const;
43 43 bool excludeFromRefresh() const;
44 44
45}; 45};
46 46
47#endif 47#endif
diff --git a/noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp b/noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp
index 6e6273b..3bdc820 100644
--- a/noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp
+++ b/noncore/todayplugins/stockticker/stocktickerlib/ticker.cpp
@@ -42,39 +42,43 @@
42#include <qframe.h> 42#include <qframe.h>
43#include <qlayout.h> 43#include <qlayout.h>
44#include <qdir.h> 44#include <qdir.h>
45#include <stdlib.h> 45#include <stdlib.h>
46#include <stdio.h> 46#include <stdio.h>
47 47
48#include "ticker.h" 48#include "ticker.h"
49 49
50Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) { 50Ticker::Ticker( QWidget* parent=0 ) : QFrame( parent ) {
51 setFrameStyle( NoFrame/*WinPanel | Sunken */); 51 setFrameStyle( NoFrame/*WinPanel | Sunken */);
52} 52}
53 53
54Ticker::~Ticker() { 54Ticker::~Ticker() {
55} 55}
56 56
57void Ticker::setText( const QString& text ) { 57void Ticker::setText( const QString& text ) {
58 58 Config cfg("qpe");
59 cfg.setGroup("Appearance");
60
59 pos = 0; // reset it everytime the text is changed 61 pos = 0; // reset it everytime the text is changed
60 scrollText = text; 62 scrollText = text;
61 63
62 int pixelLen = fontMetrics().width( text ); 64 int pixelLen = fontMetrics().width( text );
63 QPixmap pm( pixelLen, contentsRect().height() ); 65 QPixmap pm( pixelLen, contentsRect().height() );
64 pm.fill( QColor( 167, 212, 167 ) ); 66// pm.fill( QColor( 167, 212, 167 ));
67
68 pm.fill( QColor( cfg.readEntry( "Background", "#E5E1D5" ) ));
65 QPainter pmp( &pm ); 69 QPainter pmp( &pm );
66 pmp.setPen( Qt::black ); 70 pmp.setPen( Qt::black );
67 pmp.drawText( 0, 0, pixelLen, contentsRect().height(), AlignVCenter, scrollText ); 71 pmp.drawText( 0, 0, pixelLen, contentsRect().height(), AlignVCenter, scrollText );
68 pmp.end(); 72 pmp.end();
69 scrollTextPixmap = pm; 73 scrollTextPixmap = pm;
70 74
71 killTimers(); 75 killTimers();
72 if ( pixelLen > contentsRect().width() ) 76 if ( pixelLen > contentsRect().width() )
73 startTimer( 50 ); 77 startTimer( 50 );
74 update(); 78 update();
75} 79}
76 80
77 81
78void Ticker::timerEvent( QTimerEvent * ) { 82void Ticker::timerEvent( QTimerEvent * ) {
79 pos = ( pos <= 0 ) ? scrollTextPixmap.width() : pos - 1; 83 pos = ( pos <= 0 ) ? scrollTextPixmap.width() : pos - 1;
80 repaint( FALSE ); 84 repaint( FALSE );