author | drw <drw> | 2005-03-21 16:53:48 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-21 16:53:48 (UTC) |
commit | 958b13474d09d8cdf1f018abc1f48f80d24bf22f (patch) (unidiff) | |
tree | 21e8ff75ad792124b407d7dda543bc4349254dc9 | |
parent | be3e262e107a8592a478f7c4114d2a54395885a5 (diff) | |
download | opie-958b13474d09d8cdf1f018abc1f48f80d24bf22f.zip opie-958b13474d09d8cdf1f018abc1f48f80d24bf22f.tar.gz opie-958b13474d09d8cdf1f018abc1f48f80d24bf22f.tar.bz2 |
Fix for bug #1613 - scale toolbar icons
-rw-r--r-- | noncore/apps/advancedfm/advancedfmData.cpp | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/noncore/apps/advancedfm/advancedfmData.cpp b/noncore/apps/advancedfm/advancedfmData.cpp index 3664c75..b43d2ba 100644 --- a/noncore/apps/advancedfm/advancedfmData.cpp +++ b/noncore/apps/advancedfm/advancedfmData.cpp | |||
@@ -1,31 +1,32 @@ | |||
1 | /*************************************************************************** | 1 | /*************************************************************************** |
2 | advancedfmData.cpp | 2 | advancedfmData.cpp |
3 | ------------------- | 3 | ------------------- |
4 | ** Created: Mon 09-23-2002 13:24:11 | 4 | ** Created: Mon 09-23-2002 13:24:11 |
5 | copyright : (C) 2002 by ljp | 5 | copyright : (C) 2002 by ljp |
6 | email : ljp@llornkcor.com | 6 | email : ljp@llornkcor.com |
7 | * This program is free software; you can redistribute it and/or modify * | 7 | * This program is free software; you can redistribute it and/or modify * |
8 | * it under the terms of the GNU General Public License as published by * | 8 | * it under the terms of the GNU General Public License as published by * |
9 | * the Free Software Foundation; either version 2 of the License, or * | 9 | * the Free Software Foundation; either version 2 of the License, or * |
10 | * (at your option) any later version. * | 10 | * (at your option) any later version. * |
11 | ***************************************************************************/ | 11 | ***************************************************************************/ |
12 | #include "advancedfm.h" | 12 | #include "advancedfm.h" |
13 | 13 | ||
14 | /* OPIE */ | 14 | /* OPIE */ |
15 | #include <opie2/odebug.h> | 15 | #include <opie2/odebug.h> |
16 | #include <qpe/applnk.h> | ||
16 | #include <qpe/storage.h> | 17 | #include <qpe/storage.h> |
17 | #include <qpe/qpeapplication.h> | 18 | #include <qpe/qpeapplication.h> |
18 | #include <qpe/resource.h> | 19 | #include <qpe/resource.h> |
19 | #include <qpe/menubutton.h> | 20 | #include <qpe/menubutton.h> |
20 | using namespace Opie::Core; | 21 | using namespace Opie::Core; |
21 | using namespace Opie::Ui; | 22 | using namespace Opie::Ui; |
22 | 23 | ||
23 | /* QT */ | 24 | /* QT */ |
24 | #include <qlayout.h> | 25 | #include <qlayout.h> |
25 | #include <qhbox.h> | 26 | #include <qhbox.h> |
26 | #include <qmenubar.h> | 27 | #include <qmenubar.h> |
27 | #include <qcombobox.h> | 28 | #include <qcombobox.h> |
28 | #include <qtoolbutton.h> | 29 | #include <qtoolbutton.h> |
29 | #include <qlineedit.h> | 30 | #include <qlineedit.h> |
30 | #include <qlistview.h> | 31 | #include <qlistview.h> |
31 | 32 | ||
@@ -38,59 +39,66 @@ void AdvancedFm::init() { | |||
38 | 39 | ||
39 | QVBoxLayout *layout = new QVBoxLayout( this ); | 40 | QVBoxLayout *layout = new QVBoxLayout( this ); |
40 | layout->setSpacing( 2); | 41 | layout->setSpacing( 2); |
41 | layout->setMargin( 0); // squeeze | 42 | layout->setMargin( 0); // squeeze |
42 | 43 | ||
43 | QMenuBar *menuBar = new QMenuBar(this); | 44 | QMenuBar *menuBar = new QMenuBar(this); |
44 | menuBar->setMargin( 0 ); // squeeze | 45 | menuBar->setMargin( 0 ); // squeeze |
45 | fileMenu = new QPopupMenu( this ); | 46 | fileMenu = new QPopupMenu( this ); |
46 | viewMenu = new QPopupMenu( this ); | 47 | viewMenu = new QPopupMenu( this ); |
47 | // customDirMenu = new QPopupMenu( this ); | 48 | // customDirMenu = new QPopupMenu( this ); |
48 | 49 | ||
49 | layout->addWidget( menuBar ); | 50 | layout->addWidget( menuBar ); |
50 | 51 | ||
51 | menuBar->insertItem( tr( "File" ), fileMenu); | 52 | menuBar->insertItem( tr( "File" ), fileMenu); |
52 | menuBar->insertItem( tr( "View" ), viewMenu); | 53 | menuBar->insertItem( tr( "View" ), viewMenu); |
53 | 54 | ||
55 | QPixmap pm; | ||
54 | cdUpButton = new QToolButton( 0,"cdUpButton"); | 56 | cdUpButton = new QToolButton( 0,"cdUpButton"); |
55 | cdUpButton->setPixmap(Resource::loadPixmap("up")); | 57 | pm.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
58 | cdUpButton->setPixmap( pm ); | ||
56 | cdUpButton->setAutoRaise( true ); | 59 | cdUpButton->setAutoRaise( true ); |
57 | menuBar->insertItem( cdUpButton ); | 60 | menuBar->insertItem( cdUpButton ); |
58 | 61 | ||
59 | qpeDirButton= new QToolButton( 0,"QPEButton"); | 62 | qpeDirButton= new QToolButton( 0,"QPEButton"); |
60 | qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); | 63 | pm.convertFromImage( Resource::loadImage( "logo/opielogo" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
64 | qpeDirButton->setPixmap( pm );//,"",this,"QPEButton"); | ||
61 | qpeDirButton->setAutoRaise( true ); | 65 | qpeDirButton->setAutoRaise( true ); |
62 | menuBar->insertItem( qpeDirButton ); | 66 | menuBar->insertItem( qpeDirButton ); |
63 | 67 | ||
64 | cfButton = new QToolButton( 0, "CFButton"); | 68 | cfButton = new QToolButton( 0, "CFButton"); |
65 | cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); | 69 | pm.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
70 | cfButton->setPixmap( pm ); | ||
66 | cfButton->setAutoRaise( true ); | 71 | cfButton->setAutoRaise( true ); |
67 | menuBar->insertItem( cfButton ); | 72 | menuBar->insertItem( cfButton ); |
68 | 73 | ||
69 | sdButton = new QToolButton( 0, "SDButton"); | 74 | sdButton = new QToolButton( 0, "SDButton"); |
70 | sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); | 75 | pm.convertFromImage( Resource::loadImage( "advancedfm/sdcard" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
76 | sdButton->setPixmap( pm ); | ||
71 | sdButton->setAutoRaise( true ); | 77 | sdButton->setAutoRaise( true ); |
72 | menuBar->insertItem( sdButton ); | 78 | menuBar->insertItem( sdButton ); |
73 | 79 | ||
74 | docButton = new QToolButton( 0,"docsButton"); | 80 | docButton = new QToolButton( 0,"docsButton"); |
75 | docButton->setPixmap(Resource::loadPixmap("DocsIcon")); | 81 | pm.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
82 | docButton->setPixmap( pm ); | ||
76 | docButton->setAutoRaise( true ); | 83 | docButton->setAutoRaise( true ); |
77 | menuBar->insertItem( docButton ); | 84 | menuBar->insertItem( docButton ); |
78 | 85 | ||
79 | homeButton = new QToolButton( 0, "homeButton"); | 86 | homeButton = new QToolButton( 0, "homeButton"); |
80 | homeButton->setPixmap(Resource::loadPixmap("home")); | 87 | pm.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
88 | homeButton->setPixmap( pm ); | ||
81 | homeButton->setAutoRaise( true ); | 89 | homeButton->setAutoRaise( true ); |
82 | menuBar->insertItem( homeButton ); | 90 | menuBar->insertItem( homeButton ); |
83 | 91 | ||
84 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); | 92 | fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); |
85 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); | 93 | fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); |
86 | fileMenu->insertSeparator(); | 94 | fileMenu->insertSeparator(); |
87 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); | 95 | fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); |
88 | fileMenu->insertSeparator(); | 96 | fileMenu->insertSeparator(); |
89 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); | 97 | fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); |
90 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); | 98 | fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); |
91 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); | 99 | fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); |
92 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); | 100 | fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); |
93 | fileMenu->insertSeparator(); | 101 | fileMenu->insertSeparator(); |
94 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); | 102 | fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); |
95 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); | 103 | fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); |
96 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); | 104 | fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); |