forked from enlightenment/enlightenment
Give ability for config dialogs to set their border icon to the proper
config icon, rather than all having the E logo. Is proactive about setting this: if it does not find or cannot set to that icon, it will fallback to the E icon. Change all config dialogs to support this. If we have an internal border (config dialogs), disable the Create Icon/Edit Icon menu items. SVN revision: 23655
This commit is contained in:
parent
9d29ae7f0e
commit
4bb372ad2d
|
@ -2448,7 +2448,11 @@ e_border_icon_add(E_Border *bd, Evas *evas)
|
|||
if (bd->internal)
|
||||
{
|
||||
o = edje_object_add(evas);
|
||||
e_util_edje_icon_set(o, "enlightenment/e");
|
||||
if (!bd->internal_icon)
|
||||
e_util_edje_icon_set(o, "enlightenment/e");
|
||||
else
|
||||
if (!e_util_edje_icon_set(o, bd->internal_icon))
|
||||
e_util_edje_icon_set(o, "enlightenment/e");
|
||||
return o;
|
||||
}
|
||||
if (e_config->use_app_icon)
|
||||
|
@ -3026,6 +3030,7 @@ _e_border_free(E_Border *bd)
|
|||
if (bd->client.netwm.name) free(bd->client.netwm.name);
|
||||
if (bd->client.netwm.icon_name) free(bd->client.netwm.icon_name);
|
||||
e_object_del(E_OBJECT(bd->shape));
|
||||
if (bd->internal_icon) evas_stringshare_del(bd->internal_icon);
|
||||
if (bd->icon_object) evas_object_del(bd->icon_object);
|
||||
evas_object_del(bd->bg_object);
|
||||
e_canvas_del(bd->bg_ecore_evas);
|
||||
|
|
|
@ -134,6 +134,7 @@ struct _E_Border
|
|||
Evas_Object *bg_object;
|
||||
Evas_Object *icon_object;
|
||||
Ecore_X_Window event_win;
|
||||
const char *internal_icon;
|
||||
|
||||
struct {
|
||||
Ecore_X_Window shell_win;
|
||||
|
|
|
@ -107,8 +107,6 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
|
|||
cfd->dia->data = cfd;
|
||||
e_object_del_attach_func_set(E_OBJECT(cfd->dia), _e_config_dialog_cb_dialog_del);
|
||||
e_dialog_title_set(cfd->dia, cfd->title);
|
||||
if (cfd->icon) e_dialog_icon_set(cfd->dia, cfd->icon, cfd->icon_size);
|
||||
|
||||
if (!cfd->cfdata) cfd->cfdata = cfd->view->create_cfdata(cfd);
|
||||
|
||||
if (type == E_CONFIG_DIALOG_CFDATA_TYPE_BASIC)
|
||||
|
@ -162,12 +160,14 @@ _e_config_dialog_go(E_Config_Dialog *cfd, E_Config_Dialog_CFData_Type type)
|
|||
{
|
||||
e_win_centered_set(cfd->dia->win, 1);
|
||||
e_dialog_show(cfd->dia);
|
||||
if (cfd->icon) e_dialog_border_icon_set(cfd->dia, cfd->icon);
|
||||
}
|
||||
else
|
||||
{
|
||||
int x, y;
|
||||
|
||||
e_dialog_show(cfd->dia);
|
||||
if (cfd->icon) e_dialog_border_icon_set(cfd->dia, cfd->icon);
|
||||
x = pdia->win->border->x + ((pdia->win->w - cfd->dia->win->w) / 2);
|
||||
y = pdia->win->border->y + ((pdia->win->h - cfd->dia->win->h) / 2);
|
||||
if (x < 0) x = 0;
|
||||
|
|
|
@ -113,8 +113,9 @@ e_configure_show(E_Container *con)
|
|||
evas_object_show(eco->ilist);
|
||||
evas_object_show(eco->close);
|
||||
evas_object_show(eco->edje);
|
||||
|
||||
|
||||
e_win_show(eco->win);
|
||||
eco->win->border->internal_icon = evas_stringshare_add("enlightenment/configuration");
|
||||
|
||||
e_widget_focus_set(eco->ilist, 1);
|
||||
e_widget_ilist_go(eco->ilist);
|
||||
|
|
|
@ -151,6 +151,18 @@ e_dialog_icon_set(E_Dialog *dia, const char *icon, Evas_Coord size)
|
|||
evas_object_show(dia->icon_object);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_border_icon_set(E_Dialog *dia, const char *icon)
|
||||
{
|
||||
E_Border *border;
|
||||
|
||||
if (!icon) return;
|
||||
|
||||
border = dia->win->border;
|
||||
if (!border) return;
|
||||
border->internal_icon = evas_stringshare_add(icon);
|
||||
}
|
||||
|
||||
EAPI void
|
||||
e_dialog_content_set(E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh)
|
||||
{
|
||||
|
|
|
@ -37,6 +37,7 @@ EAPI int e_dialog_button_disable_num_get (E_Dialog *dia, int button);
|
|||
EAPI void e_dialog_title_set (E_Dialog *dia, const char *title);
|
||||
EAPI void e_dialog_text_set (E_Dialog *dia, const char *text);
|
||||
EAPI void e_dialog_icon_set (E_Dialog *dia, const char *icon, Evas_Coord size);
|
||||
EAPI void e_dialog_border_icon_set (E_Dialog *dia, const char *icon);
|
||||
EAPI void e_dialog_content_set (E_Dialog *dia, Evas_Object *obj, Evas_Coord minw, Evas_Coord minh);
|
||||
EAPI void e_dialog_resizable_set (E_Dialog *dia, int resizable);
|
||||
EAPI void e_dialog_show (E_Dialog *dia);
|
||||
|
|
|
@ -249,23 +249,26 @@ e_int_border_menu_show(E_Border *bd, Evas_Coord x, Evas_Coord y, int key, Ecore_
|
|||
"widgets/border/default/skip_winlist");
|
||||
}
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_separator_set(mi, 1);
|
||||
if (!bd->internal)
|
||||
{
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_separator_set(mi, 1);
|
||||
|
||||
if (bd->app)
|
||||
{
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Edit Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
|
||||
e_menu_item_icon_edje_set(mi, bd->app->path, "icon");
|
||||
}
|
||||
else if (bd->client.icccm.class) /* icons with no class useless to borders */
|
||||
{
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Create Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
|
||||
}
|
||||
}
|
||||
|
||||
if (bd->app)
|
||||
{
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Edit Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
|
||||
e_menu_item_icon_edje_set(mi, bd->app->path, "icon");
|
||||
}
|
||||
else if (bd->client.icccm.class) /* icons with no class useless to borders */
|
||||
{
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_label_set(mi, _("Create Icon"));
|
||||
e_menu_item_callback_set(mi, _e_border_menu_cb_icon_edit, bd);
|
||||
}
|
||||
|
||||
mi = e_menu_item_new(m);
|
||||
e_menu_item_separator_set(mi, 1);
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ e_int_config_background(E_Container *con)
|
|||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
v->close_cfdata = _bg_dialog_close;
|
||||
v->override_auto_apply = 1;
|
||||
cfd = e_config_dialog_new(con, _("Wallpaper Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Wallpaper Settings"), "enlightenment/background", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
@ -102,7 +102,7 @@ _basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
cfdata->il = il;
|
||||
|
||||
e_widget_ilist_selector_set(il, 1);
|
||||
e_widget_min_size_set(il, 180, 40);
|
||||
e_widget_min_size_set(il, 160, 40);
|
||||
|
||||
/* Load Bgs */
|
||||
_load_bgs(cfd, il);
|
||||
|
@ -164,7 +164,7 @@ _advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data
|
|||
il = e_widget_ilist_add(evas, 48, 48, &(cfdata->bg));
|
||||
cfdata->il = il;
|
||||
e_widget_ilist_selector_set(il, 1);
|
||||
e_widget_min_size_set(il, 180, 40);
|
||||
e_widget_min_size_set(il, 160, 40);
|
||||
|
||||
/* Load Bgs */
|
||||
_load_bgs(cfd, il);
|
||||
|
|
|
@ -31,7 +31,7 @@ e_int_config_cfgdialogs(E_Container *con)
|
|||
v->advanced.create_widgets = NULL;
|
||||
v->override_auto_apply = 1;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Config Dialog Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Config Dialog Settings"), "enlightenment/configuration", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ e_int_config_cursor(E_Container *con)
|
|||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Cursor Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Cursor Settings"), "enlightenment/mouse", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ e_int_config_desklock(E_Container *con)
|
|||
|
||||
v->override_auto_apply = 1;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Desktop Lock Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Desktop Lock Settings"), "enlightenment/desklock", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ e_int_config_desks(E_Container *con)
|
|||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
/* create config diaolg for NULL object/data */
|
||||
cfd = e_config_dialog_new(con, _("Desktop Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Desktop Settings"), "enlightenment/desktops", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ e_int_config_display(E_Container *con)
|
|||
v->basic.create_widgets = _basic_create_widgets;
|
||||
v->override_auto_apply = 1;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Display Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Display Settings"), "enlightenment/screen_resolution", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ e_int_config_exebuf(E_Container *con)
|
|||
v->basic.create_widgets = _basic_create_widgets;
|
||||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
cfd = e_config_dialog_new(con, _("Exebuf Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Exebuf Settings"), "enlightenment/run", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ e_int_config_focus(E_Container *con)
|
|||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
/* create config diaolg for NULL object/data */
|
||||
cfd = e_config_dialog_new(con, _("Focus Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Focus Settings"), "enlightenment/focus", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -129,7 +129,7 @@ e_int_config_fonts(E_Container *con)
|
|||
v->basic.create_widgets = _basic_create_widgets;
|
||||
v->basic.apply_cfdata = _basic_apply_data;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Font Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Font Settings"), "enlightenment/fonts", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -312,7 +312,7 @@ e_int_config_keybindings(E_Container *con)
|
|||
v->basic.create_widgets = _basic_create_widgets;
|
||||
v->override_auto_apply = 1;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Key Binding Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Key Binding Settings"), "enlightenment/keys", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -36,7 +36,7 @@ e_int_config_menus(E_Container *con)
|
|||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Menu Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Menu Settings"), "enlightenment/menus", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ e_int_config_modules(E_Container *con)
|
|||
v->basic.create_widgets = _basic_create_widgets;
|
||||
v->basic.apply_cfdata = _basic_apply_data;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Module Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Module Settings"), "enlightenment/modules", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -58,7 +58,7 @@ e_int_config_paths(E_Container *con)
|
|||
v->basic.create_widgets = _basic_create_widgets;
|
||||
v->basic.apply_cfdata = _basic_apply_data;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Search Path Configuration"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Search Path Configuration"), "enlightenment/directories", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -34,7 +34,7 @@ e_int_config_performance(E_Container *con)
|
|||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Performance Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Performance Settings"), "enlightenment/performance", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ e_int_config_shelf(E_Container *con)
|
|||
v->free_cfdata = _free_data;
|
||||
v->basic.create_widgets = _basic_create_widgets;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Shelf Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Shelf Settings"), "enlightenment/shelf", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ e_int_config_startup(E_Container *con)
|
|||
v->basic.apply_cfdata = _basic_apply_data;
|
||||
v->basic.create_widgets = _basic_create_widgets;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Startup Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Startup Settings"), "enlightenment/startup", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ e_int_config_theme(E_Container *con)
|
|||
v->override_auto_apply = 1;
|
||||
|
||||
/* create config diaolg for NULL object/data */
|
||||
cfd = e_config_dialog_new(con, _("Theme Selector"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Theme Selector"), "enlightenment/themes", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ e_int_config_window_display(E_Container *con)
|
|||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
/* create config diaolg for NULL object/data */
|
||||
cfd = e_config_dialog_new(con, _("Window Display"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Window Display"), "enlightenment/windows", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ e_int_config_window_manipulation(E_Container *con)
|
|||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
/* create config diaolg for NULL object/data */
|
||||
cfd = e_config_dialog_new(con, _("Window Manipulation"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Window Manipulation"), "enlightenment/window_manipulation", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ e_int_config_winlist(E_Container *con)
|
|||
v->advanced.apply_cfdata = _advanced_apply_data;
|
||||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
|
||||
cfd = e_config_dialog_new(con, _("Window List Settings"), NULL, 0, v, NULL);
|
||||
cfd = e_config_dialog_new(con, _("Window List Settings"), "enlightenment/winlist", 0, v, NULL);
|
||||
return cfd;
|
||||
}
|
||||
|
||||
|
|
|
@ -176,6 +176,8 @@ _cb_remove_instance(void *data, void *data2)
|
|||
l = evas_list_nth_list(cfdata->cf_gc->clients, i);
|
||||
cf_gcc = l->data;
|
||||
|
||||
printf("Remove Client Name: %s\n", cf_gcc->name);
|
||||
|
||||
if (cf_gcc->name) evas_stringshare_del(cf_gcc->name);
|
||||
if (cf_gcc->id) evas_stringshare_del(cf_gcc->id);
|
||||
if (cf_gcc->style) evas_stringshare_del(cf_gcc->style);
|
||||
|
|
|
@ -98,7 +98,7 @@ struct _E_Menu_Item
|
|||
Evas_Object *icon_object;
|
||||
Evas_Object *label_object;
|
||||
Evas_Object *submenu_object;
|
||||
|
||||
|
||||
Evas_Object *event_object;
|
||||
|
||||
int label_w, label_h;
|
||||
|
|
|
@ -72,6 +72,7 @@ e_theme_about_show(E_Theme_About *about)
|
|||
e_win_size_max_set(about->win, mw, mh);
|
||||
}
|
||||
e_win_show(about->win);
|
||||
about->win->border->internal_icon = evas_stringshare_add("enlightenment/themes");
|
||||
}
|
||||
|
||||
/* local subsystem functions */
|
||||
|
|
Loading…
Reference in New Issue