E_CONFIG_VAL(D, T, quick_nav, INT);
E_CONFIG_VAL(D, T, cmd_terminal, STR);
E_CONFIG_VAL(D, T, cmd_sudo, STR);
+ E_CONFIG_VAL(D, T, view_mode, INT);
+ E_CONFIG_VAL(D, T, view_zoom, INT);
+ E_CONFIG_VAL(D, T, cycle_mode, INT);
E_CONFIG_LIST(D, T, conf_subjects, conf_item_edd);
E_CONFIG_LIST(D, T, conf_actions, conf_item_edd);
E_CONFIG_LIST(D, T, conf_objects, conf_item_edd);
evry_conf->conf_views = NULL;
evry_conf->cmd_terminal = eina_stringshare_add("/usr/bin/xterm");
evry_conf->cmd_sudo = eina_stringshare_add("/usr/bin/gksudo --preserve-env");
+ evry_conf->view_mode = 0;
+ evry_conf->view_zoom = 0;
+ evry_conf->cycle_mode = 0;
}
+ /* TODO: remove - fix old configs */
if ((evry_conf->rel_x > 1.0) ||
(evry_conf->rel_x < 0.0))
evry_conf->rel_x = 0.5;
#include "e_mod_main.h"
-/* typedef struct _E_Config_Dialog_Data E_Config_Dialog_Data; */
-
static void *_create_data (E_Config_Dialog *cfd);
static void _free_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static int _basic_apply_data (E_Config_Dialog *cfd, E_Config_Dialog_Data *cfdata);
static Evas_Object *_basic_create_widgets (E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata);
-/* static int _subject = type_subject;
- * static int _action = type_action;
- * static int _object = type_object; */
struct _E_Config_Dialog_Data
char *cmd_terminal;
char *cmd_sudo;
+ int view_mode;
+ int view_zoom;
+ int cycle_mode;
+
Evas_Object *l_subject;
Evas_Object *l_action;
Evas_Object *l_object;
Eina_List *l;
Evry_Plugin *p;
- /* cfdata->scroll_animate = evry_conf->scroll_animate; */
- cfdata->height = evry_conf->height;
- cfdata->width = evry_conf->width;
- cfdata->hide_list = evry_conf->hide_list;
- cfdata->hide_input = evry_conf->hide_input;
- cfdata->quick_nav = evry_conf->quick_nav;
- cfdata->rel_x = evry_conf->rel_x;
- cfdata->rel_y = evry_conf->rel_y;
+#define C(_name) cfdata->_name = evry_conf->_name
+ C(height);
+ C(width);
+ C(hide_list);
+ C(hide_input);
+ C(quick_nav);
+ C(rel_x);
+ C(rel_y);
+ C(view_mode);
+ C(view_zoom);
+ C(cycle_mode);
+#undef C
EINA_LIST_FOREACH(evry_conf->plugins, l, p)
if (p->type == type_subject)
static int
_basic_apply_data(E_Config_Dialog *cfd __UNUSED__, E_Config_Dialog_Data *cfdata)
{
- /* evry_conf->scroll_animate = cfdata->scroll_animate; */
- evry_conf->width = cfdata->width;
- evry_conf->height = cfdata->height;
- evry_conf->hide_input = cfdata->hide_input;
- evry_conf->hide_list = cfdata->hide_list;
- evry_conf->quick_nav = cfdata->quick_nav;
- evry_conf->rel_x = cfdata->rel_x;
- evry_conf->rel_y = cfdata->rel_y;
-
- evry_conf->plugins = eina_list_sort(evry_conf->plugins,
- eina_list_count(evry_conf->plugins),
+
+#define C(_name) evry_conf->_name = cfdata->_name
+ C(height);
+ C(width);
+ C(hide_list);
+ C(hide_input);
+ C(quick_nav);
+ C(rel_x);
+ C(rel_y);
+ C(view_mode);
+ C(view_zoom);
+ C(cycle_mode);
+#undef C
+
+ evry_conf->plugins = eina_list_sort(evry_conf->plugins, -1,
_evry_cb_plugin_sort);
if (evry_conf->cmd_terminal)
_basic_create_widgets(E_Config_Dialog *cfd, Evas *evas, E_Config_Dialog_Data *cfdata)
{
Evas_Object *o, *of, *ob, *otb;
-
+ E_Radio_Group *rg;
+
otb = e_widget_toolbook_add(evas, 48 * e_scale, 48 * e_scale);
o = e_widget_list_add(evas, 0, 0);
ob = e_widget_check_add(evas, _("Quick Navigation (ALT + h,j,k,l,n,p,m,i)"),
&(cfdata->quick_nav));
e_widget_framelist_object_append(of, ob);
-
+ e_widget_list_object_append(o, of, 1, 1, 0.5);
+
+ of = e_widget_framelist_add(evas, _("Default View"), 0);
+ rg = e_widget_radio_group_new(&cfdata->view_mode);
+ ob = e_widget_radio_add(evas, "List", 0, rg);
+ e_widget_radio_toggle_set(ob, (cfdata->view_mode == 0));
+ e_widget_framelist_object_append(of, ob);
+ ob = e_widget_radio_add(evas, "Icons", 1, rg);
+ e_widget_radio_toggle_set(ob, (cfdata->view_mode == 1));
+ e_widget_framelist_object_append(of, ob);
+
+ ob = e_widget_check_add(evas, _("Up/Down select next item in icon view"),
+ &(cfdata->cycle_mode));
+ e_widget_framelist_object_append(of, ob);
+
+ e_widget_list_object_append(o, of, 1, 1, 0.5);
+
+ of = e_widget_framelist_add(evas, _("Commands"), 0);
ob = e_widget_label_add(evas, _("Terminal Command"));
e_widget_framelist_object_append(of, ob);
ob = e_widget_entry_add(evas, &(cfdata->cmd_terminal), NULL, NULL, NULL);
Evas_Object *bg, *sframe, *span;
int iw, ih;
int zoom;
- Eina_Bool list_mode : 1;
+ int list_mode;
};
/* smart object based on wallpaper module */
if (sd->items)
l = eina_list_data_find_list(sd->items, sd->cur_item);
- if (!v->list_mode)
+ if (!v->list_mode && !evry_conf->cycle_mode)
{
if (!strcmp(ev->key, "Right"))
{
{
if (!sd->items) return 1;
- EINA_LIST_FOREACH(l, ll, it)
+ if (!evry_conf->cycle_mode)
{
- if (it->y > sd->cur_item->y &&
- it->x >= sd->cur_item->x)
- break;
+ EINA_LIST_FOREACH(l, ll, it)
+ {
+ if (it->y > sd->cur_item->y &&
+ it->x >= sd->cur_item->x)
+ break;
+ }
}
if (!it && l && l->next)
{
if (!sd->items) return 1;
- EINA_LIST_REVERSE_FOREACH(l, ll, it)
+ if (!evry_conf->cycle_mode)
{
- if (it->y < sd->cur_item->y &&
- it->x <= sd->cur_item->x)
- break;
+ for(ll = l; ll; ll = ll->prev)
+ {
+ it = ll->data;
+
+ if (it->y < sd->cur_item->y &&
+ it->x <= sd->cur_item->x)
+ break;
+ }
}
if (!it && l && l->prev)
{
if (!v->list_mode)
{
- evry_browse_item(NULL);
- goto end;
+ if (evry_browse_item(NULL))
+ goto end;
}
}
v->state = s;
v->evas = evas_object_evas_get(swallow);
- v->list_mode = parent->list_mode;
+ printf("%d ---- %d\n", evry_conf->view_mode, parent->list_mode);
+
+ if (parent->list_mode < 0)
+ v->list_mode = evry_conf->view_mode;
+ else
+ v->list_mode = parent->list_mode;
+
v->zoom = parent->zoom;
-
v->bg = edje_object_add(v->evas);
e_theme_edje_object_set(v->bg, "base/theme/widgets",
"e/modules/everything/thumbview/main/window");
v->view.clear = &_view_clear;
v->view.cb_key_down = &_cb_key_down;
- /* TODO config option*/
- v->list_mode = EINA_TRUE;
+ v->list_mode = -1;
evry_view_register(EVRY_VIEW(v), 1);