summaryrefslogtreecommitdiff
path: root/core/launcher/startmenu.cpp
Unidiff
Diffstat (limited to 'core/launcher/startmenu.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/startmenu.cpp79
1 files changed, 37 insertions, 42 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp
index ce7840e..24a9d7e 100644
--- a/core/launcher/startmenu.cpp
+++ b/core/launcher/startmenu.cpp
@@ -1,21 +1,28 @@
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// TODO. During startup 28// TODO. During startup
@@ -29,5 +36,7 @@
29 36
37/* OPIE */
38#include <opie2/oresource.h>
39using namespace Opie::Core;
30#include <qtopia/qpeapplication.h> 40#include <qtopia/qpeapplication.h>
31#include <qtopia/config.h> 41#include <qtopia/config.h>
32#include <qtopia/resource.h>
33#include <qtopia/mimetype.h> 42#include <qtopia/mimetype.h>
@@ -35,7 +44,2 @@
35 44
36//#include <qpainter.h>
37
38//#include <stdlib.h>
39
40
41#define APPLNK_ID_OFFSET 250 45#define APPLNK_ID_OFFSET 250
@@ -63,3 +67,3 @@ StartMenu::StartMenu(QWidget *parent) : QLabel( parent )
63 QPixmap pm; 67 QPixmap pm;
64 pm.convertFromImage(Resource::loadImage( startButtonPixmap).smoothScale( sz,sz) ); 68 pm.convertFromImage(OResource::loadImage( startButtonPixmap, OResource::NoScale ).smoothScale( sz,sz) );
65 setPixmap(pm); 69 setPixmap(pm);
@@ -147,9 +151,3 @@ void StartMenu::createAppEntry( QPopupMenu *menu, QDir dir, QString file )
147 } else { 151 } else {
148 QPixmap test; 152 QPixmap pixmap = OResource::loadPixmap( applnk->icon(), OResource::SmallIcon );
149 QImage img = Resource::loadImage( applnk->icon() );
150 if(!img.isNull() )
151 test.convertFromImage(
152 img.smoothScale(
153 AppLnk::smallIconSize(), AppLnk::smallIconSize() ), 0 );
154
155 // Insert items ordered lexically 153 // Insert items ordered lexically
@@ -163,4 +161,4 @@ void StartMenu::createAppEntry( QPopupMenu *menu, QDir dir, QString file )
163 } 161 }
164 162
165 menu->insertItem( test, applnk->name(), 163 menu->insertItem( pixmap, applnk->name(),
166 currentItem + APPLNK_ID_OFFSET, current ); 164 currentItem + APPLNK_ID_OFFSET, current );
@@ -196,6 +194,3 @@ void StartMenu::createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool l
196 194
197 QPixmap test; 195 QPixmap pixmap = OResource::loadPixmap( icon, OResource::SmallIcon );
198 test.convertFromImage( Resource::loadImage( icon ).smoothScale(
199 AppLnk::smallIconSize(), AppLnk::smallIconSize() ), 0 );
200
201 if ( useWidePopupMenu ) { 196 if ( useWidePopupMenu ) {
@@ -204,3 +199,3 @@ void StartMenu::createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool l
204 connect( submenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); 199 connect( submenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) );
205 menu->insertItem( test, name, submenu, NO_ID ); 200 menu->insertItem( pixmap, name, submenu, NO_ID );
206 201
@@ -210,3 +205,3 @@ void StartMenu::createDirEntry( QPopupMenu *menu, QDir dir, QString file, bool l
210 // no submenus - just bring corresponding tab to front 205 // no submenus - just bring corresponding tab to front
211 menu->insertItem( test, name, currentItem ); 206 menu->insertItem( pixmap, name, currentItem );
212 tabNames.insert( currentItem, new QString( file ) ); 207 tabNames.insert( currentItem, new QString( file ) );