-rw-r--r-- | core/launcher/taskbar.cpp | 52 |
1 files changed, 30 insertions, 22 deletions
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 7cbfe13..1356c77 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp | |||
@@ -1,56 +1,64 @@ | |||
1 | /********************************************************************** | 1 | /* |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | This file is part of the Opie Project |
3 | ** | 3 | =. (C) 2000-2002 Trolltech AS |
4 | ** This file is part of the Qtopia Environment. | 4 | .=l. (C) 2002-2005 The Opie Team <opie-devel@handhelds.org> |
5 | ** | 5 | .>+-= |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | _;:, .> :=|. This program is free software; you can |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | .> <`_, > . <= redistribute it and/or modify it under |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
9 | ** packaging of this file. | 9 | .="- .-=="i, .._ License as published by the Free Software |
10 | ** | 10 | - . .-<_> .<> Foundation; version 2 of the License. |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ._= =} : |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | .%`+i> _;_. |
13 | ** | 13 | .i_,=:_. -<s. This program is distributed in the hope that |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
15 | ** | 15 | : .. .:, . . . without even the implied warranty of |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
17 | ** not clear to you. | 17 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
18 | ** | 18 | ..}^=.= = ; Library General Public License for more |
19 | **********************************************************************/ | 19 | ++= -. .` .: details. |
20 | 20 | : = ...= . :.=- | |
21 | -. .:....=;==+<; You should have received a copy of the GNU | ||
22 | -_. . . )=. = Library General Public License along with | ||
23 | -- :-=` this library; see the file COPYING.LIB. | ||
24 | If not, write to the Free Software Foundation, | ||
25 | Inc., 59 Temple Place - Suite 330, | ||
26 | Boston, MA 02111-1307, USA. | ||
27 | */ | ||
21 | #include "startmenu.h" | 28 | #include "startmenu.h" |
22 | #include "inputmethods.h" | 29 | #include "inputmethods.h" |
23 | #include "runningappbar.h" | 30 | #include "runningappbar.h" |
24 | #include "systray.h" | 31 | #include "systray.h" |
25 | #include "wait.h" | 32 | #include "wait.h" |
26 | #include "appicons.h" | 33 | #include "appicons.h" |
27 | 34 | ||
28 | #include "taskbar.h" | 35 | #include "taskbar.h" |
29 | #include "server.h" | 36 | #include "server.h" |
30 | 37 | ||
31 | /* OPIE */ | 38 | /* OPIE */ |
32 | #include <opie2/odebug.h> | 39 | #include <opie2/odebug.h> |
40 | #include <opie2/oresource.h> | ||
33 | #include <qtopia/config.h> | 41 | #include <qtopia/config.h> |
34 | #include <qtopia/qpeapplication.h> | 42 | #include <qtopia/qpeapplication.h> |
35 | #ifdef QWS | 43 | #ifdef QWS |
36 | #include <qtopia/qcopenvelope_qws.h> | 44 | #include <qtopia/qcopenvelope_qws.h> |
37 | #endif | 45 | #endif |
38 | #include <qtopia/global.h> | 46 | #include <qtopia/global.h> |
39 | using namespace Opie::Core; | 47 | using namespace Opie::Core; |
40 | 48 | ||
41 | /* QT */ | 49 | /* QT */ |
42 | #include <qlabel.h> | 50 | #include <qlabel.h> |
43 | #include <qlayout.h> | 51 | #include <qlayout.h> |
44 | #include <qtimer.h> | 52 | #include <qtimer.h> |
45 | #ifdef QWS | 53 | #ifdef QWS |
46 | #include <qwindowsystem_qws.h> | 54 | #include <qwindowsystem_qws.h> |
47 | #endif | 55 | #endif |
48 | #include <qwidgetstack.h> | 56 | #include <qwidgetstack.h> |
49 | 57 | ||
50 | #if defined( Q_WS_QWS ) | 58 | #if defined( Q_WS_QWS ) |
51 | #include <qwsdisplay_qws.h> | 59 | #include <qwsdisplay_qws.h> |
52 | #include <qgfx_qws.h> | 60 | #include <qgfx_qws.h> |
53 | #endif | 61 | #endif |
54 | 62 | ||
55 | 63 | ||
56 | static bool initNumLock() | 64 | static bool initNumLock() |
@@ -117,50 +125,50 @@ void SafeMode::action(int i) | |||
117 | } | 125 | } |
118 | 126 | ||
119 | QSize SafeMode::sizeHint() const | 127 | QSize SafeMode::sizeHint() const |
120 | { | 128 | { |
121 | QFontMetrics fm = fontMetrics(); | 129 | QFontMetrics fm = fontMetrics(); |
122 | 130 | ||
123 | return QSize( fm.width(message), fm.height() ); | 131 | return QSize( fm.width(message), fm.height() ); |
124 | } | 132 | } |
125 | 133 | ||
126 | void SafeMode::paintEvent( QPaintEvent* ) | 134 | void SafeMode::paintEvent( QPaintEvent* ) |
127 | { | 135 | { |
128 | QPainter p(this); | 136 | QPainter p(this); |
129 | p.drawText( rect(), AlignCenter, message ); | 137 | p.drawText( rect(), AlignCenter, message ); |
130 | } | 138 | } |
131 | 139 | ||
132 | //--------------------------------------------------------------------------- | 140 | //--------------------------------------------------------------------------- |
133 | 141 | ||
134 | class LockKeyState : public QWidget | 142 | class LockKeyState : public QWidget |
135 | { | 143 | { |
136 | public: | 144 | public: |
137 | LockKeyState( QWidget *parent ) : | 145 | LockKeyState( QWidget *parent ) : |
138 | QWidget(parent), | 146 | QWidget(parent), |
139 | nl(initNumLock()), cl(FALSE) | 147 | nl(initNumLock()), cl(FALSE) |
140 | { | 148 | { |
141 | nl_pm = Resource::loadPixmap("numlock"); | 149 | nl_pm = OResource::loadPixmap("numlock", OResource::NoScale); |
142 | cl_pm = Resource::loadPixmap("capslock"); | 150 | cl_pm = OResource::loadPixmap("capslock", OResource::NoScale); |
143 | } | 151 | } |
144 | QSize sizeHint() const | 152 | QSize sizeHint() const |
145 | { | 153 | { |
146 | return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); | 154 | return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); |
147 | } | 155 | } |
148 | void toggleNumLockState() | 156 | void toggleNumLockState() |
149 | { | 157 | { |
150 | nl = !nl; repaint(); | 158 | nl = !nl; repaint(); |
151 | } | 159 | } |
152 | void toggleCapsLockState() | 160 | void toggleCapsLockState() |
153 | { | 161 | { |
154 | cl = !cl; repaint(); | 162 | cl = !cl; repaint(); |
155 | } | 163 | } |
156 | void paintEvent( QPaintEvent * ) | 164 | void paintEvent( QPaintEvent * ) |
157 | { | 165 | { |
158 | int y = (height()-sizeHint().height())/2; | 166 | int y = (height()-sizeHint().height())/2; |
159 | QPainter p(this); | 167 | QPainter p(this); |
160 | if ( nl ) | 168 | if ( nl ) |
161 | p.drawPixmap(1,y,nl_pm); | 169 | p.drawPixmap(1,y,nl_pm); |
162 | if ( cl ) | 170 | if ( cl ) |
163 | p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); | 171 | p.drawPixmap(1,y+nl_pm.height()+1,cl_pm); |
164 | } | 172 | } |
165 | private: | 173 | private: |
166 | QPixmap nl_pm, cl_pm; | 174 | QPixmap nl_pm, cl_pm; |