name: "bg";
type: RECT;
mouse_events: 0;
- scale: 1;
clip_to: "clipper";
- description { state: "default" 0.0;
+ description {
+ state: "default" 0.0;
rel1 {
relative: 0.5 0.0;
to: "day0";
type: SWALLOW;
scale: 1;
clip_to: "clipper";
- description { state: "default" 0.0;
+ description {
+ state: "default" 0.0;
visible: 0;
min: 0 0;
align: 0.0 0.5;
fixed: 1 0;
- rel2 {
- relative: 0.0 1.0;
- }
+ rel2.relative: 0.0 1.0;
}
- description { state: "visible" 0.0;
+ description {
+ state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
min: 40 25;
part {
name: "clipper";
type: RECT;
- description { state: "default" 0.0;
- rel1 {
- relative: 0.0 0.0;
- to: "day0";
- }
- rel2 {
- relative: 1.0 1.0;
- to: "day6";
- }
+ description {
+ state: "default" 0.0;
+ rel1.to: "day0";
+ rel2.to: "day6";
color: 255 255 255 255;
}
- description { state: "visible" 0.0;
+ description {
+ state: "visible" 0.0;
inherit: "default" 0.0;
color: 200 200 200 255;
}
part {
name: "disabler";
type: RECT;
- description { state: "default" 0.0;
+ description {
+ state: "default" 0.0;
color: 0 0 0 0;
visible: 0;
}
- description { state: "visible" 0.0;
+ description {
+ state: "visible" 0.0;
inherit: "default" 0.0;
visible: 1;
}
public check_state = DAYSELECOR_DAY_STATE_DEFAULT; // Default, Pressed, Selected.
public check_bg_show() {
- if(get_int(check_pos) == DAYSELECOR_DAY_POS_LEFT)
- {
- if(get_int(check_state) == DAYSELECOR_DAY_STATE_DEFAULT)
- set_state(PART:"bg", "default_left", 0.0);
- else if(get_int(check_state) == DAYSELECOR_DAY_STATE_PRESSED)
- set_state(PART:"bg", "pressed_left", 0.0);
- else if(get_int(check_state) == DAYSELECOR_DAY_STATE_SELECTED)
- set_state(PART:"bg", "selected_left", 0.0);
- }
- else if(get_int(check_pos) == DAYSELECOR_DAY_POS_RIGHT)
- {
- if(get_int(check_state) == DAYSELECOR_DAY_STATE_DEFAULT)
- set_state(PART:"bg", "default_right", 0.0);
- else if(get_int(check_state) == DAYSELECOR_DAY_STATE_PRESSED)
- set_state(PART:"bg", "pressed_right", 0.0);
- else if(get_int(check_state) == DAYSELECOR_DAY_STATE_SELECTED)
- set_state(PART:"bg", "selected_right", 0.0);
- }
- else if(get_int(check_pos) == DAYSELECOR_DAY_POS_MIDDLE)
- {
- if(get_int(check_state) == DAYSELECOR_DAY_STATE_DEFAULT)
- set_state(PART:"bg", "default_middle", 0.0);
- else if(get_int(check_state) == DAYSELECOR_DAY_STATE_PRESSED)
- set_state(PART:"bg", "pressed_middle", 0.0);
- else if(get_int(check_state) == DAYSELECOR_DAY_STATE_SELECTED)
- set_state(PART:"bg", "selected_middle", 0.0);
+ if(get_int(check_pos) == DAYSELECOR_DAY_POS_LEFT) {
+ if(get_int(check_state) == DAYSELECOR_DAY_STATE_DEFAULT)
+ set_state(PART:"bg", "default_left", 0.0);
+ else if(get_int(check_state) == DAYSELECOR_DAY_STATE_PRESSED)
+ set_state(PART:"bg", "pressed_left", 0.0);
+ else if(get_int(check_state) == DAYSELECOR_DAY_STATE_SELECTED)
+ set_state(PART:"bg", "selected_left", 0.0);
+ }
+ else if(get_int(check_pos) == DAYSELECOR_DAY_POS_RIGHT) {
+ if(get_int(check_state) == DAYSELECOR_DAY_STATE_DEFAULT)
+ set_state(PART:"bg", "default_right", 0.0);
+ else if(get_int(check_state) == DAYSELECOR_DAY_STATE_PRESSED)
+ set_state(PART:"bg", "pressed_right", 0.0);
+ else if(get_int(check_state) == DAYSELECOR_DAY_STATE_SELECTED)
+ set_state(PART:"bg", "selected_right", 0.0);
+ }
+ else if(get_int(check_pos) == DAYSELECOR_DAY_POS_MIDDLE) {
+ if(get_int(check_state) == DAYSELECOR_DAY_STATE_DEFAULT)
+ set_state(PART:"bg", "default_middle", 0.0);
+ else if(get_int(check_state) == DAYSELECOR_DAY_STATE_PRESSED)
+ set_state(PART:"bg", "pressed_middle", 0.0);
+ else if(get_int(check_state) == DAYSELECOR_DAY_STATE_SELECTED)
+ set_state(PART:"bg", "selected_middle", 0.0);
}
}
public check_text_show() {
- if(get_int(check_state) == DAYSELECOR_DAY_STATE_SELECTED)
- set_state(PART:"elm.text", "selected", 0.0);
- else
- {
- if(get_int(check_type) == DAYSELECOR_DAY_TYPE_WEEKDAY)
+ if(get_int(check_state) == DAYSELECOR_DAY_STATE_SELECTED)
+ set_state(PART:"elm.text", "selected", 0.0);
+ else {
+ if(get_int(check_type) == DAYSELECOR_DAY_TYPE_WEEKDAY)
set_state(PART:"elm.text", "default", 0.0);
- else if (get_int(check_type) == DAYSELECOR_DAY_TYPE_WEEKEND_DEFAULT)
+ else if (get_int(check_type) == DAYSELECOR_DAY_TYPE_WEEKEND_DEFAULT)
set_state(PART:"elm.text", "weekend_default", 0.0);
- else if (get_int(check_type) == DAYSELECOR_DAY_TYPE_WEEKEND_STYLE1)
+ else if (get_int(check_type) == DAYSELECOR_DAY_TYPE_WEEKEND_STYLE1)
set_state(PART:"elm.text", "weekend_style1", 0.0);
- }
+ }
}
}
parts {
description {
state: "weekend_default" 0.0;
inherit: "default" 0.0;
- color: 8 96 170 255;
+ color: 225 49 8 255;
}
description {
state: "weekend_style1" 0.0;
inherit: "default" 0.0;
- color: 225 49 8 255;
+ color: 8 96 170 255;
}
description {
state: "selected" 0.0;
ignore_flags: ON_HOLD;
description {
state: "default" 0.0;
- rel1 {
- to: "bg";
- }
- rel2 {
- to: "bg";
- }
+ rel1.to: "bg";
+ rel2.to: "bg";
color: 0 0 0 0;
}
}
Evas_Object *obj __UNUSED__, void *event_info __UNUSED__);
static void _disable_hook(Evas_Object *obj);
static Eina_Bool _focus_next_hook(const Evas_Object *obj,
- Elm_Focus_Direction dir __UNUSED__, Evas_Object **next __UNUSED__);
+ Elm_Focus_Direction dir __UNUSED__,
+ Evas_Object **next __UNUSED__);
static void _mirrored_set(Evas_Object *obj, Eina_Bool rtl);
static void _translate_hook(Evas_Object *obj);
static void _theme_hook(Evas_Object *obj);
-static void _item_text_set_hook(Evas_Object *obj, const char *item, const char *label);
-static const char *_item_text_get_hook(const Evas_Object *obj, const char *item);
-static void _content_set_hook(Evas_Object *obj, const char *item, Evas_Object *content);
+static void _item_text_set_hook(Evas_Object *obj, const char *item,
+ const char *label);
+static const char *_item_text_get_hook(const Evas_Object *obj,
+ const char *item);
+static void _content_set_hook(Evas_Object *obj, const char *item,
+ Evas_Object *content);
static Evas_Object *_content_get_hook(const Evas_Object *obj, const char *item);
static Evas_Object *_content_unset_hook(Evas_Object *obj, const char *item);
static void _signal_emit_cb(void *data, Evas_Object *obj, const char *emission,
- const char *source __UNUSED__);
-static void _item_clicked_cb(void *data, Evas_Object *obj, void *event_info __UNUSED__);
-static Elm_Dayselector_Item * _item_find(const Evas_Object *obj, Elm_Dayselector_Day day);
+ const char *source __UNUSED__);
+static void _item_clicked_cb(void *data, Evas_Object *obj,
+ void *event_info __UNUSED__);
+static Elm_Dayselector_Item * _item_find(const Evas_Object *obj,
+ Elm_Dayselector_Day day);
static void _items_style_set(Evas_Object *obj);
static void _update_items(Evas_Object *obj);
static void _create_items(Evas_Object *obj);
eina_stringshare_del(it->day_style);
elm_widget_item_free(it);
}
-
free(wd);
}
_elm_widget_mirrored_reload(obj);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
- _elm_theme_object_set(obj, wd->base, "dayselector", "base", elm_widget_style_get(obj));
+ _elm_theme_object_set(obj, wd->base, "dayselector", "base",
+ elm_widget_style_get(obj));
EINA_LIST_FOREACH(wd->items, l, it)
{
EINA_LIST_FOREACH(wd->items, l, it)
{
- if (obj == VIEW(it))
- {
- evas_object_smart_callback_call(data, SIG_CHANGED, (void *)it->day);
- return ;
- }
+ if (obj != VIEW(it)) continue;
+ evas_object_smart_callback_call(data, SIG_CHANGED, (void *)it->day);
+ return;
}
}
if (weekend_last >= wd->weekend_start)
{
if ((it->day >= wd->weekend_start) && (it->day <= weekend_last))
- eina_stringshare_replace(&it->day_style, ITEM_TYPE_WEEKEND_DEFAULT);
+ eina_stringshare_replace(&it->day_style,
+ ITEM_TYPE_WEEKEND_DEFAULT);
else
- eina_stringshare_replace(&it->day_style, ITEM_TYPE_WEEKDAY_DEFAULT);
+ eina_stringshare_replace(&it->day_style,
+ ITEM_TYPE_WEEKDAY_DEFAULT);
}
else
{
if ((it->day >= wd->weekend_start) || (it->day <= weekend_last))
- eina_stringshare_replace(&it->day_style, ITEM_TYPE_WEEKEND_DEFAULT);
+ eina_stringshare_replace(&it->day_style,
+ ITEM_TYPE_WEEKEND_DEFAULT);
else
- eina_stringshare_replace(&it->day_style, ITEM_TYPE_WEEKDAY_DEFAULT);
+ eina_stringshare_replace(&it->day_style,
+ ITEM_TYPE_WEEKDAY_DEFAULT);
}
}
}
t = time(NULL);
localtime_r(&t, &time_daysel);
+
for (idx = 0; idx < ELM_DAYSELECTOR_MAX; idx++)
{
it = elm_widget_item_new(obj, Elm_Dayselector_Item);
edje_object_part_swallow(wd->base, buf, VIEW(it));
snprintf(buf, sizeof(buf), "day%d,visible", idx);
edje_object_signal_emit(wd->base, buf, "elm");
- evas_object_smart_callback_add(VIEW(it), "changed", _item_clicked_cb, obj);
- evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_DEL, _item_del_cb, obj);
- elm_object_signal_callback_add(VIEW(it), ITEM_TYPE_WEEKDAY_DEFAULT, "", _signal_emit_cb, obj);
- elm_object_signal_callback_add(VIEW(it), ITEM_TYPE_WEEKDAY_STYLE1, "", _signal_emit_cb, obj);
- elm_object_signal_callback_add(VIEW(it), ITEM_TYPE_WEEKEND_DEFAULT, "", _signal_emit_cb, obj);
- elm_object_signal_callback_add(VIEW(it), ITEM_TYPE_WEEKEND_STYLE1, "", _signal_emit_cb, obj);
+ evas_object_smart_callback_add(VIEW(it), "changed", _item_clicked_cb,
+ obj);
+ evas_object_event_callback_add(VIEW(it), EVAS_CALLBACK_DEL,
+ _item_del_cb, obj);
+ elm_object_signal_callback_add(VIEW(it), ITEM_TYPE_WEEKDAY_DEFAULT, "",
+ _signal_emit_cb, obj);
+ elm_object_signal_callback_add(VIEW(it), ITEM_TYPE_WEEKDAY_STYLE1, "",
+ _signal_emit_cb, obj);
+ elm_object_signal_callback_add(VIEW(it), ITEM_TYPE_WEEKEND_DEFAULT, "",
+ _signal_emit_cb, obj);
+ elm_object_signal_callback_add(VIEW(it), ITEM_TYPE_WEEKEND_STYLE1, "",
+ _signal_emit_cb, obj);
}
_items_style_set(obj);
_update_items(obj);
elm_widget_content_set_hook_set(obj, _content_set_hook);
elm_widget_content_get_hook_set(obj, _content_get_hook);
elm_widget_content_unset_hook_set(obj, _content_unset_hook);
+
wd->base = edje_object_add(e);
_elm_theme_object_set(obj, wd->base, "dayselector", "base", "default");
elm_object_style_set(wd->base, "dayselector");
wd->week_start = _elm_config->week_start;
wd->weekend_start = _elm_config->weekend_start;
wd->weekend_len = _elm_config->weekend_len;
+ printf("%d %d %d\n", wd->week_start, wd->weekend_start, wd->weekend_len);
_create_items(obj);
- evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE, _dayselector_resize, obj);
+ evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
+ _dayselector_resize, obj);
evas_object_smart_callbacks_descriptions_set(obj, _signals);
_mirrored_set(obj, elm_widget_mirrored_get(obj));
_sizing_eval(obj);
EINA_LIST_FOREACH(wd->items, l, it)
{
loc = (ELM_DAYSELECTOR_MAX - wd->week_start + it->day) % ELM_DAYSELECTOR_MAX;
+ printf("%d\n", loc);
snprintf(buf, sizeof(buf), "day%d", loc);
edje_object_part_swallow(wd->base, buf, VIEW(it));
}