author | drw <drw> | 2005-03-03 19:15:30 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-03 19:15:30 (UTC) |
commit | 9c55e475ed3170488dd37ce8f36fa909397997bb (patch) (side-by-side diff) | |
tree | f1fad490bc0d56059f8c26cfdf9002a831158a7c | |
parent | adb8960dfcdb18b698f313fc7e7d40209c65b01a (diff) | |
download | opie-9c55e475ed3170488dd37ce8f36fa909397997bb.zip opie-9c55e475ed3170488dd37ce8f36fa909397997bb.tar.gz opie-9c55e475ed3170488dd37ce8f36fa909397997bb.tar.bz2 |
Scale icons appropriately
-rw-r--r-- | noncore/settings/packagemanager/installdlg.cpp | 34 | ||||
-rw-r--r-- | noncore/settings/packagemanager/oipkgconfigdlg.cpp | 24 |
2 files changed, 39 insertions, 19 deletions
diff --git a/noncore/settings/packagemanager/installdlg.cpp b/noncore/settings/packagemanager/installdlg.cpp index 7dea591..36851b0 100644 --- a/noncore/settings/packagemanager/installdlg.cpp +++ b/noncore/settings/packagemanager/installdlg.cpp @@ -66,7 +66,7 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap m_command[ m_numCommands ] = command1; m_packages[ m_numCommands ] = packages1; ++m_numCommands; - + if ( command1 == OPackage::Install ) m_installFound = true; } @@ -75,7 +75,7 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap m_command[ m_numCommands ] = command2; m_packages[ m_numCommands ] = packages2; ++m_numCommands; - + if ( command2 == OPackage::Install ) m_installFound = true; } @@ -84,7 +84,7 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap m_command[ m_numCommands ] = command3; m_packages[ m_numCommands ] = packages3; ++m_numCommands; - + if ( command3 == OPackage::Install ) m_installFound = true; } @@ -129,11 +129,14 @@ InstallDlg::InstallDlg( QWidget *parent, OPackageManager *pm, const QString &cap groupBoxLayout->addWidget( m_output ); layout->addMultiCellWidget( groupBox, 2, 2, 0, 1 ); - m_btnStart = new QPushButton( Resource::loadPixmap( "packagemanager/apply" ), tr( "Start" ), this ); + QPixmap pic; + pic.convertFromImage( Resource::loadImage( "packagemanager/apply" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_btnStart = new QPushButton( pic, tr( "Start" ), this ); layout->addWidget( m_btnStart, 3, 0 ); connect( m_btnStart, SIGNAL(clicked()), this, SLOT(slotBtnStart()) ); - m_btnOptions = new QPushButton( Resource::loadPixmap( "SettingsIcon" ), tr( "Options" ), this ); + pic.convertFromImage( Resource::loadImage( "SettingsIcon" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_btnOptions = new QPushButton( pic, tr( "Options" ), this ); layout->addWidget( m_btnOptions, 3, 1 ); connect( m_btnOptions, SIGNAL( clicked() ), this, SLOT(slotBtnOptions()) ); @@ -217,7 +220,9 @@ void InstallDlg::slotBtnStart() // Allow user to close dialog m_btnStart->setText( tr( "Close" ) ); - m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); + QPixmap pic; + pic.convertFromImage( Resource::loadImage( "enter" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_btnStart->setIconSet( pic ); return; } else if ( btnText == tr( "Close" ) ) @@ -234,12 +239,14 @@ void InstallDlg::slotBtnStart() dest = m_destination->currentText(); m_destination->setEnabled( false ); } - + m_btnOptions->setEnabled( false ); if ( m_numCommands > 1 ) { m_btnStart->setText( tr( "Abort" ) ); - m_btnStart->setIconSet( Resource::loadPixmap( "close" ) ); + QPixmap pic; + pic.convertFromImage( Resource::loadImage( "close" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_btnStart->setIconSet( pic ); } else { @@ -252,15 +259,18 @@ void InstallDlg::slotBtnStart() m_packman->executeCommand( m_command[ m_currCommand ], m_packages[ m_currCommand ], dest, this, SLOT(slotOutput(const QString &)), true ); } - + // All commands executed, allow user to close dialog m_btnStart->setEnabled( true ); m_btnStart->setText( tr( "Close" ) ); - m_btnStart->setIconSet( Resource::loadPixmap( "enter" ) ); + QPixmap pic; + pic.convertFromImage( Resource::loadImage( "enter" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_btnStart->setIconSet( pic ); m_btnOptions->setEnabled( true ); m_btnOptions->setText( tr( "Save output" ) ); - m_btnOptions->setIconSet( Resource::loadPixmap( "save" ) ); + pic.convertFromImage( Resource::loadImage( "save" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_btnOptions->setIconSet( pic ); } void InstallDlg::slotBtnOptions() @@ -305,7 +315,7 @@ void InstallDlg::slotOutput( const QString &msg ) lineStr.truncate( lineStr.length() - 1 ); m_output->append( lineStr ); m_output->setCursorPosition( m_output->numLines(), 0 ); - + // Update available space slotDisplayAvailSpace( QString::null ); } diff --git a/noncore/settings/packagemanager/oipkgconfigdlg.cpp b/noncore/settings/packagemanager/oipkgconfigdlg.cpp index 7ee2d74..5f60990 100644 --- a/noncore/settings/packagemanager/oipkgconfigdlg.cpp +++ b/noncore/settings/packagemanager/oipkgconfigdlg.cpp @@ -180,18 +180,22 @@ void OIpkgConfigDlg::initServerWidget() connect( m_serverList, SIGNAL(highlighted(int)), this, SLOT(slotServerSelected(int)) ); layout->addMultiCellWidget( m_serverList, 0, 0, 0, 2 ); - QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); + QPixmap pic; + pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + QPushButton *btn = new QPushButton( pic, tr( "New" ), container ); QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); connect( btn, SIGNAL(clicked()), this, SLOT(slotServerNew()) ); layout->addWidget( btn, 1, 0 ); - m_serverEditBtn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), container ); + pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_serverEditBtn = new QPushButton( pic, tr( "Edit" ), container ); m_serverEditBtn->setEnabled( false ); QWhatsThis::add( m_serverEditBtn, tr( "Tap here to edit the entry selected above." ) ); connect( m_serverEditBtn, SIGNAL(clicked()), this, SLOT(slotServerEdit()) ); layout->addWidget( m_serverEditBtn, 1, 1 ); - m_serverDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); + pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_serverDeleteBtn = new QPushButton( pic, tr( "Delete" ), container ); m_serverDeleteBtn->setEnabled( false ); QWhatsThis::add( m_serverDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); connect( m_serverDeleteBtn, SIGNAL(clicked()), this, SLOT(slotServerDelete()) ); @@ -218,18 +222,22 @@ void OIpkgConfigDlg::initDestinationWidget() connect( m_destList, SIGNAL(highlighted(int)), this, SLOT(slotDestSelected(int)) ); layout->addMultiCellWidget( m_destList, 0, 0, 0, 2 ); - QPushButton *btn = new QPushButton( Resource::loadPixmap( "new" ), tr( "New" ), container ); + QPixmap pic; + pic.convertFromImage( Resource::loadImage( "new" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + QPushButton *btn = new QPushButton( pic, tr( "New" ), container ); QWhatsThis::add( btn, tr( "Tap here to create a new entry. Fill in the fields below and then tap on Update." ) ); connect( btn, SIGNAL(clicked()), this, SLOT(slotDestNew()) ); layout->addWidget( btn, 1, 0 ); - m_destEditBtn = new QPushButton( Resource::loadPixmap( "edit" ), tr( "Edit" ), container ); + pic.convertFromImage( Resource::loadImage( "edit" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_destEditBtn = new QPushButton( pic, tr( "Edit" ), container ); m_destEditBtn->setEnabled( false ); QWhatsThis::add( m_destEditBtn, tr( "Tap here to edit the entry selected above." ) ); connect( m_destEditBtn, SIGNAL(clicked()), this, SLOT(slotDestEdit()) ); layout->addWidget( m_destEditBtn, 1, 1 ); - m_destDeleteBtn = new QPushButton( Resource::loadPixmap( "trash" ), tr( "Delete" ), container ); + pic.convertFromImage( Resource::loadImage( "trash" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + m_destDeleteBtn = new QPushButton( pic, tr( "Delete" ), container ); m_destDeleteBtn->setEnabled( false ); QWhatsThis::add( m_destDeleteBtn, tr( "Tap here to delete the entry selected above." ) ); connect( m_destDeleteBtn, SIGNAL(clicked()), this, SLOT(slotDestDelete()) ); @@ -341,7 +349,9 @@ void OIpkgConfigDlg::initOptionsWidget() m_optSourceLists = new QLineEdit( container ); QWhatsThis::add( m_optSourceLists, tr( "Enter the directory where package source feed information is stored." ) ); layout->addWidget( m_optSourceLists, 7, 0 ); - QPushButton *btn = new QPushButton( Resource::loadPixmap( "folder" ), QString::null, container ); + QPixmap pic; + pic.convertFromImage( Resource::loadImage( "folder" ).smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); + QPushButton *btn = new QPushButton( pic, QString::null, container ); btn->setMaximumWidth( btn->height() ); QWhatsThis::add( btn, tr( "Tap here to select the directory where package source feed information is stored." ) ); connect( btn, SIGNAL(clicked()), this, SLOT(slotOptSelectSourceListsPath()) ); |