forked from enlightenment/enlightenment
Add Config Panel Dialogue For Menu Settings
SVN revision: 19083
This commit is contained in:
parent
d6df8cfce4
commit
f3b2308d72
|
@ -121,6 +121,7 @@ e_widget_slider.h \
|
||||||
e_int_config_window_manipulation.h \
|
e_int_config_window_manipulation.h \
|
||||||
e_int_config_window_display.h \
|
e_int_config_window_display.h \
|
||||||
e_int_config_background.h \
|
e_int_config_background.h \
|
||||||
|
e_int_config_menus.h \
|
||||||
e_deskpreview.h \
|
e_deskpreview.h \
|
||||||
e_exebuf.h
|
e_exebuf.h
|
||||||
|
|
||||||
|
@ -224,6 +225,7 @@ e_widget_slider.c \
|
||||||
e_int_config_window_manipulation.c \
|
e_int_config_window_manipulation.c \
|
||||||
e_int_config_window_display.c \
|
e_int_config_window_display.c \
|
||||||
e_int_config_background.c \
|
e_int_config_background.c \
|
||||||
|
e_int_config_menus.c \
|
||||||
e_deskpreview.c \
|
e_deskpreview.c \
|
||||||
e_exebuf.c \
|
e_exebuf.c \
|
||||||
$(ENLIGHTENMENTHEADERS)
|
$(ENLIGHTENMENTHEADERS)
|
||||||
|
|
|
@ -60,6 +60,7 @@ e_configure_show(E_Container *con)
|
||||||
/* add items here */
|
/* add items here */
|
||||||
e_configure_standard_item_add(eco, "enlightenment/e", _("Focus Settings"), e_int_config_focus);
|
e_configure_standard_item_add(eco, "enlightenment/e", _("Focus Settings"), e_int_config_focus);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/e", _("Desktop Settings"), e_int_config_desks);
|
e_configure_standard_item_add(eco, "enlightenment/e", _("Desktop Settings"), e_int_config_desks);
|
||||||
|
e_configure_standard_item_add(eco, "enlightenment/e", _("Menu Settings"), e_int_config_menus);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/e", _("Window Manipulation"), e_int_config_window_manipulation);
|
e_configure_standard_item_add(eco, "enlightenment/e", _("Window Manipulation"), e_int_config_window_manipulation);
|
||||||
e_configure_standard_item_add(eco, "enlightenment/e", _("Window Display"), e_int_config_window_display);
|
e_configure_standard_item_add(eco, "enlightenment/e", _("Window Display"), e_int_config_window_display);
|
||||||
//e_configure_standard_item_add(eco, "enlightenment/desktops", _("Background Settings"), e_int_config_background);
|
//e_configure_standard_item_add(eco, "enlightenment/desktops", _("Background Settings"), e_int_config_background);
|
||||||
|
|
|
@ -101,5 +101,6 @@
|
||||||
#include "e_int_config_window_manipulation.h"
|
#include "e_int_config_window_manipulation.h"
|
||||||
#include "e_int_config_window_display.h"
|
#include "e_int_config_window_display.h"
|
||||||
#include "e_int_config_background.h"
|
#include "e_int_config_background.h"
|
||||||
|
#include "e_int_config_menus.h"
|
||||||
#include "e_deskpreview.h"
|
#include "e_deskpreview.h"
|
||||||
#include "e_exebuf.h"
|
#include "e_exebuf.h"
|
||||||
|
|
|
@ -0,0 +1,182 @@
|
||||||
|
#include "e.h"
|
||||||
|
|
||||||
|
typedef struct _CFData CFData;
|
||||||
|
|
||||||
|
static void *_create_data(E_Config_Dialog *cfd);
|
||||||
|
static void _free_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
static int _basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
static int _advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata);
|
||||||
|
static Evas_Object *_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata);
|
||||||
|
static Evas_Object *_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata);
|
||||||
|
|
||||||
|
struct _CFData
|
||||||
|
{
|
||||||
|
int menu_eap_name_show;
|
||||||
|
int menu_eap_generic_show;
|
||||||
|
int menu_eap_comment_show;
|
||||||
|
|
||||||
|
/* Advanced */
|
||||||
|
double menus_scroll_speed;
|
||||||
|
double menus_fast_mouse_move_threshhold;
|
||||||
|
double menus_click_drag_timeout;
|
||||||
|
int menu_autoscroll_margin;
|
||||||
|
int menu_autoscroll_cursor_margin;
|
||||||
|
};
|
||||||
|
|
||||||
|
E_Config_Dialog *
|
||||||
|
e_int_config_menus(E_Container *con)
|
||||||
|
{
|
||||||
|
E_Config_Dialog *cfd;
|
||||||
|
E_Config_Dialog_View v;
|
||||||
|
|
||||||
|
v.create_cfdata = _create_data;
|
||||||
|
v.free_cfdata = _free_data;
|
||||||
|
v.basic.apply_cfdata = _basic_apply_data;
|
||||||
|
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, _("Menu Settings"), NULL, 0, &v, NULL);
|
||||||
|
return cfd;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_fill_data(CFData *cfdata)
|
||||||
|
{
|
||||||
|
cfdata->menu_eap_name_show = e_config->menu_eap_name_show;
|
||||||
|
cfdata->menu_eap_generic_show = e_config->menu_eap_generic_show;
|
||||||
|
cfdata->menu_eap_comment_show = e_config->menu_eap_comment_show;
|
||||||
|
cfdata->menus_scroll_speed = e_config->menus_scroll_speed;
|
||||||
|
cfdata->menus_fast_mouse_move_threshhold = e_config->menus_fast_mouse_move_threshhold;
|
||||||
|
cfdata->menus_click_drag_timeout = e_config->menus_click_drag_timeout;
|
||||||
|
cfdata->menu_autoscroll_margin = e_config->menu_autoscroll_margin;
|
||||||
|
cfdata->menu_autoscroll_cursor_margin = e_config->menu_autoscroll_cursor_margin;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void *
|
||||||
|
_create_data(E_Config_Dialog *cfd)
|
||||||
|
{
|
||||||
|
CFData *cfdata;
|
||||||
|
|
||||||
|
cfdata = E_NEW(CFData, 1);
|
||||||
|
_fill_data(cfdata);
|
||||||
|
return cfdata;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_free_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
free(cfdata);
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_basic_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
e_border_button_bindings_ungrab_all();
|
||||||
|
e_config->menu_eap_name_show = cfdata->menu_eap_name_show;
|
||||||
|
e_config->menu_eap_generic_show = cfdata->menu_eap_generic_show;
|
||||||
|
e_config->menu_eap_comment_show = cfdata->menu_eap_comment_show;
|
||||||
|
e_border_button_bindings_grab_all();
|
||||||
|
e_config_save_queue();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
|
||||||
|
{
|
||||||
|
Evas_Object *o, *of, *ob;
|
||||||
|
|
||||||
|
_fill_data(cfdata);
|
||||||
|
|
||||||
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
|
of = e_widget_framelist_add(evas, _("Menu Settings"), 0);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Name In Menu"), &(cfdata->menu_eap_name_show));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Comment In Menu"), &(cfdata->menu_eap_comment_show));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Generic In Menu"), &(cfdata->menu_eap_generic_show));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
return o;
|
||||||
|
}
|
||||||
|
|
||||||
|
static int
|
||||||
|
_advanced_apply_data(E_Config_Dialog *cfd, CFData *cfdata)
|
||||||
|
{
|
||||||
|
e_border_button_bindings_ungrab_all();
|
||||||
|
e_config->menu_eap_name_show = cfdata->menu_eap_name_show;
|
||||||
|
e_config->menu_eap_generic_show = cfdata->menu_eap_generic_show;
|
||||||
|
e_config->menu_eap_comment_show = cfdata->menu_eap_comment_show;
|
||||||
|
|
||||||
|
if (cfdata->menus_scroll_speed == 0)
|
||||||
|
{
|
||||||
|
e_config->menus_scroll_speed = 1.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e_config->menus_scroll_speed = cfdata->menus_scroll_speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (cfdata->menus_fast_mouse_move_threshhold == 0)
|
||||||
|
{
|
||||||
|
e_config->menus_fast_mouse_move_threshhold = 1.0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
e_config->menus_fast_mouse_move_threshhold = cfdata->menus_fast_mouse_move_threshhold;
|
||||||
|
}
|
||||||
|
|
||||||
|
e_config->menus_click_drag_timeout = cfdata->menus_click_drag_timeout;
|
||||||
|
e_config->menu_autoscroll_margin = cfdata->menu_autoscroll_margin;
|
||||||
|
e_config->menu_autoscroll_cursor_margin = cfdata->menu_autoscroll_cursor_margin;
|
||||||
|
e_border_button_bindings_grab_all();
|
||||||
|
e_config_save_queue();
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
static Evas_Object *
|
||||||
|
_advanced_create_widgets(E_Config_Dialog *cfd, Evas *evas, CFData *cfdata)
|
||||||
|
{
|
||||||
|
Evas_Object *o, *of, *ob;
|
||||||
|
|
||||||
|
_fill_data(cfdata);
|
||||||
|
|
||||||
|
o = e_widget_list_add(evas, 0, 0);
|
||||||
|
of = e_widget_framelist_add(evas, _("Menu Settings"), 0);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Name In Menu"), &(cfdata->menu_eap_name_show));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Comment In Menu"), &(cfdata->menu_eap_comment_show));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_check_add(evas, _("Show Generic In Menu"), &(cfdata->menu_eap_generic_show));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Autoscroll Settings"), 0);
|
||||||
|
ob = e_widget_label_add(evas, _("Autoscroll Margin"));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_slider_add(evas, 1, 0, _("%2.0f pixels"), 0, 50.0, 1.0, 0, NULL, &(cfdata->menu_autoscroll_margin), 200);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_label_add(evas, _("Autoscroll Cursor Margin"));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_slider_add(evas, 1, 0, _("%2.0f pixels"), 0, 50.0, 1.0, 0, NULL, &(cfdata->menu_autoscroll_cursor_margin), 200);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
of = e_widget_framelist_add(evas, _("Miscellaneous Options"), 0);
|
||||||
|
ob = e_widget_label_add(evas, _("Menu Scroll Speed"));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_slider_add(evas, 1, 0, _("%5.0f pixels/sec"), 0.0, 20000.0, 100.0, 0, &(cfdata->menus_scroll_speed), NULL, 200);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_label_add(evas, _("Fast Mouse Move Threshhold"));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_slider_add(evas, 1, 0, _("%4.0f pixels/sec"), 0.0, 2000.0, 10.0, 0, &(cfdata->menus_fast_mouse_move_threshhold), NULL, 200);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_label_add(evas, _("Click Drag Timeout"));
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
ob = e_widget_slider_add(evas, 1, 0, _("%2.1f seconds"), 0.0, 10.0, 0.5, 0, &(cfdata->menus_click_drag_timeout), NULL, 200);
|
||||||
|
e_widget_framelist_object_append(of, ob);
|
||||||
|
|
||||||
|
e_widget_list_object_append(o, of, 1, 1, 0.5);
|
||||||
|
|
||||||
|
return o;
|
||||||
|
}
|
|
@ -0,0 +1,9 @@
|
||||||
|
#ifdef E_TYPEDEFS
|
||||||
|
#else
|
||||||
|
#ifndef E_INT_CONFIG_MENUS_H
|
||||||
|
#define E_INT_CONFIG_MENUS_H
|
||||||
|
|
||||||
|
EAPI E_Config_Dialog *e_int_config_menus(E_Container *con);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
#endif
|
Loading…
Reference in New Issue