-rw-r--r-- | core/launcher/taskbar.cpp | 41 |
1 files changed, 22 insertions, 19 deletions
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 37fdb30..2966168 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp | |||
@@ -19,24 +19,25 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #include "startmenu.h" | 21 | #include "startmenu.h" |
22 | #include "inputmethods.h" | 22 | #include "inputmethods.h" |
23 | #include "runningappbar.h" | 23 | #include "runningappbar.h" |
24 | #include "systray.h" | 24 | #include "systray.h" |
25 | #include "wait.h" | 25 | #include "wait.h" |
26 | #include "appicons.h" | 26 | #include "appicons.h" |
27 | 27 | ||
28 | #include "taskbar.h" | 28 | #include "taskbar.h" |
29 | #include "server.h" | 29 | #include "server.h" |
30 | 30 | ||
31 | #include <qtopia/config.h> | ||
31 | #include <qtopia/qpeapplication.h> | 32 | #include <qtopia/qpeapplication.h> |
32 | #ifdef QWS | 33 | #ifdef QWS |
33 | #include <qtopia/qcopenvelope_qws.h> | 34 | #include <qtopia/qcopenvelope_qws.h> |
34 | #endif | 35 | #endif |
35 | #include <qtopia/global.h> | 36 | #include <qtopia/global.h> |
36 | #include <qtopia/custom.h> | 37 | #include <qtopia/custom.h> |
37 | 38 | ||
38 | #include <qlabel.h> | 39 | #include <qlabel.h> |
39 | #include <qlayout.h> | 40 | #include <qlayout.h> |
40 | #include <qtimer.h> | 41 | #include <qtimer.h> |
41 | #ifdef QWS | 42 | #ifdef QWS |
42 | #include <qwindowsystem_qws.h> | 43 | #include <qwindowsystem_qws.h> |
@@ -163,24 +164,28 @@ private: | |||
163 | bool nl, cl; | 164 | bool nl, cl; |
164 | }; | 165 | }; |
165 | 166 | ||
166 | //--------------------------------------------------------------------------- | 167 | //--------------------------------------------------------------------------- |
167 | 168 | ||
168 | TaskBar::~TaskBar() | 169 | TaskBar::~TaskBar() |
169 | { | 170 | { |
170 | } | 171 | } |
171 | 172 | ||
172 | 173 | ||
173 | TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) | 174 | TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) |
174 | { | 175 | { |
176 | Config cfg( "Launcher" ); | ||
177 | cfg.setGroup( "InputMethods" ); | ||
178 | resizeRunningApp = cfg.readBoolEntry( "Resize", true ); | ||
179 | |||
175 | sm = new StartMenu( this ); | 180 | sm = new StartMenu( this ); |
176 | connect( sm, SIGNAL(tabSelected(const QString&)), this, | 181 | connect( sm, SIGNAL(tabSelected(const QString&)), this, |
177 | SIGNAL(tabSelected(const QString&)) ); | 182 | SIGNAL(tabSelected(const QString&)) ); |
178 | 183 | ||
179 | inputMethods = new InputMethods( this ); | 184 | inputMethods = new InputMethods( this ); |
180 | connect( inputMethods, SIGNAL(inputToggled(bool)), | 185 | connect( inputMethods, SIGNAL(inputToggled(bool)), |
181 | this, SLOT(calcMaxWindowRect()) ); | 186 | this, SLOT(calcMaxWindowRect()) ); |
182 | 187 | ||
183 | stack = new QWidgetStack( this ); | 188 | stack = new QWidgetStack( this ); |
184 | stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); | 189 | stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); |
185 | label = new QLabel(stack); | 190 | label = new QLabel(stack); |
186 | 191 | ||
@@ -282,44 +287,42 @@ void TaskBar::resizeEvent( QResizeEvent *e ) | |||
282 | 287 | ||
283 | qWarning("TaskBar::resize event"); | 288 | qWarning("TaskBar::resize event"); |
284 | } | 289 | } |
285 | 290 | ||
286 | void TaskBar::styleChange( QStyle &s ) | 291 | void TaskBar::styleChange( QStyle &s ) |
287 | { | 292 | { |
288 | QHBox::styleChange( s ); | 293 | QHBox::styleChange( s ); |
289 | calcMaxWindowRect(); | 294 | calcMaxWindowRect(); |
290 | } | 295 | } |
291 | 296 | ||
292 | void TaskBar::calcMaxWindowRect() | 297 | void TaskBar::calcMaxWindowRect() |
293 | { | 298 | { |
294 | /* | 299 | if ( resizeRunningApp ) |
295 | #ifdef Q_WS_QWS | 300 | { |
296 | QRect wr; | 301 | #if defined(Q_WS_QWS) |
297 | int displayWidth = qApp->desktop()->width(); | 302 | QRect wr; |
298 | QRect ir = inputMethods->inputRect(); | 303 | int displayWidth = qApp->desktop()->width(); |
299 | if ( ir.isValid() ) { | 304 | QRect ir = inputMethods->inputRect(); |
300 | wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); | 305 | if ( ir.isValid() ) { |
301 | } else { | 306 | wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); |
302 | wr.setCoords( 0, 0, displayWidth-1, y()-1 ); | 307 | } else { |
308 | wr.setCoords( 0, 0, displayWidth-1, y()-1 ); | ||
309 | } | ||
310 | #if QT_VERSION < 0x030000 | ||
311 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) ); | ||
312 | #else | ||
313 | QWSServer::setMaxWindowRect( wr ); | ||
314 | #endif | ||
315 | #endif | ||
303 | } | 316 | } |
304 | |||
305 | #if QT_VERSION < 0x030000 | ||
306 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr, | ||
307 | QSize(qt_screen->width(),qt_screen->height())) | ||
308 | ); | ||
309 | #else | ||
310 | QWSServer::setMaxWindowRect( wr ); | ||
311 | #endif | ||
312 | #endif | ||
313 | */ | ||
314 | } | 317 | } |
315 | 318 | ||
316 | void TaskBar::receive( const QCString &msg, const QByteArray &data ) | 319 | void TaskBar::receive( const QCString &msg, const QByteArray &data ) |
317 | { | 320 | { |
318 | QDataStream stream( data, IO_ReadOnly ); | 321 | QDataStream stream( data, IO_ReadOnly ); |
319 | if ( msg == "message(QString)" ) { | 322 | if ( msg == "message(QString)" ) { |
320 | QString text; | 323 | QString text; |
321 | stream >> text; | 324 | stream >> text; |
322 | setStatusMessage( text ); | 325 | setStatusMessage( text ); |
323 | } else if ( msg == "hideInputMethod()" ) { | 326 | } else if ( msg == "hideInputMethod()" ) { |
324 | inputMethods->hideInputMethod(); | 327 | inputMethods->hideInputMethod(); |
325 | } else if ( msg == "showInputMethod()" ) { | 328 | } else if ( msg == "showInputMethod()" ) { |