diff --git a/src/modules/fileman/e_fwin.c b/src/modules/fileman/e_fwin.c index b5402de70..857f1839c 100644 --- a/src/modules/fileman/e_fwin.c +++ b/src/modules/fileman/e_fwin.c @@ -104,6 +104,7 @@ static void _e_fwin_zone_cb_mouse_down(void *data, Evas *evas, Evas_Object *obj, static int _e_fwin_zone_move_resize(void *data, int type, void *event); static void _e_fwin_config_set(E_Fwin *fwin); static void _e_fwin_window_title_set(E_Fwin *fwin); +static void _e_fwin_toolbar_resize(E_Fwin *fwin); /* local subsystem globals */ static Evas_List *fwins = NULL; @@ -374,8 +375,14 @@ _e_fwin_new(E_Container *con, const char *dev, const char *path) evas_object_move(o, 0, 0); evas_object_show(o); - fwin->tbar = e_toolbar_new(e_win_evas_get(fwin->win), "toolbar"); - e_toolbar_show(fwin->tbar); +#if 0 + if (fileman_config->view.show_toolbar) + { + fwin->tbar = e_toolbar_new(e_win_evas_get(fwin->win), "toolbar", + fwin->win, fwin->fm_obj); + e_toolbar_show(fwin->tbar); + } +#endif o = edje_object_add(e_win_evas_get(fwin->win)); edje_object_part_swallow(fwin->bg_obj, "e.swallow.bg", o); @@ -462,7 +469,7 @@ static void _e_fwin_cb_resize(E_Win *win) { E_Fwin *fwin; - + if (!win) return; //safety fwin = win->data; if (fwin->bg_obj) @@ -474,10 +481,10 @@ _e_fwin_cb_resize(E_Win *win) } if (fwin->win) { - e_toolbar_move_resize(fwin->tbar, 0, 0, fwin->win->w, fwin->tbar->h); - evas_object_move(fwin->scrollframe_obj, 0, fwin->tbar->h); - evas_object_resize(fwin->scrollframe_obj, fwin->win->w, - (fwin->win->h - fwin->tbar->h)); + if (fwin->tbar) + _e_fwin_toolbar_resize(fwin); + else + evas_object_resize(fwin->scrollframe_obj, fwin->win->w, fwin->win->h); } else if (fwin->zone) evas_object_resize(fwin->scrollframe_obj, fwin->zone->w, fwin->zone->h); @@ -1580,3 +1587,40 @@ _e_fwin_window_title_set(E_Fwin *fwin) e_win_title_set(fwin->win, buf); } } + +static void +_e_fwin_toolbar_resize(E_Fwin *fwin) +{ + int x, y, w, h; + + e_toolbar_position_calc(fwin->tbar); + w = fwin->win->w; + h = fwin->win->h; + switch (fwin->tbar->gadcon->orient) + { + case E_GADCON_ORIENT_TOP: + x = 0; + y = fwin->tbar->h; + h = (h - fwin->tbar->h); + break; + case E_GADCON_ORIENT_BOTTOM: + x = 0; + y = 0; + h = (h - fwin->tbar->h); + break; + case E_GADCON_ORIENT_LEFT: + x = (fwin->tbar->x + fwin->tbar->w); + y = 0; + w = (w - fwin->tbar->w); + break; + case E_GADCON_ORIENT_RIGHT: + x = 0; + y = 0; + w = (fwin->win->w - fwin->tbar->w); + break; + default: + break; + } + evas_object_move(fwin->scrollframe_obj, x, y); + evas_object_resize(fwin->scrollframe_obj, w, h); +} diff --git a/src/modules/fileman/e_mod_config.c b/src/modules/fileman/e_mod_config.c index 21586f497..901b98b5d 100644 --- a/src/modules/fileman/e_mod_config.c +++ b/src/modules/fileman/e_mod_config.c @@ -17,6 +17,7 @@ struct _E_Config_Dialog_Data int fit_custom_pos; int show_full_path; int show_desktop_icons; + int show_toolbar; } view; /* display of icons */ struct @@ -24,15 +25,7 @@ struct _E_Config_Dialog_Data struct { int w, h; - } icon; - struct - { - int w, h; - } list; - struct - { - int w, h; - } fixed; + } icon, list, fixed; struct { int show; @@ -112,6 +105,7 @@ _fill_data(E_Config_Dialog_Data *cfdata) cfdata->view.single_click = fileman_config->view.single_click; cfdata->view.show_full_path = fileman_config->view.show_full_path; cfdata->view.show_desktop_icons = fileman_config->view.show_desktop_icons; + cfdata->view.show_toolbar = fileman_config->view.show_toolbar; cfdata->icon.icon.w = fileman_config->icon.icon.w; cfdata->icon.icon.h = fileman_config->icon.icon.h; cfdata->icon.extension.show = fileman_config->icon.extension.show; @@ -133,6 +127,7 @@ _basic_apply(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata) fileman_config->view.single_click = cfdata->view.single_click; fileman_config->view.show_full_path = cfdata->view.show_full_path; fileman_config->view.show_desktop_icons = cfdata->view.show_desktop_icons; + fileman_config->view.show_toolbar = cfdata->view.show_toolbar; fileman_config->icon.extension.show = cfdata->icon.extension.show; /* Make these two equal so that icons are proportioned correctly */ @@ -199,6 +194,9 @@ _basic_create(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata) ob = e_widget_check_add(evas, _("Show Desktop Icons"), &(cfdata->view.show_desktop_icons)); e_widget_list_object_append(o, ob, 1, 1, 0.5); + ob = e_widget_check_add(evas, _("Show Toolbar"), + &(cfdata->view.show_toolbar)); + e_widget_list_object_append(o, ob, 1, 1, 0.5); return o; } diff --git a/src/modules/fileman/e_mod_main.c b/src/modules/fileman/e_mod_main.c index 22d172708..5c3d1d2cd 100644 --- a/src/modules/fileman/e_mod_main.c +++ b/src/modules/fileman/e_mod_main.c @@ -82,7 +82,6 @@ e_modapi_init(E_Module *m) (zone->container->num + zone->num)); e_fwin_zone_new(zone, "desktop", buf); } - } } } @@ -224,6 +223,7 @@ _e_mod_fileman_config_load(void) E_CONFIG_VAL(D, T, view.fit_custom_pos, UCHAR); E_CONFIG_VAL(D, T, view.show_full_path, UCHAR); E_CONFIG_VAL(D, T, view.show_desktop_icons, UCHAR); + E_CONFIG_VAL(D, T, view.show_toolbar, UCHAR); E_CONFIG_VAL(D, T, icon.icon.w, INT); E_CONFIG_VAL(D, T, icon.icon.h, INT); E_CONFIG_VAL(D, T, icon.list.w, INT); @@ -298,7 +298,11 @@ _e_mod_fileman_config_load(void) fileman_config->selection.single = 0; fileman_config->selection.windows_modifiers = 0; IFMODCFGEND; - + + IFMODCFG(0x0101); + fileman_config->view.show_toolbar = 0; + IFMODCFGEND; + fileman_config->config_version = MOD_CONFIG_FILE_VERSION; /* UCHAR's give nasty compile warnings about comparisons so not gonna limit those */ diff --git a/src/modules/fileman/e_mod_main.h b/src/modules/fileman/e_mod_main.h index 8f00904b2..de92f490d 100644 --- a/src/modules/fileman/e_mod_main.h +++ b/src/modules/fileman/e_mod_main.h @@ -7,7 +7,7 @@ /* Increment for Major Changes */ #define MOD_CONFIG_FILE_EPOCH 0x0001 /* Increment for Minor Changes (ie: user doesn't need a new config) */ -#define MOD_CONFIG_FILE_GENERATION 0x0100 +#define MOD_CONFIG_FILE_GENERATION 0x0101 #define MOD_CONFIG_FILE_VERSION ((MOD_CONFIG_FILE_EPOCH << 16) | MOD_CONFIG_FILE_GENERATION) typedef struct _Config Config; @@ -34,6 +34,7 @@ struct _Config unsigned char fit_custom_pos; unsigned char show_full_path; unsigned char show_desktop_icons; + unsigned char show_toolbar; } view; /* display of icons */ struct {