forked from enlightenment/enlightenment
Fix typo of mine. Fix some whitespace. Allow appropriate icons to be viewed in "Border Icons" border menu.
SVN revision: 30821
This commit is contained in:
parent
2e875d3805
commit
79b8cf455c
|
@ -3,7 +3,7 @@
|
|||
*/
|
||||
#ifdef E_TYPEDEFS
|
||||
|
||||
typedef enum _E_Icon_Preferece
|
||||
typedef enum _E_Icon_Preference
|
||||
{
|
||||
E_ICON_PREF_E_DEFAULT,
|
||||
E_ICON_PREF_NETWM,
|
||||
|
|
|
@ -39,6 +39,8 @@ static void _e_border_menu_cb_border_pre(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
static void _e_border_menu_cb_iconpref_e(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_border_menu_cb_iconpref_netwm(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_border_menu_cb_iconpref_user(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_border_menu_cb_default_icon(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
static void _e_border_menu_cb_netwm_icon(void *data, E_Menu *m, E_Menu_Item *mi);
|
||||
|
||||
EAPI void
|
||||
e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_X_Time timestamp)
|
||||
|
@ -757,6 +759,44 @@ _e_border_menu_cb_lower(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_menu_cb_default_icon(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||
{
|
||||
E_Border *bd;
|
||||
Evas_Object *o;
|
||||
unsigned char prev_icon_pref;
|
||||
|
||||
bd = data;
|
||||
E_OBJECT_CHECK(bd);
|
||||
|
||||
o = e_icon_add(m->evas);
|
||||
prev_icon_pref = bd->icon_preference;
|
||||
bd->icon_preference = E_ICON_PREF_E_DEFAULT;
|
||||
e_icon_object_set(o, e_border_icon_add(bd, m->evas));
|
||||
bd->icon_preference = prev_icon_pref;
|
||||
mi->icon_object = o;
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_menu_cb_netwm_icon(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||
{
|
||||
E_Border *bd;
|
||||
Evas_Object *o;
|
||||
|
||||
bd = data;
|
||||
E_OBJECT_CHECK(bd);
|
||||
|
||||
if (bd->client.netwm.icons)
|
||||
{
|
||||
o = e_icon_add(m->evas);
|
||||
e_icon_data_set(o, bd->client.netwm.icons[0].data,
|
||||
bd->client.netwm.icons[0].width,
|
||||
bd->client.netwm.icons[0].height);
|
||||
e_icon_alpha_set(o, 1);
|
||||
mi->icon_object = o;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_e_border_menu_cb_border_pre(void *data, E_Menu *m, E_Menu_Item *mi)
|
||||
{
|
||||
|
@ -773,18 +813,15 @@ _e_border_menu_cb_border_pre(void *data, E_Menu *m, E_Menu_Item *mi)
|
|||
e_object_data_set(E_OBJECT(subm), bd);
|
||||
e_menu_item_submenu_set(mi, subm);
|
||||
|
||||
if (!bd->lock_border)
|
||||
if (e_configure_registry_exists("internal/borders_border"))
|
||||
{
|
||||
if (e_configure_registry_exists("internal/borders_border"))
|
||||
{
|
||||
submi = e_menu_item_new(subm);
|
||||
e_menu_item_label_set(submi, _("Select Border Style"));
|
||||
e_menu_item_callback_set(submi, _e_border_menu_cb_border, bd);
|
||||
e_menu_item_icon_edje_set(submi,
|
||||
e_theme_edje_file_get("base/theme/borders",
|
||||
"e/widgets/border/default/borderless"),
|
||||
"e/widgets/border/default/borderless");
|
||||
}
|
||||
submi = e_menu_item_new(subm);
|
||||
e_menu_item_label_set(submi, _("Select Border Style"));
|
||||
e_menu_item_callback_set(submi, _e_border_menu_cb_border, bd);
|
||||
e_menu_item_icon_edje_set(submi,
|
||||
e_theme_edje_file_get("base/theme/borders",
|
||||
"e/widgets/border/default/borderless"),
|
||||
"e/widgets/border/default/borderless");
|
||||
}
|
||||
|
||||
submi = e_menu_item_new(subm);
|
||||
|
|
Loading…
Reference in New Issue