On Thu, Oct 14, 2010 at 8:21 PM, Enlightenment SVN
<[email protected]> wrote:
> Log:
>  [Elementary] Make it possible to lookup icons from Freedesktop in Elm_Icon.
Avoid useless changes so you don't go through unnoticed changes! The
following declaration is a left over from your former patches:

> +   EAPI Eina_Bool             elm_icon_freedesktop_set(Evas_Object *obj, 
> const char *name, int size);

(more left overs may have been unnoticed by me, please review if what
you have in .h is what you have in .c)


> -   typedef enum {ELM_ANIMATOR_CURVE_LINEAR, ELM_ANIMATOR_CURVE_IN_OUT, 
> ELM_ANIMATOR_CURVE_IN, ELM_ANIMATOR_CURVE_OUT} Elm_Animator_Curve_Style;
> +   typedef enum {ELM_ANIMATOR_CURVE_LINEAR, ELM_ANIMATOR_CURVE_IN_OUT, 
> ELM_ANIMATOR_CURVE_IN, ELM_ANIMATOR_CURVE_OUT} Elm_Animator_Curve_Style;

do not mix style changes with code changes :-/


> +static Eina_Bool
> +_icon_standard_set(Widget_Data *wd, Evas_Object *obj, const char *name)
> +{
> +   if (_elm_theme_object_icon_set(obj, wd->img, name, "default"))
> +     {
> +#ifdef ELM_EFREET
> +        wd->freedesktop.use = EINA_FALSE;
> +#endif
> +        return EINA_TRUE;
> +     }
> +   return EINA_FALSE;
> +}
> +
> +static Eina_Bool
> +_icon_freedesktop_set(Widget_Data *wd, Evas_Object *obj, const char *name, 
> int size)
> +{
> +#ifdef ELM_EFREET
> +   char *path;
> +
> +   elm_need_efreet();
> +   path = efreet_icon_path_find(getenv("E_ICON_THEME"), name, size);
> +   if (!path)
> +     {
> +        const char **itr;
> +        static const char *themes[] = {
> +           "default", "highcolor", "hicolor", "gnome", "Human", "oxygen", 
> NULL
> +        };
> +        for (itr = themes; !path && *itr; itr++)
> +          path = efreet_icon_path_find(*itr, name, size);
> +     }
> +   if ((wd->freedesktop.use = !!path))

ugh, I really dislike code like this... at a first look it looked to
me like a typo "it's == and not =" but then the second parenthesis
made me realize of my reading mistake. Try to keep reading easy. Two
lines for that would make it clear.



> +   /* try locating the icon using the specified lookup order */
> +   switch (wd->lookup_order)
> +   {
> +   case ELM_ICON_LOOKUP_FDO:
> +      ret = _icon_freedesktop_set(wd, obj, name, 48) ||
> +            _icon_freedesktop_set(wd, obj, name, 32);

maybe try the actual size if it's available in the wd structure?


> Modified: trunk/TMP/st/elementary/src/lib/elm_toolbar.c
> ===================================================================
> --- trunk/TMP/st/elementary/src/lib/elm_toolbar.c       2010-10-14 22:21:40 
> UTC (rev 53432)
> +++ trunk/TMP/st/elementary/src/lib/elm_toolbar.c       2010-10-14 22:21:43 
> UTC (rev 53433)
...

ugh, these should not go in the same commit :-/

-- 
Gustavo Sverzut Barbieri
http://profusion.mobi embedded systems
--------------------------------------
MSN: [email protected]
Skype: gsbarbieri
Mobile: +55 (19) 9225-2202

------------------------------------------------------------------------------
Download new Adobe(R) Flash(R) Builder(TM) 4
The new Adobe(R) Flex(R) 4 and Flash(R) Builder(TM) 4 (formerly 
Flex(R) Builder(TM)) enable the development of rich applications that run
across multiple browsers and platforms. Download your free trials today!
http://p.sf.net/sfu/adobe-dev2dev
_______________________________________________
enlightenment-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to