author | drw <drw> | 2005-03-21 16:53:48 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-21 16:53:48 (UTC) |
commit | 958b13474d09d8cdf1f018abc1f48f80d24bf22f (patch) (side-by-side diff) | |
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,128 +1,136 @@ /*************************************************************************** advancedfmData.cpp ------------------- ** Created: Mon 09-23-2002 13:24:11 copyright : (C) 2002 by ljp email : ljp@llornkcor.com * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * ***************************************************************************/ #include "advancedfm.h" /* OPIE */ #include <opie2/odebug.h> +#include <qpe/applnk.h> #include <qpe/storage.h> #include <qpe/qpeapplication.h> #include <qpe/resource.h> #include <qpe/menubutton.h> using namespace Opie::Core; using namespace Opie::Ui; /* QT */ #include <qlayout.h> #include <qhbox.h> #include <qmenubar.h> #include <qcombobox.h> #include <qtoolbutton.h> #include <qlineedit.h> #include <qlistview.h> /* STD */ #include <sys/utsname.h> void AdvancedFm::init() { b = false; setCaption( tr( "AdvancedFm" ) ); QVBoxLayout *layout = new QVBoxLayout( this ); layout->setSpacing( 2); layout->setMargin( 0); // squeeze QMenuBar *menuBar = new QMenuBar(this); menuBar->setMargin( 0 ); // squeeze fileMenu = new QPopupMenu( this ); viewMenu = new QPopupMenu( this ); // customDirMenu = new QPopupMenu( this ); layout->addWidget( menuBar ); menuBar->insertItem( tr( "File" ), fileMenu); menuBar->insertItem( tr( "View" ), viewMenu); + QPixmap pm; cdUpButton = new QToolButton( 0,"cdUpButton"); - cdUpButton->setPixmap(Resource::loadPixmap("up")); + pm.convertFromImage( Resource::loadImage( "up" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + cdUpButton->setPixmap( pm ); cdUpButton->setAutoRaise( true ); menuBar->insertItem( cdUpButton ); qpeDirButton= new QToolButton( 0,"QPEButton"); - qpeDirButton->setPixmap( Resource::loadPixmap("launcher/opielogo16x16"));//,"",this,"QPEButton"); + pm.convertFromImage( Resource::loadImage( "logo/opielogo" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + qpeDirButton->setPixmap( pm );//,"",this,"QPEButton"); qpeDirButton->setAutoRaise( true ); menuBar->insertItem( qpeDirButton ); cfButton = new QToolButton( 0, "CFButton"); - cfButton->setPixmap(Resource::loadPixmap("cardmon/pcmcia")); + pm.convertFromImage( Resource::loadImage( "cardmon/pcmcia" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + cfButton->setPixmap( pm ); cfButton->setAutoRaise( true ); menuBar->insertItem( cfButton ); sdButton = new QToolButton( 0, "SDButton"); - sdButton->setPixmap(Resource::loadPixmap("advancedfm/sdcard")); + pm.convertFromImage( Resource::loadImage( "advancedfm/sdcard" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + sdButton->setPixmap( pm ); sdButton->setAutoRaise( true ); menuBar->insertItem( sdButton ); docButton = new QToolButton( 0,"docsButton"); - docButton->setPixmap(Resource::loadPixmap("DocsIcon")); + pm.convertFromImage( Resource::loadImage( "DocsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + docButton->setPixmap( pm ); docButton->setAutoRaise( true ); menuBar->insertItem( docButton ); homeButton = new QToolButton( 0, "homeButton"); - homeButton->setPixmap(Resource::loadPixmap("home")); + pm.convertFromImage( Resource::loadImage( "home" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + homeButton->setPixmap( pm ); homeButton->setAutoRaise( true ); menuBar->insertItem( homeButton ); fileMenu->insertItem( tr( "Show Hidden Files" ), this, SLOT( showMenuHidden() )); fileMenu->setItemChecked( fileMenu->idAt(0),TRUE); fileMenu->insertSeparator(); fileMenu->insertItem( tr( "File Search" ), this, SLOT( openSearch() )); fileMenu->insertSeparator(); fileMenu->insertItem( tr( "Make Directory" ), this, SLOT( mkDir() )); fileMenu->insertItem( tr( "Rename" ), this, SLOT( rn() )); fileMenu->insertItem( tr( "Run Command" ), this, SLOT( runCommandStd() )); fileMenu->insertItem( tr( "Run Command with Output" ), this, SLOT( runCommand() )); fileMenu->insertSeparator(); fileMenu->insertItem( tr( "Make Symlink" ), this, SLOT( mkSym() )); fileMenu->insertItem( tr( "Select All" ), this, SLOT( selectAll() )); fileMenu->insertItem( tr( "Add To Documents" ), this, SLOT( addToDocs() )); fileMenu->insertItem( tr( "Delete" ), this, SLOT( del() )); fileMenu->setCheckable(TRUE); viewMenu->insertItem( tr( "Switch to View 1" ), this, SLOT( switchToLocalTab())); viewMenu->insertItem( tr( "Switch to View 2" ), this, SLOT( switchToRemoteTab())); viewMenu->insertItem( tr( "Refresh" ), this, SLOT( refreshCurrentTab())); // viewMenu->insertSeparator(); // viewMenu->insertItem( tr( "About" ), this, SLOT( doAbout() )); viewMenu->setCheckable(true); viewMenu->setItemChecked( viewMenu->idAt(0), true); viewMenu->setItemChecked( viewMenu->idAt(1), false); s_addBookmark = tr("Bookmark Directory"); s_removeBookmark = tr("Remove Current Directory from Bookmarks"); // menuButton->insertItem(""); // customDirMenu->insertItem(tr("Add This Directory")); // customDirMenu->insertItem(tr("Remove This Directory")); // customDirMenu->insertSeparator(); QHBoxLayout *CBHB = new QHBoxLayout(); // parent layout will be set later CBHB->setMargin( 0 ); CBHB->setSpacing( 1 ); menuButton = new MenuButton( this ); menuButton->setUseLabel(false); menuButton->setMaximumWidth( 20 ); menuButton->insertItem( s_addBookmark); menuButton->insertItem( s_removeBookmark); menuButton->insertSeparator(); |