author | harlekin <harlekin> | 2002-09-11 10:48:38 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-09-11 10:48:38 (UTC) |
commit | 8699473dd4e21242b1c98192c2dd38655177762b (patch) (unidiff) | |
tree | 2fe54c8c306eacbf91e8d06b602d332d092bff20 | |
parent | 6013fac8a6ea871453565faf0f8b51c62465cf71 (diff) | |
download | opie-8699473dd4e21242b1c98192c2dd38655177762b.zip opie-8699473dd4e21242b1c98192c2dd38655177762b.tar.gz opie-8699473dd4e21242b1c98192c2dd38655177762b.tar.bz2 |
looks now nice on liquid - again
-rw-r--r-- | core/launcher/runningappbar.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/core/launcher/runningappbar.cpp b/core/launcher/runningappbar.cpp index 298f671..b830d1b 100644 --- a/core/launcher/runningappbar.cpp +++ b/core/launcher/runningappbar.cpp | |||
@@ -19,48 +19,50 @@ | |||
19 | ********************************************************************** | 19 | ********************************************************************** |
20 | */ | 20 | */ |
21 | 21 | ||
22 | #define QTOPIA_INTERNAL_PRELOADACCESS | 22 | #define QTOPIA_INTERNAL_PRELOADACCESS |
23 | 23 | ||
24 | // For "kill" | 24 | // For "kill" |
25 | #include <sys/types.h> | 25 | #include <sys/types.h> |
26 | #include <signal.h> | 26 | #include <signal.h> |
27 | 27 | ||
28 | #include <qtimer.h> | 28 | #include <qtimer.h> |
29 | #include <qpopupmenu.h> | 29 | #include <qpopupmenu.h> |
30 | #include <qmessagebox.h> | 30 | #include <qmessagebox.h> |
31 | #include <qpainter.h> | 31 | #include <qpainter.h> |
32 | #include "qprocess.h" | 32 | #include "qprocess.h" |
33 | #include <qpe/qpeapplication.h> | 33 | #include <qpe/qpeapplication.h> |
34 | #include <qpe/applnk.h> | 34 | #include <qpe/applnk.h> |
35 | #include <qpe/qcopenvelope_qws.h> | 35 | #include <qpe/qcopenvelope_qws.h> |
36 | #include <qpe/global.h> | 36 | #include <qpe/global.h> |
37 | #include <qwindowsystem_qws.h> | 37 | #include <qwindowsystem_qws.h> |
38 | #include "runningappbar.h" | 38 | #include "runningappbar.h" |
39 | 39 | ||
40 | RunningAppBar::RunningAppBar(QWidget* parent) | 40 | RunningAppBar::RunningAppBar(QWidget* parent) |
41 | : QFrame(parent), m_AppLnkSet(0L), m_SelectedAppIndex(-1) | 41 | : QFrame(parent), m_AppLnkSet(0L), m_SelectedAppIndex(-1) |
42 | { | 42 | { |
43 | setBackgroundMode( PaletteBackground ); | ||
44 | |||
43 | m_AppLnkSet = new AppLnkSet( QPEApplication::qpeDir() + "apps" ); | 45 | m_AppLnkSet = new AppLnkSet( QPEApplication::qpeDir() + "apps" ); |
44 | 46 | ||
45 | connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&))); | 47 | connect(qwsServer, SIGNAL(newChannel(const QString&)), this, SLOT(newQcopChannel(const QString&))); |
46 | connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&))); | 48 | connect(qwsServer, SIGNAL(removedChannel(const QString&)), this, SLOT(removedQcopChannel(const QString&))); |
47 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); | 49 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); |
48 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 50 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
49 | this, SLOT(received(const QCString&, const QByteArray&)) ); | 51 | this, SLOT(received(const QCString&, const QByteArray&)) ); |
50 | 52 | ||
51 | spacing = AppLnk::smallIconSize()+3; | 53 | spacing = AppLnk::smallIconSize()+3; |
52 | } | 54 | } |
53 | 55 | ||
54 | RunningAppBar::~RunningAppBar() { | 56 | RunningAppBar::~RunningAppBar() { |
55 | } | 57 | } |
56 | 58 | ||
57 | void RunningAppBar::newQcopChannel(const QString& channelName) { | 59 | void RunningAppBar::newQcopChannel(const QString& channelName) { |
58 | QString prefix("QPE/Application/"); | 60 | QString prefix("QPE/Application/"); |
59 | if (channelName.startsWith(prefix)) { | 61 | if (channelName.startsWith(prefix)) { |
60 | QString appName = channelName.mid(prefix.length()); | 62 | QString appName = channelName.mid(prefix.length()); |
61 | // qDebug("App %s just connected!", appName.latin1()); | 63 | // qDebug("App %s just connected!", appName.latin1()); |
62 | const AppLnk* newGuy = m_AppLnkSet->findExec(appName); | 64 | const AppLnk* newGuy = m_AppLnkSet->findExec(appName); |
63 | if (newGuy && !newGuy->isPreloaded()) { | 65 | if (newGuy && !newGuy->isPreloaded()) { |
64 | addTask(*newGuy); | 66 | addTask(*newGuy); |
65 | } | 67 | } |
66 | } | 68 | } |
@@ -147,59 +149,59 @@ void RunningAppBar::mouseReleaseEvent(QMouseEvent *e) | |||
147 | QString channel = QString("QPE/Application/") + m_AppList.at(m_SelectedAppIndex)->exec(); | 149 | QString channel = QString("QPE/Application/") + m_AppList.at(m_SelectedAppIndex)->exec(); |
148 | if (QCopChannel::isRegistered(channel.latin1())) { | 150 | if (QCopChannel::isRegistered(channel.latin1())) { |
149 | // qDebug("%s is running!", m_AppList.at(m_SelectedAppIndex)->exec().latin1()); | 151 | // qDebug("%s is running!", m_AppList.at(m_SelectedAppIndex)->exec().latin1()); |
150 | QCopEnvelope e(channel.latin1(), "raise()"); | 152 | QCopEnvelope e(channel.latin1(), "raise()"); |
151 | // This class will delete itself after hearing from the app or the timer expiring | 153 | // This class will delete itself after hearing from the app or the timer expiring |
152 | (void)new AppMonitor(*m_AppList.at(m_SelectedAppIndex), *this); | 154 | (void)new AppMonitor(*m_AppList.at(m_SelectedAppIndex), *this); |
153 | } | 155 | } |
154 | else { | 156 | else { |
155 | removeTask(*m_AppList.at(m_SelectedAppIndex)); | 157 | removeTask(*m_AppList.at(m_SelectedAppIndex)); |
156 | } | 158 | } |
157 | 159 | ||
158 | m_SelectedAppIndex = -1; | 160 | m_SelectedAppIndex = -1; |
159 | update(); | 161 | update(); |
160 | } | 162 | } |
161 | } | 163 | } |
162 | 164 | ||
163 | void RunningAppBar::paintEvent( QPaintEvent * ) | 165 | void RunningAppBar::paintEvent( QPaintEvent * ) |
164 | { | 166 | { |
165 | QPainter p( this ); | 167 | QPainter p( this ); |
166 | AppLnk *curApp; | 168 | AppLnk *curApp; |
167 | int x = 0; | 169 | int x = 0; |
168 | int y = (height() - AppLnk::smallIconSize()) / 2; | 170 | int y = (height() - AppLnk::smallIconSize()) / 2; |
169 | int i = 0; | 171 | int i = 0; |
170 | 172 | ||
171 | p.fillRect( 0, 0, width(), height(), colorGroup().background() ); | 173 | //p.fillRect( 0, 0, width(), height(), colorGroup().background() ); |
172 | 174 | ||
173 | QListIterator<AppLnk> it(m_AppList); | 175 | QListIterator<AppLnk> it(m_AppList); |
174 | 176 | ||
175 | for (; it.current(); i++, ++it ) { | 177 | for (; it.current(); i++, ++it ) { |
176 | if ( x + spacing <= width() ) { | 178 | if ( x + spacing <= width() ) { |
177 | curApp = it.current(); | 179 | curApp = it.current(); |
178 | if ( (int)i == m_SelectedAppIndex ) | 180 | if ( (int)i == m_SelectedAppIndex ) |
179 | p.fillRect( x, y, spacing, curApp->pixmap().height()+1, colorGroup().highlight() ); | 181 | p.fillRect( x, y, spacing, curApp->pixmap().height()+1, colorGroup().highlight() ); |
180 | else | 182 | else |
181 | p.eraseRect( x, y, spacing, curApp->pixmap().height()+1 ); | 183 | // p.eraseRect( x, y, spacing, curApp->pixmap().height()+1 ); |
182 | p.drawPixmap( x, y, curApp->pixmap() ); | 184 | p.drawPixmap( x, y, curApp->pixmap() ); |
183 | x += spacing; | 185 | x += spacing; |
184 | } | 186 | } |
185 | } | 187 | } |
186 | } | 188 | } |
187 | 189 | ||
188 | QSize RunningAppBar::sizeHint() const | 190 | QSize RunningAppBar::sizeHint() const |
189 | { | 191 | { |
190 | return QSize( frameWidth(), AppLnk::smallIconSize()+frameWidth()*2+3 ); | 192 | return QSize( frameWidth(), AppLnk::smallIconSize()+frameWidth()*2+3 ); |
191 | } | 193 | } |
192 | 194 | ||
193 | const int AppMonitor::RAISE_TIMEOUT_MS = 500; | 195 | const int AppMonitor::RAISE_TIMEOUT_MS = 500; |
194 | 196 | ||
195 | AppMonitor::AppMonitor(const AppLnk& app, RunningAppBar& owner) | 197 | AppMonitor::AppMonitor(const AppLnk& app, RunningAppBar& owner) |
196 | : QObject(0L), m_Owner(owner), m_App(app), m_PsProc(0L), m_AppKillerBox(0L) { | 198 | : QObject(0L), m_Owner(owner), m_App(app), m_PsProc(0L), m_AppKillerBox(0L) { |
197 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); | 199 | QCopChannel* channel = new QCopChannel( "QPE/System", this ); |
198 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), | 200 | connect( channel, SIGNAL(received(const QCString&, const QByteArray&)), |
199 | this, SLOT(received(const QCString&, const QByteArray&)) ); | 201 | this, SLOT(received(const QCString&, const QByteArray&)) ); |
200 | connect(&m_Timer, SIGNAL(timeout()), this, SLOT(timerExpired())); | 202 | connect(&m_Timer, SIGNAL(timeout()), this, SLOT(timerExpired())); |
201 | m_Timer.start(RAISE_TIMEOUT_MS, TRUE); | 203 | m_Timer.start(RAISE_TIMEOUT_MS, TRUE); |
202 | } | 204 | } |
203 | 205 | ||
204 | AppMonitor::~AppMonitor() { | 206 | AppMonitor::~AppMonitor() { |
205 | if (m_AppKillerBox) { | 207 | if (m_AppKillerBox) { |