author | zecke <zecke> | 2003-09-03 20:28:36 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-09-03 20:28:36 (UTC) |
commit | 2ec64be7f5250e851f44107552e89aff62922d44 (patch) (unidiff) | |
tree | 8a6be2da822ca969710fca4d604c7fede6b88916 | |
parent | adbbb67c7032080195970c78e43209b564a0295f (diff) | |
download | opie-2ec64be7f5250e851f44107552e89aff62922d44.zip opie-2ec64be7f5250e851f44107552e89aff62922d44.tar.gz opie-2ec64be7f5250e851f44107552e89aff62922d44.tar.bz2 |
Fix the most grave visible problems with bigger screen
resolutions
-rw-r--r-- | core/applets/batteryapplet/battery.cpp | 10 | ||||
-rw-r--r-- | core/applets/clipboardapplet/clipboard.cpp | 14 | ||||
-rw-r--r-- | core/applets/irdaapplet/irda.cpp | 2 | ||||
-rw-r--r-- | core/applets/irdaapplet/irdaappletimpl.h | 2 | ||||
-rw-r--r-- | core/applets/rotateapplet/rotate.h | 2 | ||||
-rw-r--r-- | core/applets/volumeapplet/volume.cpp | 2 |
6 files changed, 23 insertions, 9 deletions
diff --git a/core/applets/batteryapplet/battery.cpp b/core/applets/batteryapplet/battery.cpp index 078ce8d..15eb762 100644 --- a/core/applets/batteryapplet/battery.cpp +++ b/core/applets/batteryapplet/battery.cpp | |||
@@ -13,66 +13,69 @@ | |||
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #include "battery.h" | 20 | #include "battery.h" |
21 | #include "batterystatus.h" | 21 | #include "batterystatus.h" |
22 | 22 | ||
23 | #include <qpe/applnk.h> | 23 | #include <qpe/applnk.h> |
24 | #include <qpe/config.h> | 24 | #include <qpe/config.h> |
25 | #include <qpe/power.h> | 25 | #include <qpe/power.h> |
26 | #include <qpe/qpeapplication.h> | 26 | #include <qpe/qpeapplication.h> |
27 | 27 | ||
28 | #include <qpainter.h> | 28 | #include <qpainter.h> |
29 | #include <qtimer.h> | 29 | #include <qtimer.h> |
30 | 30 | ||
31 | 31 | ||
32 | BatteryMeter::BatteryMeter( QWidget *parent ) | 32 | BatteryMeter::BatteryMeter( QWidget *parent ) |
33 | : QWidget( parent ), charging(false) | 33 | : QWidget( parent ), charging(false) |
34 | { | 34 | { |
35 | ps = new PowerStatus; | 35 | ps = new PowerStatus; |
36 | startTimer( 10000 ); | 36 | startTimer( 10000 ); |
37 | |||
38 | setFixedWidth( QMAX(AppLnk::smallIconSize()*3/4, 6) ); | ||
37 | setFixedHeight( AppLnk::smallIconSize() ); | 39 | setFixedHeight( AppLnk::smallIconSize() ); |
40 | |||
38 | chargeTimer = new QTimer( this ); | 41 | chargeTimer = new QTimer( this ); |
39 | connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) ); | 42 | connect( chargeTimer, SIGNAL(timeout()), this, SLOT(chargeTimeout()) ); |
40 | timerEvent(0); | 43 | timerEvent(0); |
41 | QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); | 44 | QPEApplication::setStylusOperation( this, QPEApplication::RightOnHold ); |
42 | Config c( "qpe" ); | 45 | Config c( "qpe" ); |
43 | c.setGroup( "Battery" ); | 46 | c.setGroup( "Battery" ); |
44 | style = c.readNumEntry( "Style", 0 ); | 47 | style = c.readNumEntry( "Style", 0 ); |
45 | } | 48 | } |
46 | 49 | ||
47 | BatteryMeter::~BatteryMeter() | 50 | BatteryMeter::~BatteryMeter() |
48 | { | 51 | { |
49 | delete ps; | 52 | delete ps; |
50 | } | 53 | } |
51 | 54 | ||
52 | QSize BatteryMeter::sizeHint() const | 55 | QSize BatteryMeter::sizeHint() const |
53 | { | 56 | { |
54 | return QSize(10, height() ); | 57 | return QSize(QMAX(AppLnk::smallIconSize()*3/4, 6), height() ); |
55 | } | 58 | } |
56 | 59 | ||
57 | void BatteryMeter::mousePressEvent( QMouseEvent* e ) | 60 | void BatteryMeter::mousePressEvent( QMouseEvent* e ) |
58 | { | 61 | { |
59 | if ( e->button() == RightButton ) | 62 | if ( e->button() == RightButton ) |
60 | { | 63 | { |
61 | style = 1-style; | 64 | style = 1-style; |
62 | Config c( "qpe" ); | 65 | Config c( "qpe" ); |
63 | c.setGroup( "Battery" ); | 66 | c.setGroup( "Battery" ); |
64 | c.writeEntry( "Style", style ); | 67 | c.writeEntry( "Style", style ); |
65 | repaint( true ); | 68 | repaint( true ); |
66 | } | 69 | } |
67 | QWidget::mousePressEvent( e ); | 70 | QWidget::mousePressEvent( e ); |
68 | } | 71 | } |
69 | 72 | ||
70 | void BatteryMeter::mouseReleaseEvent( QMouseEvent* e) | 73 | void BatteryMeter::mouseReleaseEvent( QMouseEvent* e) |
71 | { | 74 | { |
72 | if ( batteryView && batteryView->isVisible() ) { | 75 | if ( batteryView && batteryView->isVisible() ) { |
73 | delete (QWidget *) batteryView; | 76 | delete (QWidget *) batteryView; |
74 | } else { | 77 | } else { |
75 | if ( !batteryView ) batteryView = new BatteryStatus( ps ); | 78 | if ( !batteryView ) batteryView = new BatteryStatus( ps ); |
76 | batteryView->showMaximized(); | 79 | batteryView->showMaximized(); |
77 | batteryView->raise(); | 80 | batteryView->raise(); |
78 | batteryView->show(); | 81 | batteryView->show(); |
@@ -95,56 +98,57 @@ void BatteryMeter::timerEvent( QTimerEvent * ) | |||
95 | charging = false; | 98 | charging = false; |
96 | chargeTimer->stop(); | 99 | chargeTimer->stop(); |
97 | if ( batteryView ) | 100 | if ( batteryView ) |
98 | batteryView->updatePercent( percent ); | 101 | batteryView->updatePercent( percent ); |
99 | } | 102 | } |
100 | repaint( style != 0 ); | 103 | repaint( style != 0 ); |
101 | if ( batteryView ) | 104 | if ( batteryView ) |
102 | batteryView->repaint(); | 105 | batteryView->repaint(); |
103 | } | 106 | } |
104 | } | 107 | } |
105 | 108 | ||
106 | void BatteryMeter::chargeTimeout() | 109 | void BatteryMeter::chargeTimeout() |
107 | { | 110 | { |
108 | percent += 20; | 111 | percent += 20; |
109 | if ( percent > 100 ) | 112 | if ( percent > 100 ) |
110 | percent = 0; | 113 | percent = 0; |
111 | 114 | ||
112 | repaint(FALSE); | 115 | repaint(FALSE); |
113 | if ( batteryView ) | 116 | if ( batteryView ) |
114 | batteryView->updatePercent( percent ); | 117 | batteryView->updatePercent( percent ); |
115 | } | 118 | } |
116 | 119 | ||
117 | void BatteryMeter::paintEvent( QPaintEvent* ) | 120 | void BatteryMeter::paintEvent( QPaintEvent* ) |
118 | { | 121 | { |
122 | qWarning("paint"); | ||
119 | if ( style == 1 ) | 123 | if ( style == 1 ) |
120 | { | 124 | { |
121 | QPainter p(this); | 125 | QPainter p(this); |
122 | QFont f( "Fixed", AppLnk::smallIconSize()/2 ); | 126 | QFont f( "Fixed", AppLnk::smallIconSize()/2 ); |
123 | QFontMetrics fm( f ); | 127 | QFontMetrics fm( f ); |
124 | p.setFont( f ); | 128 | p.setFont( f ); |
125 | p.drawText( 0, AppLnk::smallIconSize()/2, QString::number( percent ) ); | 129 | p.drawText( 0, height()/2, QString::number( percent ) ); |
126 | p.drawText( AppLnk::smallIconSize()/4, AppLnk::smallIconSize(), "%" ); | 130 | p.drawText( width()/4, height(), "%" ); |
127 | return; | 131 | return; |
128 | } | 132 | } |
129 | 133 | ||
130 | QPainter p(this); | 134 | QPainter p(this); |
131 | QColor color; | 135 | QColor color; |
132 | QColor g = gray.light( 160 ); | 136 | QColor g = gray.light( 160 ); |
133 | switch ( ps->acStatus() ) | 137 | switch ( ps->acStatus() ) |
134 | { | 138 | { |
135 | case PowerStatus::Offline: color = blue.light( 150 ); break; | 139 | case PowerStatus::Offline: color = blue.light( 150 ); break; |
136 | case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break; | 140 | case PowerStatus::Online: color = green.dark( 130 ).light( 180 ); break; |
137 | default: color = red.light( 160 ); | 141 | default: color = red.light( 160 ); |
138 | } | 142 | } |
139 | 143 | ||
140 | int w = height() / 2; | 144 | int w = height() / 2; |
141 | if ( !(w%2) ) w--; // should have an odd value to get a real middle line | 145 | if ( !(w%2) ) w--; // should have an odd value to get a real middle line |
142 | int h = height() - 4; | 146 | int h = height() - 4; |
143 | int pix = (percent * h) / 100; | 147 | int pix = (percent * h) / 100; |
144 | int y2 = height() -2; | 148 | int y2 = height() -2; |
145 | int y = y2 - pix; | 149 | int y = y2 - pix; |
146 | int x1 = (width() - w ) / 2; | 150 | int x1 = (width() - w ) / 2; |
147 | 151 | ||
148 | p.setPen(QColor(80,80,80)); | 152 | p.setPen(QColor(80,80,80)); |
149 | p.drawLine(x1+w/4,0,x1+w/4+w/2+1,0); // header | 153 | p.drawLine(x1+w/4,0,x1+w/4+w/2+1,0); // header |
150 | p.drawRect(x1,1,w,height()-1); // corpus | 154 | p.drawRect(x1,1,w,height()-1); // corpus |
diff --git a/core/applets/clipboardapplet/clipboard.cpp b/core/applets/clipboardapplet/clipboard.cpp index 21b68e3..bb0db9b 100644 --- a/core/applets/clipboardapplet/clipboard.cpp +++ b/core/applets/clipboardapplet/clipboard.cpp | |||
@@ -14,51 +14,55 @@ | |||
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "clipboard.h" | 21 | #include "clipboard.h" |
22 | 22 | ||
23 | #include <qpe/resource.h> | 23 | #include <qpe/resource.h> |
24 | #include <qpe/applnk.h> | 24 | #include <qpe/applnk.h> |
25 | 25 | ||
26 | #include <qpainter.h> | 26 | #include <qpainter.h> |
27 | #include <qpopupmenu.h> | 27 | #include <qpopupmenu.h> |
28 | #include <qwindowsystem_qws.h> | 28 | #include <qwindowsystem_qws.h> |
29 | #include <qapplication.h> | 29 | #include <qapplication.h> |
30 | #include <qclipboard.h> | 30 | #include <qclipboard.h> |
31 | #include <qtimer.h> | 31 | #include <qtimer.h> |
32 | 32 | ||
33 | //=========================================================================== | 33 | //=========================================================================== |
34 | 34 | ||
35 | 35 | ||
36 | ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) | 36 | ClipboardApplet::ClipboardApplet( QWidget *parent, const char *name ) : QWidget( parent, name ) |
37 | { | 37 | { |
38 | setFixedWidth ( AppLnk::smallIconSize() ); | 38 | setFixedWidth ( AppLnk::smallIconSize() ); |
39 | setFixedHeight ( AppLnk::smallIconSize() ); | 39 | setFixedHeight ( AppLnk::smallIconSize() ); |
40 | m_clipboardPixmap = QPixmap ( Resource::loadPixmap( "paste" ) ); | 40 | |
41 | QImage img = Resource::loadImage( "paste"); | ||
42 | img = img.smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ); | ||
43 | |||
44 | m_clipboardPixmap.convertFromImage( img ); | ||
41 | 45 | ||
42 | m_timer = new QTimer ( this ); | 46 | m_timer = new QTimer ( this ); |
43 | 47 | ||
44 | connect ( QApplication::clipboard ( ), SIGNAL( dataChanged ( )), this, SLOT( newData ( ))); | 48 | connect ( QApplication::clipboard ( ), SIGNAL( dataChanged ( )), this, SLOT( newData ( ))); |
45 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( newData ( ))); | 49 | connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( newData ( ))); |
46 | connect ( qApp, SIGNAL( aboutToQuit ( )), this, SLOT( shutdown ( ))); | 50 | connect ( qApp, SIGNAL( aboutToQuit ( )), this, SLOT( shutdown ( ))); |
47 | 51 | ||
48 | m_menu = 0; | 52 | m_menu = 0; |
49 | m_dirty = true; | 53 | m_dirty = true; |
50 | m_lasttext = QString::null; | 54 | m_lasttext = QString::null; |
51 | 55 | ||
52 | m_timer-> start ( 0, true ); | 56 | m_timer-> start ( 0, true ); |
53 | } | 57 | } |
54 | 58 | ||
55 | ClipboardApplet::~ClipboardApplet ( ) | 59 | ClipboardApplet::~ClipboardApplet ( ) |
56 | { | 60 | { |
57 | } | 61 | } |
58 | 62 | ||
59 | void ClipboardApplet::shutdown ( ) | 63 | void ClipboardApplet::shutdown ( ) |
60 | { | 64 | { |
61 | // the timer has to be stopped, or Qt/E will hang on quit() | 65 | // the timer has to be stopped, or Qt/E will hang on quit() |
62 | // see launcher/desktop.cpp | 66 | // see launcher/desktop.cpp |
63 | 67 | ||
64 | m_timer-> stop ( ); | 68 | m_timer-> stop ( ); |
@@ -119,49 +123,51 @@ void ClipboardApplet::action(int id) | |||
119 | break; | 123 | break; |
120 | 124 | ||
121 | default: | 125 | default: |
122 | if (( id >= 0 ) && ( uint( id ) < m_history. count ( ))) { | 126 | if (( id >= 0 ) && ( uint( id ) < m_history. count ( ))) { |
123 | QApplication::clipboard ( )-> setText ( m_history [id] ); | 127 | QApplication::clipboard ( )-> setText ( m_history [id] ); |
124 | 128 | ||
125 | for ( uint i = 0; i < m_history. count ( ); i++ ) | 129 | for ( uint i = 0; i < m_history. count ( ); i++ ) |
126 | m_menu-> setItemChecked ( i, i == uint( id )); | 130 | m_menu-> setItemChecked ( i, i == uint( id )); |
127 | 131 | ||
128 | unicode = 'V' - '@'; | 132 | unicode = 'V' - '@'; |
129 | scan = Key_V; | 133 | scan = Key_V; |
130 | } | 134 | } |
131 | break; | 135 | break; |
132 | } | 136 | } |
133 | 137 | ||
134 | if ( scan ) { | 138 | if ( scan ) { |
135 | qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, true, false ); | 139 | qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, true, false ); |
136 | qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, false, false ); | 140 | qwsServer-> sendKeyEvent ( unicode, scan, ControlButton, false, false ); |
137 | } | 141 | } |
138 | } | 142 | } |
139 | 143 | ||
140 | void ClipboardApplet::paintEvent ( QPaintEvent* ) | 144 | void ClipboardApplet::paintEvent ( QPaintEvent* ) |
141 | { | 145 | { |
142 | QPainter p ( this ); | 146 | QPainter p ( this ); |
143 | p. drawPixmap( 0, 1, m_clipboardPixmap ); | 147 | /* center the height but our pixmap is as big as the height ;)*/ |
148 | p. drawPixmap( 0, 0, | ||
149 | m_clipboardPixmap ); | ||
144 | } | 150 | } |
145 | 151 | ||
146 | void ClipboardApplet::newData ( ) | 152 | void ClipboardApplet::newData ( ) |
147 | { | 153 | { |
148 | static bool excllock = false; | 154 | static bool excllock = false; |
149 | 155 | ||
150 | if ( excllock ) | 156 | if ( excllock ) |
151 | return; | 157 | return; |
152 | else | 158 | else |
153 | excllock = true; | 159 | excllock = true; |
154 | 160 | ||
155 | m_timer-> stop ( ); | 161 | m_timer-> stop ( ); |
156 | 162 | ||
157 | QCString type = "plain"; | 163 | QCString type = "plain"; |
158 | QString txt = QApplication::clipboard ( )-> text ( type ); | 164 | QString txt = QApplication::clipboard ( )-> text ( type ); |
159 | 165 | ||
160 | if ( !txt. isEmpty ( ) && !m_history. contains ( txt )) { | 166 | if ( !txt. isEmpty ( ) && !m_history. contains ( txt )) { |
161 | m_history. append ( txt ); | 167 | m_history. append ( txt ); |
162 | 168 | ||
163 | if ( m_history. count ( ) > 5 ) | 169 | if ( m_history. count ( ) > 5 ) |
164 | m_history. remove ( m_history. begin ( )); | 170 | m_history. remove ( m_history. begin ( )); |
165 | 171 | ||
166 | m_dirty = true; | 172 | m_dirty = true; |
167 | } | 173 | } |
diff --git a/core/applets/irdaapplet/irda.cpp b/core/applets/irdaapplet/irda.cpp index 51c2ebf..f850424 100644 --- a/core/applets/irdaapplet/irda.cpp +++ b/core/applets/irdaapplet/irda.cpp | |||
@@ -294,49 +294,49 @@ void IrdaApplet::timerEvent ( QTimerEvent * ) | |||
294 | bool receiveUpdate = false; | 294 | bool receiveUpdate = false; |
295 | 295 | ||
296 | if ( m_receive_state_changed ) { | 296 | if ( m_receive_state_changed ) { |
297 | receiveUpdate = true; | 297 | receiveUpdate = true; |
298 | m_receive_state_changed = false; | 298 | m_receive_state_changed = false; |
299 | } | 299 | } |
300 | 300 | ||
301 | m_irda_active = checkIrdaStatus ( ); | 301 | m_irda_active = checkIrdaStatus ( ); |
302 | m_irda_discovery_active = checkIrdaDiscoveryStatus ( ); | 302 | m_irda_discovery_active = checkIrdaDiscoveryStatus ( ); |
303 | 303 | ||
304 | if ( m_irda_discovery_active ) | 304 | if ( m_irda_discovery_active ) |
305 | showDiscovered ( ); | 305 | showDiscovered ( ); |
306 | 306 | ||
307 | if (( m_irda_active != oldactive ) || ( m_irda_discovery_active != olddiscovery ) || receiveUpdate ) | 307 | if (( m_irda_active != oldactive ) || ( m_irda_discovery_active != olddiscovery ) || receiveUpdate ) |
308 | update ( ); | 308 | update ( ); |
309 | } | 309 | } |
310 | 310 | ||
311 | void IrdaApplet::paintEvent ( QPaintEvent * ) | 311 | void IrdaApplet::paintEvent ( QPaintEvent * ) |
312 | { | 312 | { |
313 | QPainter p ( this ); | 313 | QPainter p ( this ); |
314 | 314 | ||
315 | p. drawPixmap ( 0, 1, m_irda_active ? m_irdaOnPixmap : m_irdaOffPixmap ); | 315 | p. drawPixmap ( 0, 1, m_irda_active ? m_irdaOnPixmap : m_irdaOffPixmap ); |
316 | 316 | ||
317 | if ( m_irda_discovery_active ) | 317 | if ( m_irda_discovery_active ) |
318 | p. drawPixmap( 0, 1, m_irdaDiscoveryOnPixmap ); | 318 | p. drawPixmap( 0, 1, m_irdaDiscoveryOnPixmap ); |
319 | 319 | ||
320 | if ( m_receive_active ) | 320 | if ( m_receive_active ) |
321 | p. drawPixmap( 0, 1, m_receiveActivePixmap ); | 321 | p. drawPixmap( 0, 1, m_receiveActivePixmap ); |
322 | } | 322 | } |
323 | /* | 323 | /* |
324 | * We know 3 calls | 324 | * We know 3 calls |
325 | * a) enable | 325 | * a) enable |
326 | * b) disable | 326 | * b) disable |
327 | * a and b will temp enable the IrDa device and disable will disable it again if it wasn't on | 327 | * a and b will temp enable the IrDa device and disable will disable it again if it wasn't on |
328 | * c) listDevices: We will return a list of known devices | 328 | * c) listDevices: We will return a list of known devices |
329 | */ | 329 | */ |
330 | void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) { | 330 | void IrdaApplet::slotMessage( const QCString& str, const QByteArray& ar ) { |
331 | if ( str == "enableIrda()") { | 331 | if ( str == "enableIrda()") { |
332 | m_wasOn = checkIrdaStatus(); | 332 | m_wasOn = checkIrdaStatus(); |
333 | m_wasDiscover = checkIrdaDiscoveryStatus(); | 333 | m_wasDiscover = checkIrdaDiscoveryStatus(); |
334 | if (!m_wasOn) { | 334 | if (!m_wasOn) { |
335 | setIrdaStatus( true ); | 335 | setIrdaStatus( true ); |
336 | } | 336 | } |
337 | if ( !m_wasDiscover ) { | 337 | if ( !m_wasDiscover ) { |
338 | setIrdaDiscoveryStatus ( true ); | 338 | setIrdaDiscoveryStatus ( true ); |
339 | } | 339 | } |
340 | } else if ( str == "disableIrda()") { | 340 | } else if ( str == "disableIrda()") { |
341 | if (!m_wasOn) { | 341 | if (!m_wasOn) { |
342 | setIrdaStatus( false ); | 342 | setIrdaStatus( false ); |
diff --git a/core/applets/irdaapplet/irdaappletimpl.h b/core/applets/irdaapplet/irdaappletimpl.h index ef0c5a6..f9e855a 100644 --- a/core/applets/irdaapplet/irdaappletimpl.h +++ b/core/applets/irdaapplet/irdaappletimpl.h | |||
@@ -1,44 +1,46 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef IRDAAPPLETIMPL_H | 20 | #ifndef IRDAAPPLETIMPL_H |
21 | #define IRDAAPPLETIMPL_H | 21 | #define IRDAAPPLETIMPL_H |
22 | 22 | ||
23 | #include <qwidget.h> | ||
24 | |||
23 | #include <qpe/taskbarappletinterface.h> | 25 | #include <qpe/taskbarappletinterface.h> |
24 | 26 | ||
25 | class IrdaApplet; | 27 | class IrdaApplet; |
26 | 28 | ||
27 | class IrdaAppletImpl : public TaskbarAppletInterface | 29 | class IrdaAppletImpl : public TaskbarAppletInterface |
28 | { | 30 | { |
29 | public: | 31 | public: |
30 | IrdaAppletImpl(); | 32 | IrdaAppletImpl(); |
31 | virtual ~IrdaAppletImpl(); | 33 | virtual ~IrdaAppletImpl(); |
32 | 34 | ||
33 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 35 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
34 | Q_REFCOUNT | 36 | Q_REFCOUNT |
35 | 37 | ||
36 | virtual QWidget *applet( QWidget *parent ); | 38 | virtual QWidget *applet( QWidget *parent ); |
37 | virtual int position() const; | 39 | virtual int position() const; |
38 | 40 | ||
39 | private: | 41 | private: |
40 | IrdaApplet *irda; | 42 | IrdaApplet *irda; |
41 | ulong ref; | 43 | ulong ref; |
42 | }; | 44 | }; |
43 | 45 | ||
44 | #endif | 46 | #endif |
diff --git a/core/applets/rotateapplet/rotate.h b/core/applets/rotateapplet/rotate.h index 5ac7768..de2a707 100644 --- a/core/applets/rotateapplet/rotate.h +++ b/core/applets/rotateapplet/rotate.h | |||
@@ -13,48 +13,50 @@ | |||
13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 13 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
14 | : .. .:, . . . without even the implied warranty of | 14 | : .. .:, . . . without even the implied warranty of |
15 | =_ + =;=| MERCHANTABILITY or FITNESS FOR A | 15 | =_ + =;=| MERCHANTABILITY or FITNESS FOR A |
16 | _.=:. : :=>: PARTICULAR PURPOSE. See the GNU | 16 | _.=:. : :=>: PARTICULAR PURPOSE. See the GNU |
17 | ..}^=.= = ; Library General Public License for more | 17 | ..}^=.= = ; Library General Public License for more |
18 | ++= -. . .: details. | 18 | ++= -. . .: details. |
19 | : = ...= . :.=- | 19 | : = ...= . :.=- |
20 | -. .:....=;==+<; You should have received a copy of the GNU | 20 | -. .:....=;==+<; You should have received a copy of the GNU |
21 | -_. . . )=. = Library General Public License along with | 21 | -_. . . )=. = Library General Public License along with |
22 | -- :-= this library; see the file COPYING.LIB. | 22 | -- :-= this library; see the file COPYING.LIB. |
23 | If not, write to the Free Software Foundation, | 23 | If not, write to the Free Software Foundation, |
24 | Inc., 59 Temple Place - Suite 330, | 24 | Inc., 59 Temple Place - Suite 330, |
25 | Boston, MA 02111-1307, USA. | 25 | Boston, MA 02111-1307, USA. |
26 | 26 | ||
27 | */ | 27 | */ |
28 | 28 | ||
29 | 29 | ||
30 | 30 | ||
31 | #ifndef __OPIE_ROTATE_APPLET_H__ | 31 | #ifndef __OPIE_ROTATE_APPLET_H__ |
32 | #define __OPIE_ROTATE_APPLET_H__ | 32 | #define __OPIE_ROTATE_APPLET_H__ |
33 | 33 | ||
34 | #include <qpe/menuappletinterface.h> | 34 | #include <qpe/menuappletinterface.h> |
35 | #include <qobject.h> | 35 | #include <qobject.h> |
36 | 36 | ||
37 | #include <qobject.h> | ||
38 | |||
37 | class RotateApplet : public QObject, public MenuAppletInterface | 39 | class RotateApplet : public QObject, public MenuAppletInterface |
38 | { | 40 | { |
39 | 41 | ||
40 | Q_OBJECT | 42 | Q_OBJECT |
41 | 43 | ||
42 | public: | 44 | public: |
43 | RotateApplet ( ); | 45 | RotateApplet ( ); |
44 | virtual ~RotateApplet ( ); | 46 | virtual ~RotateApplet ( ); |
45 | 47 | ||
46 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); | 48 | QRESULT queryInterface( const QUuid&, QUnknownInterface** ); |
47 | Q_REFCOUNT | 49 | Q_REFCOUNT |
48 | 50 | ||
49 | virtual int position() const; | 51 | virtual int position() const; |
50 | 52 | ||
51 | virtual QString name ( ) const; | 53 | virtual QString name ( ) const; |
52 | virtual QIconSet icon ( ) const; | 54 | virtual QIconSet icon ( ) const; |
53 | virtual QString text ( ) const; | 55 | virtual QString text ( ) const; |
54 | /* virtual QString tr( const char* ) const; | 56 | /* virtual QString tr( const char* ) const; |
55 | virtual QString tr( const char*, const char* ) const; | 57 | virtual QString tr( const char*, const char* ) const; |
56 | */ | 58 | */ |
57 | virtual QPopupMenu *popup ( QWidget *parent ) const; | 59 | virtual QPopupMenu *popup ( QWidget *parent ) const; |
58 | virtual void activated ( ); | 60 | virtual void activated ( ); |
59 | 61 | ||
60 | private slots: | 62 | private slots: |
diff --git a/core/applets/volumeapplet/volume.cpp b/core/applets/volumeapplet/volume.cpp index b129be3..38f827e 100644 --- a/core/applets/volumeapplet/volume.cpp +++ b/core/applets/volumeapplet/volume.cpp | |||
@@ -742,42 +742,42 @@ VolumeApplet::~VolumeApplet() | |||
742 | } | 742 | } |
743 | 743 | ||
744 | 744 | ||
745 | void VolumeApplet::mousePressEvent ( QMouseEvent * ) | 745 | void VolumeApplet::mousePressEvent ( QMouseEvent * ) |
746 | { | 746 | { |
747 | if ( m_dialog-> isVisible ( )) | 747 | if ( m_dialog-> isVisible ( )) |
748 | m_dialog-> hide ( ); | 748 | m_dialog-> hide ( ); |
749 | else | 749 | else |
750 | m_dialog-> show ( true ); | 750 | m_dialog-> show ( true ); |
751 | } | 751 | } |
752 | 752 | ||
753 | void VolumeApplet::redraw ( bool all ) | 753 | void VolumeApplet::redraw ( bool all ) |
754 | { | 754 | { |
755 | if ( all ) | 755 | if ( all ) |
756 | repaint ( true ); | 756 | repaint ( true ); |
757 | else | 757 | else |
758 | repaint ( 2, height ( ) - 3, width ( ) - 4, 2, false ); | 758 | repaint ( 2, height ( ) - 3, width ( ) - 4, 2, false ); |
759 | } | 759 | } |
760 | 760 | ||
761 | 761 | ||
762 | void VolumeApplet::paintEvent ( QPaintEvent * ) | 762 | void VolumeApplet::paintEvent ( QPaintEvent * ) |
763 | { | 763 | { |
764 | QPainter p ( this ); | 764 | QPainter p ( this ); |
765 | 765 | ||
766 | p. drawPixmap ( 0, 1, *m_pixmap ); | 766 | p. drawPixmap ( (width()- m_pixmap->width())/2, QMAX( (height()-4-m_pixmap->height() )/2, 1), *m_pixmap ); |
767 | p. setPen ( darkGray ); | 767 | p. setPen ( darkGray ); |
768 | p. drawRect ( 1, height() - 4, width() - 2, 4 ); | 768 | p. drawRect ( 1, height() - 4, width() - 2, 4 ); |
769 | 769 | ||
770 | int pixelsWide = m_dialog-> volPercent ( ) * ( width() - 4 ) / 100; | 770 | int pixelsWide = m_dialog-> volPercent ( ) * ( width() - 4 ) / 100; |
771 | p. fillRect ( 2, height() - 3, pixelsWide, 2, red ); | 771 | p. fillRect ( 2, height() - 3, pixelsWide, 2, red ); |
772 | p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray ); | 772 | p. fillRect ( pixelsWide + 2, height() - 3, width() - 4 - pixelsWide, 2, lightGray ); |
773 | 773 | ||
774 | if ( m_dialog-> volMuted ( )) { | 774 | if ( m_dialog-> volMuted ( )) { |
775 | p. setPen ( red ); | 775 | p. setPen ( red ); |
776 | p. drawLine ( 1, 2, width() - 2, height() - 5 ); | 776 | p. drawLine ( 1, 2, width() - 2, height() - 5 ); |
777 | p. drawLine ( 1, 3, width() - 2, height() - 4 ); | 777 | p. drawLine ( 1, 3, width() - 2, height() - 4 ); |
778 | p. drawLine ( width() - 2, 2, 1, height() - 5 ); | 778 | p. drawLine ( width() - 2, 2, 1, height() - 5 ); |
779 | p. drawLine ( width() - 2, 3, 1, height() - 4 ); | 779 | p. drawLine ( width() - 2, 3, 1, height() - 4 ); |
780 | } | 780 | } |
781 | } | 781 | } |
782 | 782 | ||
783 | 783 | ||