forked from enlightenment/enlightenment
Rework config desks dialog for small resolutions.
- Use toolbook. - Use new deskpreview widget. SVN revision: 46804
This commit is contained in:
parent
8dd6d9fa23
commit
ab65175124
|
@ -58,8 +58,7 @@ e_int_config_desks(E_Container *con, const char *params __UNUSED__)
|
|||
v->advanced.create_widgets = _advanced_create_widgets;
|
||||
v->advanced.check_changed = _advanced_check_changed;
|
||||
/* create config diaolg for NULL object/data */
|
||||
cfd = e_config_dialog_new(con,
|
||||
_("Virtual Desktops Settings"),
|
||||
cfd = e_config_dialog_new(con, _("Virtual Desktops Settings"),
|
||||
"E", "screen/virtual_desktops",
|
||||
"preferences-desktop", 0, v, NULL);
|
||||
return cfd;
|
||||
|
@ -201,6 +200,7 @@ _advanced_check_changed(E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata)
|
|||
EINA_LIST_FOREACH(con->zones, lll, zone)
|
||||
{
|
||||
int x, y;
|
||||
|
||||
e_zone_desk_count_get(zone, &x, &y);
|
||||
if ((x != cfdata->x) || (y != cfdata->y))
|
||||
return 1;
|
||||
|
@ -221,34 +221,34 @@ static Evas_Object *
|
|||
_basic_create_widgets(E_Config_Dialog *cdd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
/* generate the core widget layout for a basic dialog */
|
||||
Evas_Object *o, *ob, *of, *ot;
|
||||
Evas_Object *o, *ob, *of;
|
||||
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Number of Desktops"), 0);
|
||||
of = e_widget_frametable_add(evas, _("Number of Desktops"), 0);
|
||||
e_widget_frametable_content_align_set(of, 0.5, 0.0);
|
||||
|
||||
ot = e_widget_table_add(evas, 0);
|
||||
|
||||
ob = e_widget_desk_preview_add(evas, cfdata->x, cfdata->y);
|
||||
e_widget_table_object_append(ot, ob, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||
ob = e_widget_deskpreview_add(evas, cfdata->x, cfdata->y);
|
||||
e_widget_frametable_object_append(of, ob, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||
cfdata->preview = ob;
|
||||
|
||||
ob = e_widget_slider_add(evas, 0, 0, _("%1.0f"), 1.0, 12.0, 1.0, 0, NULL, &(cfdata->y), 150);
|
||||
ob = e_widget_slider_add(evas, 0, 0, _("%1.0f"), 1.0, 12.0, 1.0, 0, NULL,
|
||||
&(cfdata->y), 150);
|
||||
e_widget_on_change_hook_set(ob, _cb_slider_change, cfdata);
|
||||
e_widget_table_object_append(ot, ob, 1, 0, 1, 1, 0, 1, 0, 1);
|
||||
e_widget_frametable_object_append(of, ob, 1, 0, 1, 1, 1, 1, 0, 1);
|
||||
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f"), 1.0, 12.0, 1.0, 0, NULL, &(cfdata->x), 200);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f"), 1.0, 12.0, 1.0, 0, NULL,
|
||||
&(cfdata->x), 200);
|
||||
e_widget_on_change_hook_set(ob, _cb_slider_change, cfdata);
|
||||
e_widget_table_object_append(ot, ob, 0, 1, 1, 1, 1, 0, 1, 0);
|
||||
e_widget_frametable_object_append(of, ob, 0, 1, 1, 1, 1, 1, 1, 0);
|
||||
|
||||
e_widget_framelist_object_append(of, ot);
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Desktop Mouse Flip"), 0);
|
||||
ob = e_widget_check_add(evas, _("Animated flip"), &(cfdata->flip_animate));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
|
||||
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||
e_widget_list_object_append(o, of, 1, 0, 0.5);
|
||||
|
||||
return o;
|
||||
}
|
||||
|
@ -256,71 +256,86 @@ _basic_create_widgets(E_Config_Dialog *cdd, Evas *evas, E_Config_Dialog_Data *cf
|
|||
static Evas_Object *
|
||||
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
|
||||
{
|
||||
/* generate the core widget layout for an advanced dialog */
|
||||
Evas_Object *o, *ob, *of, *ot, *ott;
|
||||
Evas_Object *otb, *ow, *o;
|
||||
E_Radio_Group *rg;
|
||||
|
||||
otb = e_widget_toolbook_add(evas, (48 * e_scale), (48 * e_scale));
|
||||
|
||||
o = e_widget_table_add(evas, 0);
|
||||
ow = e_widget_deskpreview_add(evas, cfdata->x, cfdata->y);
|
||||
e_widget_table_object_append(o, ow, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||
cfdata->preview = ow;
|
||||
ow = e_widget_slider_add(evas, 0, 0, _("%1.0f"), 1, 12, 1, 0, NULL,
|
||||
&(cfdata->y), 100);
|
||||
e_widget_on_change_hook_set(ow, _cb_slider_change, cfdata);
|
||||
e_widget_table_object_append(o, ow, 1, 0, 1, 1, 0, 1, 0, 1);
|
||||
ow = e_widget_slider_add(evas, 1, 0, _("%1.0f"), 1, 12, 1, 0, NULL,
|
||||
&(cfdata->x), 100);
|
||||
e_widget_on_change_hook_set(ow, _cb_slider_change, cfdata);
|
||||
e_widget_table_object_append(o, ow, 0, 1, 1, 1, 1, 0, 1, 0);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Desktops"), o, 1, 1, 1, 1,
|
||||
0.5, 0.0);
|
||||
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
ott = e_widget_table_add(evas, 0);
|
||||
ow = e_widget_check_add(evas, _("Flip when dragging objects to the screen edge"),
|
||||
&(cfdata->edge_flip_dragging));
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
ow = e_widget_check_add(evas, _("Wrap desktops around when flipping"),
|
||||
&(cfdata->flip_wrap));
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Desktop Mouse Flip"), o,
|
||||
0, 0, 0, 0, 0.5, 0.0);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Desktops"), 0);
|
||||
ot = e_widget_table_add(evas, 0);
|
||||
|
||||
ob = e_widget_desk_preview_add(evas, cfdata->x, cfdata->y);
|
||||
e_widget_table_object_append(ot, ob, 0, 0, 1, 1, 1, 1, 1, 1);
|
||||
cfdata->preview = ob;
|
||||
|
||||
ob = e_widget_slider_add(evas, 0, 0, _("%1.0f"), 1.0, 12.0, 1.0, 0, NULL, &(cfdata->y), 150);
|
||||
e_widget_on_change_hook_set(ob, _cb_slider_change, cfdata);
|
||||
e_widget_table_object_append(ot, ob, 1, 0, 1, 1, 0, 1, 0, 1);
|
||||
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.0f"), 1.0, 12.0, 1.0, 0, NULL, &(cfdata->x), 200);
|
||||
e_widget_on_change_hook_set(ob, _cb_slider_change, cfdata);
|
||||
e_widget_table_object_append(ot, ob, 0, 1, 1, 1, 1, 0, 1, 0);
|
||||
|
||||
e_widget_framelist_object_append(of, ot);
|
||||
e_widget_table_object_append(ott, of, 0, 0, 1, 2, 1, 1, 1, 1);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Desktop Mouse Flip"), 0);
|
||||
ob = e_widget_check_add(evas, _("Flip when dragging objects to the screen edge"), &(cfdata->edge_flip_dragging));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_check_add(evas, _("Wrap desktops around when flipping"), &(cfdata->flip_wrap));
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_table_object_append(ott, of, 1, 0, 1, 1, 1, 0, 1, 0);
|
||||
|
||||
of = e_widget_framelist_add(evas, _("Flip Animation"), 0);
|
||||
o = e_widget_list_add(evas, 0, 0);
|
||||
rg = e_widget_radio_group_new(&(cfdata->flip_mode));
|
||||
ob = e_widget_radio_add(evas, _("Off"), 0, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_on_change_hook_set(ob, _cb_disable_flip_anim, cfdata);
|
||||
ob = e_widget_radio_add(evas, _("Pane"), 1, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_on_change_hook_set(ob, _cb_disable_flip_anim, cfdata);
|
||||
ob = e_widget_radio_add(evas, _("Zoom"), 2, rg);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
e_widget_on_change_hook_set(ob, _cb_disable_flip_anim, cfdata);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%1.1f sec"), 0.0, 5.0, 0.05, 0, &(cfdata->flip_speed), NULL, 200);
|
||||
e_widget_disabled_set(ob, !cfdata->flip_mode);
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_check_add(evas, _("Background panning"), &(cfdata->flip_pan_bg));
|
||||
e_widget_disabled_set(ob, !cfdata->flip_mode);
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%.2f X-axis pan factor"), 0.0, 1.0, 0.01, 0, &(cfdata->x_axis_pan), NULL, 200);
|
||||
e_widget_disabled_set(ob, !cfdata->flip_mode);
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ob = e_widget_slider_add(evas, 1, 0, _("%.2f Y-axis pan factor"), 0.0, 1.0, 0.01, 0, &(cfdata->y_axis_pan), NULL, 200);
|
||||
e_widget_disabled_set(ob, !cfdata->flip_mode);
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ob);
|
||||
e_widget_framelist_object_append(of, ob);
|
||||
ow = e_widget_radio_add(evas, _("Off"), 0, rg);
|
||||
e_widget_on_change_hook_set(ow, _cb_disable_flip_anim, cfdata);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
ow = e_widget_radio_add(evas, _("Pane"), 1, rg);
|
||||
e_widget_on_change_hook_set(ow, _cb_disable_flip_anim, cfdata);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
ow = e_widget_radio_add(evas, _("Zoom"), 2, rg);
|
||||
e_widget_on_change_hook_set(ow, _cb_disable_flip_anim, cfdata);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
|
||||
e_widget_table_object_append(ott, of, 1, 1, 1, 1, 1, 1, 1, 1);
|
||||
ow = e_widget_check_add(evas, _("Background panning"),
|
||||
&(cfdata->flip_pan_bg));
|
||||
e_widget_disabled_set(ow, !cfdata->flip_mode);
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ow);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
|
||||
e_widget_list_object_append(o, ott, 1, 1, 0.5);
|
||||
ow = e_widget_label_add(evas, _("Animation speed"));
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ow);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
ow = e_widget_slider_add(evas, 1, 0, _("%1.1f sec"), 0, 5, 0.05, 0,
|
||||
&(cfdata->flip_speed), NULL, 150);
|
||||
e_widget_disabled_set(ow, !cfdata->flip_mode);
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ow);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
|
||||
return o;
|
||||
ow = e_widget_label_add(evas, _("X-Axis pan factor"));
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ow);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
ow = e_widget_slider_add(evas, 1, 0, _("%.2f"), 0, 1, 0.01, 0,
|
||||
&(cfdata->x_axis_pan), NULL, 150);
|
||||
e_widget_disabled_set(ow, !cfdata->flip_mode);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ow);
|
||||
|
||||
ow = e_widget_label_add(evas, _("Y-Axis pan factor"));
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ow);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
ow = e_widget_slider_add(evas, 1, 0, _("%.2f"), 0, 1, 0.01, 0,
|
||||
&(cfdata->y_axis_pan), NULL, 150);
|
||||
e_widget_disabled_set(ow, !cfdata->flip_mode);
|
||||
e_widget_list_object_append(o, ow, 1, 0, 0.5);
|
||||
cfdata->flip_anim_list = eina_list_append(cfdata->flip_anim_list, ow);
|
||||
|
||||
e_widget_toolbook_page_append(otb, NULL, _("Flip Animation"), o,
|
||||
0, 0, 0, 0, 0.5, 0.0);
|
||||
|
||||
e_widget_toolbook_page_show(otb, 0);
|
||||
return otb;
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -328,7 +343,7 @@ _cb_slider_change(void *data, Evas_Object *obj)
|
|||
{
|
||||
E_Config_Dialog_Data *cfdata = data;
|
||||
|
||||
e_widget_desk_preview_num_desks_set(cfdata->preview, cfdata->x, cfdata->y);
|
||||
e_widget_deskpreview_num_desks_set(cfdata->preview, cfdata->x, cfdata->y);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Loading…
Reference in New Issue