author | drw <drw> | 2005-03-03 20:10:24 (UTC) |
---|---|---|
committer | drw <drw> | 2005-03-03 20:10:24 (UTC) |
commit | 6c3a7220a587fbd5bee75d7b6c7376339286e25d (patch) (unidiff) | |
tree | a304d17109586dbf1588e393824dbf907fff6ff5 | |
parent | 9c55e475ed3170488dd37ce8f36fa909397997bb (diff) | |
download | opie-6c3a7220a587fbd5bee75d7b6c7376339286e25d.zip opie-6c3a7220a587fbd5bee75d7b6c7376339286e25d.tar.gz opie-6c3a7220a587fbd5bee75d7b6c7376339286e25d.tar.bz2 |
Scale icons appropriately
-rw-r--r-- | core/settings/button/buttonsettings.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/core/settings/button/buttonsettings.cpp b/core/settings/button/buttonsettings.cpp index d286369..779f6ef 100644 --- a/core/settings/button/buttonsettings.cpp +++ b/core/settings/button/buttonsettings.cpp | |||
@@ -20,23 +20,24 @@ | |||
20 | -. .:....=;==+<; General Public License along with this file; | 20 | -. .:....=;==+<; General Public License along with this file; |
21 | -_. . . )=. = see the file COPYING. If not, write to the | 21 | -_. . . )=. = see the file COPYING. If not, write to the |
22 | -- :-=` Free Software Foundation, Inc., | 22 | -- :-=` Free Software Foundation, Inc., |
23 | 59 Temple Place - Suite 330, | 23 | 59 Temple Place - Suite 330, |
24 | Boston, MA 02111-1307, USA. | 24 | Boston, MA 02111-1307, USA. |
25 | 25 | ||
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <opie2/odevice.h> | ||
29 | |||
30 | #include <qpe/applnk.h> | ||
31 | |||
28 | #include <qlayout.h> | 32 | #include <qlayout.h> |
29 | #include <qlabel.h> | 33 | #include <qlabel.h> |
30 | #include <qtimer.h> | 34 | #include <qtimer.h> |
31 | 35 | ||
32 | |||
33 | #include <opie2/odevice.h> | ||
34 | |||
35 | #include "buttonsettings.h" | 36 | #include "buttonsettings.h" |
36 | #include "buttonutils.h" | 37 | #include "buttonutils.h" |
37 | #include "remapdlg.h" | 38 | #include "remapdlg.h" |
38 | 39 | ||
39 | using namespace Opie::Core; | 40 | using namespace Opie::Core; |
40 | 41 | ||
41 | struct buttoninfo { | 42 | struct buttoninfo { |
42 | const ODeviceButton *m_button; | 43 | const ODeviceButton *m_button; |
@@ -148,22 +149,25 @@ ButtonSettings::~ButtonSettings ( ) | |||
148 | QPEApplication::ungrabKeyboard ( ); | 149 | QPEApplication::ungrabKeyboard ( ); |
149 | } | 150 | } |
150 | 151 | ||
151 | void ButtonSettings::updateLabels ( ) | 152 | void ButtonSettings::updateLabels ( ) |
152 | { | 153 | { |
153 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 154 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
154 | qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); | 155 | qCopInfo cip = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_pmsg ); |
155 | 156 | ||
156 | (*it)-> m_picon-> setPixmap ( cip. m_icon ); | 157 | QPixmap pic; |
158 | pic.convertFromImage( cip.m_icon.convertToImage().smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); | ||
159 | (*it)-> m_picon-> setPixmap ( pic ); | ||
157 | (*it)-> m_plabel-> setText ( cip. m_name ); | 160 | (*it)-> m_plabel-> setText ( cip. m_name ); |
158 | 161 | ||
159 | qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); | 162 | qCopInfo cih = ButtonUtils::inst ( )-> messageToInfo ((*it)-> m_hmsg ); |
160 | 163 | ||
161 | (*it)-> m_hicon-> setPixmap ( cih. m_icon ); | 164 | pic.convertFromImage( cih.m_icon.convertToImage().smoothScale( AppLnk::smallIconSize(), AppLnk::smallIconSize() ) ); |
165 | (*it)-> m_hicon-> setPixmap ( pic ); | ||
162 | (*it)-> m_hlabel-> setText ( cih. m_name ); | 166 | (*it)-> m_hlabel-> setText ( cih. m_name ); |
163 | } | 167 | } |
164 | } | 168 | } |
165 | 169 | ||
166 | buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) | 170 | buttoninfo *ButtonSettings::buttonInfoForKeycode ( ushort key ) |
167 | { | 171 | { |
168 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { | 172 | for ( QListIterator <buttoninfo> it ( m_infos ); *it; ++it ) { |
169 | if ((*it)-> m_button-> keycode ( ) == key ) | 173 | if ((*it)-> m_button-> keycode ( ) == key ) |