entrance: Changed the Settingspane

- Themeselector & Log is a new place in the segment control. It is less
  confusing if there is just one place where you can click throuw the
  settings!

- Moved background and general Settings back into one pane.
This commit is contained in:
Marcel Hollerbach 2014-04-06 21:21:08 +02:00
parent a772692121
commit 1539a34296
8 changed files with 222 additions and 130 deletions

View File

@ -20,6 +20,10 @@ entrance_conf.h \
entrance_conf.c \
entrance_conf_main.h \
entrance_conf_main.c \
entrance_conf_theme.h \
entrance_conf_theme.c \
entrance_conf_log.h \
entrance_conf_log.c \
entrance_conf_user.h \
entrance_conf_user.c \
entrance_connect.h \

View File

@ -14,6 +14,8 @@
#include "entrance_fill.h"
#include "entrance_conf.h"
#include "entrance_conf_main.h"
#include "entrance_conf_log.h"
#include "entrance_conf_theme.h"
#include "entrance_conf_user.h"
#include "entrance_connect.h"
#include "entrance_client.h"

View File

@ -209,6 +209,8 @@ entrance_conf_init(void)
entrance_conf_main_init();
entrance_conf_user_init();
entrance_conf_theme_init();
entrance_conf_log_init();
}
void
@ -219,6 +221,8 @@ entrance_conf_shutdown(void)
PT("conf shutdown\n");
entrance_conf_user_shutdown();
entrance_conf_main_shutdown();
entrance_conf_theme_shutdown();
entrance_conf_log_shutdown();
EINA_LIST_FREE(_entrance_conf->modules, conf)
{
eina_stringshare_del(conf->label);

View File

@ -0,0 +1,62 @@
#include "entrance_client.h"
static void _entrance_conf_log_begin(void);
static void _entrance_conf_log_end(void);
static Evas_Object *_entrance_conf_log_build(Evas_Object *obj);
static Eina_Bool _entrance_conf_log_check(void);
static void _entrance_conf_log_apply(void);
static void
_entrance_conf_log_begin(void)
{
}
static void
_entrance_conf_log_end(void)
{
}
static Evas_Object *
_entrance_conf_log_build(Evas_Object *obj)
{
Evas_Object *o;
/* Graphical Log */
o = elm_label_add(obj);
elm_object_text_set(o, "TODO Implement graphical Log !");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
return o;
}
static Eina_Bool
_entrance_conf_log_check(void)
{
return 0;
}
static void
_entrance_conf_log_apply(void)
{
}
void
entrance_conf_log_init(void)
{
PT("conf grapical log init\n");
entrance_conf_module_register("Log",
_entrance_conf_log_begin,
_entrance_conf_log_end,
_entrance_conf_log_build,
_entrance_conf_log_check,
_entrance_conf_log_apply);
}
void
entrance_conf_log_shutdown(void)
{
PT("conf log shutdown\n");
}

View File

@ -0,0 +1,7 @@
#ifndef ENTRANCE_CONF_LOG_H_
#define ENTRANCE_CONF_LOG_H_
void entrance_conf_log_init(void);
void entrance_conf_log_shutdown(void);
#endif /* ENTRANCE_CONF_MAIN_H_ */

View File

@ -102,31 +102,78 @@ _entrance_conf_scale_changed(void *data EINA_UNUSED, Evas_Object *obj, void *eve
entrance_conf_changed();
}
static void
_entrance_conf_toolbar_click(void *data, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
static Evas_Object *
_entrance_conf_main_build(Evas_Object *obj)
{
Evas_Object *o = data, *old;
Evas_Object *tb, *bx_over, *o, *bx, *t;
Eina_List *s_bg, *t_bg, *tmp = NULL, *node = NULL;
Eina_List *childs = elm_box_children_get(_entrance_int_conf_main->display_area);
old = eina_list_data_get(childs);
elm_box_unpack(_entrance_int_conf_main->display_area, old);
evas_object_hide(old);
elm_box_pack_end(_entrance_int_conf_main->display_area, o);
/*Main Frame*/
o = bx_over = elm_box_add(obj);
elm_box_horizontal_set(o, EINA_TRUE);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(o);
}
static Evas_Object*
_entrance_conf_main_general(Evas_Object *obj)
{
Evas_Object *t, *o;
o = tb = elm_toolbar_add(obj);
evas_object_size_hint_weight_set(o, 0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_toolbar_horizontal_set(o, EINA_FALSE);
elm_toolbar_select_mode_set(o, ELM_OBJECT_SELECT_MODE_ALWAYS);
elm_toolbar_shrink_mode_set(o, ELM_TOOLBAR_SHRINK_SCROLL);
elm_toolbar_homogeneous_set(o, EINA_FALSE);
elm_box_pack_end(bx_over, o);
evas_object_show(o);
o = bx = elm_box_add(obj);
elm_box_horizontal_set(o, EINA_FALSE);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx_over, o);
evas_object_show(o);
o = elm_label_add(obj);
elm_object_text_set(o, "Background");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_gengrid_add(obj);
elm_gengrid_item_size_set(o,
elm_config_scale_get() * 150,
elm_config_scale_get() * 150);
elm_gengrid_group_item_size_set(o,
elm_config_scale_get() * 31,
elm_config_scale_get() * 31);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, o);
evas_object_show(o);
s_bg = entrance_gui_background_pool_get();
t_bg = entrance_gui_theme_backgrounds();
#define LIST_FILL(list) \
tmp = NULL; \
IMG_LIST_FORK(list, tmp); \
entrance_fill(o, entrance_conf_background_fill_get(),\
tmp, _entrance_conf_bg_fill_cb,\
_entrance_conf_bg_sel, o);
LIST_FILL(s_bg);
LIST_FILL(t_bg);
#undef LIST_FILL
/* General */
t = elm_table_add(obj);
elm_table_padding_set(t, 0, 0);
evas_object_size_hint_weight_set(t, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_weight_set(t, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(t, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, t);
evas_object_show(t);
/* Touch Screen */
o = elm_label_add(obj);
@ -189,121 +236,6 @@ _entrance_conf_main_general(Evas_Object *obj)
elm_table_pack(t, o, 1, 2, 1, 1);
evas_object_show(o);
return t;
}
static Evas_Object*
_entrance_conf_main_background(Evas_Object *obj)
{
Evas_Object *o, *bx;
Eina_List *s_bg, *t_bg, *tmp = NULL, *node = NULL;
o = bx = elm_box_add(obj);
elm_box_horizontal_set(o, EINA_FALSE);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
o = elm_label_add(obj);
elm_object_text_set(o, "Background");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, o);
evas_object_show(o);
o = elm_gengrid_add(obj);
elm_gengrid_item_size_set(o,
elm_config_scale_get() * 150,
elm_config_scale_get() * 150);
elm_gengrid_group_item_size_set(o,
elm_config_scale_get() * 31,
elm_config_scale_get() * 31);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx, o);
evas_object_show(o);
s_bg = entrance_gui_background_pool_get();
t_bg = entrance_gui_theme_backgrounds();
#define LIST_FILL(list) \
tmp = NULL; \
IMG_LIST_FORK(list, tmp); \
entrance_fill(o, entrance_conf_background_fill_get(),\
tmp, _entrance_conf_bg_fill_cb,\
_entrance_conf_bg_sel, o);
LIST_FILL(s_bg);
LIST_FILL(t_bg);
#undef LIST_FILL
return bx;
}
static Evas_Object*
_entrance_conf_main_themesel(Evas_Object *obj)
{
Evas_Object *o;
/* Theme selector */
o = elm_label_add(obj);
elm_object_text_set(o, "TODO Implement theme selector!");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
return o;
}
static Evas_Object*
_entrance_conf_main_graph_log(Evas_Object *obj)
{
Evas_Object *o;
/* Graphical Log */
o = elm_label_add(obj);
elm_object_text_set(o, "TODO Implement Graphical Log !");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
return o;
}
static Evas_Object *
_entrance_conf_main_build(Evas_Object *obj)
{
Evas_Object *tb, *bx_over, *o, *bx;
/*Main Frame*/
o = bx_over = elm_box_add(obj);
elm_box_horizontal_set(o, EINA_TRUE);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_show(o);
o = tb = elm_toolbar_add(obj);
evas_object_size_hint_weight_set(o, 0, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_toolbar_horizontal_set(o, EINA_FALSE);
elm_toolbar_select_mode_set(o, ELM_OBJECT_SELECT_MODE_ALWAYS);
elm_toolbar_shrink_mode_set(o, ELM_TOOLBAR_SHRINK_SCROLL);
elm_toolbar_homogeneous_set(o, EINA_FALSE);
elm_box_pack_end(bx_over, o);
evas_object_show(o);
o = bx = elm_box_add(obj);
elm_box_horizontal_set(o, EINA_TRUE);
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
elm_box_pack_end(bx_over, o);
evas_object_show(o);
_entrance_int_conf_main->display_area = o;
elm_toolbar_item_append(tb, NULL, "General",
_entrance_conf_toolbar_click, _entrance_conf_main_general(obj));
elm_toolbar_item_append(tb, NULL, "Background",
_entrance_conf_toolbar_click, _entrance_conf_main_background(obj));
elm_toolbar_item_append(tb, NULL, "Theme",
_entrance_conf_toolbar_click, _entrance_conf_main_themesel(obj));
elm_toolbar_item_append(tb, NULL, "Log",
_entrance_conf_toolbar_click, _entrance_conf_main_graph_log(obj));
return bx_over;
}

View File

@ -0,0 +1,74 @@
#include "entrance_client.h"
typedef struct Entrance_Int_Conf_Theme_
{
const char *theme;
} Entrance_Int_Conf_Theme;
static void _entrance_conf_theme_begin(void);
static void _entrance_conf_theme_end(void);
static Evas_Object *_entrance_conf_theme_build(Evas_Object *obj);
static Eina_Bool _entrance_conf_theme_check(void);
static void _entrance_conf_theme_apply(void);
static Entrance_Int_Conf_Theme *_entrance_int_conf_theme = NULL;
static void
_entrance_conf_theme_begin(void)
{
_entrance_int_conf_theme = calloc(1, sizeof(Entrance_Int_Conf_Theme));
_entrance_int_conf_theme->theme = entrance_gui_theme_name_get();
}
static void
_entrance_conf_theme_end(void)
{
free(_entrance_int_conf_theme);
}
static Evas_Object *
_entrance_conf_theme_build(Evas_Object *obj)
{
Evas_Object *o;
/* Graphical Log */
o = elm_label_add(obj);
elm_object_text_set(o, "TODO Implement Theme Selector !");
evas_object_size_hint_weight_set(o, EVAS_HINT_EXPAND, 0);
evas_object_size_hint_align_set(o, EVAS_HINT_FILL, EVAS_HINT_FILL);
return o;
}
static Eina_Bool
_entrance_conf_theme_check(void)
{
return !!((_entrance_int_conf_theme->theme != entrance_gui_theme_name_get()));
}
static void
_entrance_conf_theme_apply(void)
{
//TODO save the correct theme
}
void
entrance_conf_theme_init(void)
{
PT("conf theme init\n");
entrance_conf_module_register("Theme Selector",
_entrance_conf_theme_begin,
_entrance_conf_theme_end,
_entrance_conf_theme_build,
_entrance_conf_theme_check,
_entrance_conf_theme_apply);
}
void
entrance_conf_theme_shutdown(void)
{
PT("conf theme shutdown\n");
}

View File

@ -0,0 +1,7 @@
#ifndef ENTRANCE_CONF_THEME_H_
#define ENTRANCE_CONF_THEME_H_
void entrance_conf_theme_init(void);
void entrance_conf_theme_shutdown(void);
#endif /* ENTRANCE_CONF_MAIN_H_ */