Enlightenment CVS committal
Author : kwo
Project : e16
Module : e
Dir : e16/e/src
Modified Files:
iconify.c
Log Message:
Improve iconbox icon scaling.
===================================================================
RCS file: /cvsroot/enlightenment/e16/e/src/iconify.c,v
retrieving revision 1.124
retrieving revision 1.125
diff -u -3 -r1.124 -r1.125
--- iconify.c 2 Feb 2005 17:11:57 -0000 1.124
+++ iconify.c 6 Feb 2005 12:37:47 -0000 1.125
@@ -1237,7 +1237,8 @@
}
static void
-IconboxFindIconSize(Iconbox * ib, Imlib_Image * im, int type, int *pw, int *ph)
+IconboxFindIconSize(Iconbox * ib, Imlib_Image * im, int type __UNUSED__,
+ int *pw, int *ph)
{
int w, h, minsz, maxsz, maxwh;
@@ -1248,45 +1249,31 @@
if (maxwh <= 1)
goto done;
- minsz = ib->iconsize / 2;
maxsz = ib->iconsize;
- switch (type)
+ if (ib->draw_icon_base)
{
- case EWIN_ICON_TYPE_APP:
-#if 0 /* Scale app icons too */
- break;
-#endif
- goto do_scale;
- case EWIN_ICON_TYPE_IMG:
- goto do_scale;
- case EWIN_ICON_TYPE_SNAP:
- if (ib->draw_icon_base)
- {
- ImageClass *ic;
- int maxpad;
-
- ic = ImageclassFind("DEFAULT_ICON_BUTTON", 0);
- if (ic)
- {
- maxpad = ic->padding.left + ic->padding.right;
- if (maxpad < ic->padding.top + ic->padding.bottom)
- maxpad = ic->padding.top + ic->padding.bottom;
- if (maxpad > 4)
- maxpad = 4;
- maxsz -= maxpad;
- }
- }
- goto do_scale;
+ ImageClass *ic;
+ int maxpad;
- default:
- do_scale:
- if (maxwh < minsz || maxwh > maxsz)
+ ic = ImageclassFind("DEFAULT_ICON_BUTTON", 0);
+ if (ic)
{
- w = (w * maxsz) / maxwh;
- h = (h * maxsz) / maxwh;
+ maxpad = ic->padding.left + ic->padding.right;
+ if (maxpad < ic->padding.top + ic->padding.bottom)
+ maxpad = ic->padding.top + ic->padding.bottom;
+ maxsz -= maxpad;
+ if (maxsz < 8)
+ maxsz = 8;
}
- break;
+ }
+
+ minsz = (maxsz * 3) / 4;
+
+ if (maxwh < minsz || maxwh > maxsz)
+ {
+ w = (w * maxsz) / maxwh;
+ h = (h * maxsz) / maxwh;
}
done:
@@ -2101,7 +2088,7 @@
EMoveResizeWindow(ib->icon_win, ib_xlt, ib_ylt, ib_ww, ib_hh);
- if (ib_ic_cover && (!(ib->cover_hide)))
+ if (ib_ic_cover && !ib->cover_hide)
{
EMoveResizeWindow(ib->cover_win, ib_xlt, ib_ylt, ib_ww, ib_hh);
EMapWindow(ib->cover_win);
-------------------------------------------------------
This SF.Net email is sponsored by: IntelliVIEW -- Interactive Reporting
Tool for open source databases. Create drag-&-drop reports. Save time
by over 75%! Publish reports on the web. Export to DOC, XLS, RTF, etc.
Download a FREE copy at http://www.intelliview.com/go/osdn_nl
_______________________________________________
enlightenment-cvs mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs