author | drw <drw> | 2005-08-29 18:08:09 (UTC) |
---|---|---|
committer | drw <drw> | 2005-08-29 18:08:09 (UTC) |
commit | 9ff75dd54765230e0058264d0d4666d6d38f94c8 (patch) (side-by-side diff) | |
tree | c4afc83d7fda536b90dee36a9ca650750c4cecc2 | |
parent | 8456ec4039ffb824fc727d74b9473376b26ad530 (diff) | |
download | opie-9ff75dd54765230e0058264d0d4666d6d38f94c8.zip opie-9ff75dd54765230e0058264d0d4666d6d38f94c8.tar.gz opie-9ff75dd54765230e0058264d0d4666d6d38f94c8.tar.bz2 |
Scale icons in contact table listing and in configure dialog
-rw-r--r-- | core/pim/addressbook/abtable.cpp | 31 | ||||
-rw-r--r-- | core/pim/addressbook/configdlg.cpp | 9 |
2 files changed, 24 insertions, 16 deletions
diff --git a/core/pim/addressbook/abtable.cpp b/core/pim/addressbook/abtable.cpp index 539d6ba..52aff36 100644 --- a/core/pim/addressbook/abtable.cpp +++ b/core/pim/addressbook/abtable.cpp @@ -603,43 +603,47 @@ void AbTable::paintCell(QPainter* p, int row, int col, const QRect& cr, bool ) void AbTable::rowHeightChanged( int row ) { if ( enablePainting ) QTable::rowHeightChanged( row ); } ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* row */ ) { - ContactItem item; + int iconsize = fontMetrics().height(); + QImage icon; + ContactItem item; item.value = ""; for ( QValueList<int>::ConstIterator it = intFields.begin(); it != intFields.end(); ++it ) { + icon.reset(); + switch ( *it ) { default: break; case Qtopia::Title: item.value = entry.title(); break; case Qtopia::Suffix: item.value = entry.suffix(); break; case Qtopia::FileAs: item.value = entry.fileAs(); break; case Qtopia::DefaultEmail: item.value = entry.defaultEmail(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); break; case Qtopia::Emails: item.value = entry.emails(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/email" ); break; case Qtopia::HomeStreet: item.value = entry.homeStreet(); break; case Qtopia::HomeCity: item.value = entry.homeCity(); break; case Qtopia::HomeState: @@ -649,32 +653,32 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* item.value = entry.homeZip(); break; case Qtopia::HomeCountry: item.value = entry.homeCountry(); break; case Qtopia::HomePhone: item.value = entry.homePhone(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/phonehome" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/phonehome" ); break; case Qtopia::HomeFax: item.value = entry.homeFax(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/faxhome" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/faxhome" ); break; case Qtopia::HomeMobile: item.value = entry.homeMobile(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilehome" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilehome" ); break; case Qtopia::HomeWebPage: item.value = entry.homeWebpage(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagehome" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagehome" ); break; case Qtopia::Company: item.value = entry.company(); break; case Qtopia::BusinessCity: item.value = entry.businessCity(); break; case Qtopia::BusinessStreet: @@ -684,41 +688,41 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* item.value = entry.businessZip(); break; case Qtopia::BusinessCountry: item.value = entry.businessCountry(); break; case Qtopia::BusinessWebPage: item.value = entry.businessWebpage(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagework" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/webpagework" ); break; case Qtopia::JobTitle: item.value = entry.jobTitle(); break; case Qtopia::Department: item.value = entry.department(); break; case Qtopia::Office: item.value = entry.office(); break; case Qtopia::BusinessPhone: item.value = entry.businessPhone(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/phonework" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/phonework" ); break; case Qtopia::BusinessFax: item.value = entry.businessFax(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/faxwork" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/faxwork" ); break; case Qtopia::BusinessMobile: item.value = entry.businessMobile(); if ( !item.value.isEmpty() ) - item.icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilework" ); + icon = Opie::Core::OResource::loadPixmap( "addressbook/mobilework" ); break; case Qtopia::BusinessPager: item.value = entry.businessPager(); break; case Qtopia::Profession: item.value = entry.profession(); break; case Qtopia::Assistant: @@ -748,13 +752,18 @@ ContactItem AbTable::findContactContact( const Opie::OPimContact &entry, int /* break; case Qtopia::Children: item.value = entry.children(); break; case Qtopia::Notes: item.value = entry.notes(); break; } + + if ( !icon.isNull() ) { + item.icon = icon.smoothScale( iconsize, iconsize ); + } + if ( !item.value.isEmpty() ) break; } return item; } diff --git a/core/pim/addressbook/configdlg.cpp b/core/pim/addressbook/configdlg.cpp index a491fc7..648ad52 100644 --- a/core/pim/addressbook/configdlg.cpp +++ b/core/pim/addressbook/configdlg.cpp @@ -19,21 +19,20 @@ ConfigDlg::ConfigDlg( QWidget *parent, const char *name): for (uint i=0; i < contFields.count(); i++) { allFieldListBox->insertItem( contFields[i] ); } // Reset Widget Flags: This was not changeable by designer :( setWFlags ( WStyle_ContextHelp ); // Set Pics to Buttons and Tabs - m_upButton->setIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "addressbook/up" ) ) ); - m_downButton->setIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "addressbook/down" ) ) ); - m_addButton->setIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "addressbook/add" ) ) ); - m_removeButton->setIconSet( QIconSet( Opie::Core::OResource::loadPixmap( "addressbook/sub" ) ) ); - + m_upButton->setPixmap( Opie::Core::OResource::loadPixmap( "up", Opie::Core::OResource::SmallIcon ) ); + m_downButton->setPixmap( Opie::Core::OResource::loadPixmap( "down", Opie::Core::OResource::SmallIcon ) ); + m_addButton->setPixmap( Opie::Core::OResource::loadPixmap( "addressbook/add", Opie::Core::OResource::SmallIcon ) ); + m_removeButton->setPixmap( Opie::Core::OResource::loadPixmap( "addressbook/sub", Opie::Core::OResource::SmallIcon ) ); // Get the translation maps between Field ID and translated strings m_mapStrToID = Opie::OPimContactFields::trFieldsToId(); m_mapIDToStr = Opie::OPimContactFields::idToTrFields(); connect ( m_addButton, SIGNAL( clicked() ), this, SLOT( slotItemAdd() ) ); connect ( m_removeButton, SIGNAL( clicked() ), this, SLOT( slotItemRemove() ) ); connect ( m_upButton, SIGNAL( clicked() ), this, SLOT( slotItemUp() ) ); |