forked from enlightenment/efl
efl.ui.progressbar: change signal name for icon/text
Summary: see also 73f8b3b78f
Test Plan:
1. elementary_test -to progressbar
and elementary_test -to efl.ui.progressbar
2. check that icon and text are visible
Reviewers: cedric, woohyun, Jaehyun_Cho
Reviewed By: Jaehyun_Cho
Differential Revision: https://phab.enlightenment.org/D5818
This commit is contained in:
parent
160b6d202f
commit
403c014bd2
File diff suppressed because it is too large
Load Diff
|
@ -109,6 +109,7 @@ elm_public_eolian_files += \
|
|||
lib/elementary/efl_ui_button_legacy_part.eo \
|
||||
lib/elementary/efl_ui_radio_legacy_part.eo \
|
||||
lib/elementary/efl_ui_check_legacy_part.eo \
|
||||
lib/elementary/efl_ui_progressbar_legacy_part.eo \
|
||||
lib/elementary/elm_spinner.eo \
|
||||
lib/elementary/elm_multibuttonentry_item.eo \
|
||||
lib/elementary/elm_interface_scrollable.eo \
|
||||
|
|
|
@ -113,6 +113,7 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf
|
|||
{
|
||||
Eo *win, *bx, *btbx;
|
||||
pbdata *pd;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
pd = (pbdata *)calloc(1, sizeof(pbdata));
|
||||
|
||||
|
@ -135,6 +136,12 @@ test_ui_progressbar(void *data EINA_UNUSED, Eo *obj EINA_UNUSED, void *event_inf
|
|||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(250, 20))
|
||||
);
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
|
||||
efl_add(EFL_UI_IMAGE_CLASS, pd->pb1,
|
||||
efl_file_set(efl_added, buf, NULL),
|
||||
efl_content_set(pd->pb1, efl_added)
|
||||
);
|
||||
|
||||
pd->pb2 = efl_add(EFL_UI_PROGRESSBAR_CLASS, bx,
|
||||
efl_pack(bx, efl_added),
|
||||
efl_text_set(efl_added, "10-100"),
|
||||
|
|
|
@ -169,41 +169,6 @@ _efl_ui_progressbar_elm_layout_sizing_eval(Eo *obj, Efl_Ui_Progressbar_Data *_pd
|
|||
evas_object_size_hint_max_set(obj, -1, -1);
|
||||
}
|
||||
|
||||
/* FIXME: replicated from elm_layout just because progressbar's icon
|
||||
* spot is elm.swallow.content, not elm.swallow.icon. Fix that
|
||||
* whenever we can changed the theme API */
|
||||
static void
|
||||
_icon_signal_emit(Evas_Object *obj)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
if (!elm_widget_resize_object_get(obj)) return;
|
||||
snprintf(buf, sizeof(buf), "elm,state,icon,%s",
|
||||
elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
|
||||
|
||||
elm_layout_signal_emit(obj, buf, "elm");
|
||||
}
|
||||
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_progressbar_efl_ui_widget_widget_sub_object_del(Eo *obj, Efl_Ui_Progressbar_Data *pd EINA_UNUSED, Evas_Object *sobj)
|
||||
{
|
||||
if (!efl_ui_widget_sub_object_del(efl_super(obj, MY_CLASS), sobj))
|
||||
return EINA_FALSE;
|
||||
|
||||
_icon_signal_emit(obj);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_efl_ui_progressbar_efl_ui_widget_widget_sub_object_add(Eo *obj, Efl_Ui_Progressbar_Data *pd EINA_UNUSED, Evas_Object *sobj)
|
||||
{
|
||||
if (!efl_ui_widget_sub_object_add(efl_super(obj, MY_CLASS), sobj))
|
||||
return EINA_FALSE;
|
||||
|
||||
_icon_signal_emit(obj);
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
//TODO: efl_ui_slider also use this.
|
||||
static const char *
|
||||
_theme_group_modify_pos_get(const char *cur_group, const char *search, size_t len, Eina_Bool is_legacy)
|
||||
|
@ -307,11 +272,6 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *
|
|||
_units_set(obj);
|
||||
_val_set(obj);
|
||||
|
||||
/* FIXME: replicated from elm_layout just because progressbar's
|
||||
* icon spot is elm.swallow.content, not elm.swallow.icon. Fix that
|
||||
* whenever we can changed the theme API */
|
||||
_icon_signal_emit(obj);
|
||||
|
||||
edje_object_message_signal_process(wd->resize_obj);
|
||||
|
||||
elm_layout_sizing_eval(obj);
|
||||
|
@ -745,6 +705,7 @@ ELM_LAYOUT_TEXT_ALIASES_IMPLEMENT(efl_ui_progressbar)
|
|||
#include "efl_ui_progressbar.eo.c"
|
||||
|
||||
#include "efl_ui_progressbar_legacy.eo.h"
|
||||
#include "efl_ui_progressbar_legacy_part.eo.h"
|
||||
|
||||
#define MY_CLASS_NAME_LEGACY "elm_progressbar"
|
||||
|
||||
|
@ -762,6 +723,84 @@ _efl_ui_progressbar_legacy_efl_object_constructor(Eo *obj, void *pd EINA_UNUSED)
|
|||
return obj;
|
||||
}
|
||||
|
||||
/* FIXME: replicated from elm_layout just because progressbar's icon spot
|
||||
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||
* can changed the theme API */
|
||||
static void
|
||||
_icon_signal_emit(Evas_Object *obj)
|
||||
{
|
||||
char buf[64];
|
||||
|
||||
if (!elm_widget_resize_object_get(obj)) return;
|
||||
snprintf(buf, sizeof(buf), "elm,state,icon,%s",
|
||||
elm_layout_content_get(obj, "icon") ? "visible" : "hidden");
|
||||
|
||||
elm_layout_signal_emit(obj, buf, "elm");
|
||||
edje_object_message_signal_process(elm_layout_edje_get(obj));
|
||||
elm_layout_sizing_eval(obj);
|
||||
}
|
||||
|
||||
/* FIXME: replicated from elm_layout just because progressbar's icon spot
|
||||
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||
* can changed the theme API */
|
||||
EOLIAN static Efl_Ui_Theme_Apply
|
||||
_efl_ui_progressbar_legacy_efl_ui_widget_theme_apply(Eo *obj, void *_pd EINA_UNUSED)
|
||||
{
|
||||
Efl_Ui_Theme_Apply int_ret = EFL_UI_THEME_APPLY_FAILED;
|
||||
|
||||
int_ret = efl_ui_widget_theme_apply(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS));
|
||||
if (!int_ret) return EFL_UI_THEME_APPLY_FAILED;
|
||||
_icon_signal_emit(obj);
|
||||
|
||||
return int_ret;
|
||||
}
|
||||
|
||||
/* FIXME: replicated from elm_layout just because progressbar's icon spot
|
||||
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||
* can changed the theme API */
|
||||
EOLIAN static Eina_Bool
|
||||
_efl_ui_progressbar_legacy_efl_ui_widget_widget_sub_object_del(Eo *obj, void *_pd EINA_UNUSED, Evas_Object *sobj)
|
||||
{
|
||||
Eina_Bool int_ret = EINA_FALSE;
|
||||
|
||||
int_ret = elm_widget_sub_object_del(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), sobj);
|
||||
if (!int_ret) return EINA_FALSE;
|
||||
|
||||
_icon_signal_emit(obj);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
/* FIXME: replicated from elm_layout just because progressbar's icon spot
|
||||
* is elm.swallow.content, not elm.swallow.icon. Fix that whenever we
|
||||
* can changed the theme API */
|
||||
static Eina_Bool
|
||||
_efl_ui_progressbar_legacy_content_set(Eo *obj, void *_pd EINA_UNUSED, const char *part, Evas_Object *content)
|
||||
{
|
||||
Eina_Bool int_ret = EINA_FALSE;
|
||||
|
||||
int_ret = efl_content_set(efl_part(efl_super(obj, EFL_UI_PROGRESSBAR_LEGACY_CLASS), part), content);
|
||||
if (!int_ret) return EINA_FALSE;
|
||||
|
||||
_icon_signal_emit(obj);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
/* Efl.Part for legacy begin */
|
||||
|
||||
static Eina_Bool
|
||||
_part_is_efl_ui_progressbar_legacy_part(const Eo *obj EINA_UNUSED, const char *part)
|
||||
{
|
||||
return eina_streq(part, "elm.swallow.content");
|
||||
}
|
||||
|
||||
ELM_PART_OVERRIDE_PARTIAL(efl_ui_progressbar_legacy, EFL_UI_PROGRESSBAR_LEGACY, void, _part_is_efl_ui_progressbar_legacy_part)
|
||||
ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_progressbar_legacy, EFL_UI_PROGRESSBAR_LEGACY, void)
|
||||
#include "efl_ui_progressbar_legacy_part.eo.c"
|
||||
|
||||
/* Efl.Part for legacy end */
|
||||
|
||||
EAPI Evas_Object *
|
||||
elm_progressbar_add(Evas_Object *parent)
|
||||
{
|
||||
|
|
|
@ -51,8 +51,6 @@ class Efl.Ui.Progressbar (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Format,
|
|||
implements {
|
||||
Efl.Object.constructor;
|
||||
Efl.Ui.Widget.theme_apply;
|
||||
Efl.Ui.Widget.widget_sub_object_add;
|
||||
Efl.Ui.Widget.widget_sub_object_del;
|
||||
Efl.Ui.Range.range_value { get; set; }
|
||||
Efl.Ui.Range.range_min_max {get; set; }
|
||||
Efl.Ui.Direction.direction { get; set; }
|
||||
|
|
|
@ -5,5 +5,8 @@ class Efl.Ui.Progressbar_Legacy (Efl.Ui.Progressbar, Efl.Ui.Legacy)
|
|||
implements {
|
||||
class.constructor;
|
||||
Efl.Object.constructor;
|
||||
Efl.Ui.Widget.theme_apply;
|
||||
Efl.Ui.Widget.widget_sub_object_del;
|
||||
Efl.Part.part;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
class Efl.Ui.Progressbar_Legacy.Part (Efl.Ui.Layout.Part_Content)
|
||||
{
|
||||
[[Elementary progressbar internal part class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Content.content { set; }
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue