forked from enlightenment/efl
efl_ui/popup: remove text_alert class
this can now be done by simply calling efl_ui_widget_scrollable_content_scrollable_text_set on an alert popup tests have been adjusted for this Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9677
This commit is contained in:
parent
1d2d15bbf8
commit
f64a0966dc
|
@ -558,7 +558,7 @@ efl_ui_text_alert_popup_clicked_cb(void *data EINA_UNUSED, const Efl_Event *ev)
|
|||
Efl_Ui_Alert_Popup_Button_Clicked_Event *event = ev->info;
|
||||
|
||||
if (event->button_type == EFL_UI_ALERT_POPUP_BUTTON_POSITIVE)
|
||||
efl_text_set(ev->object, "Text is changed");
|
||||
efl_ui_widget_scrollable_text_set(ev->object, "Text is changed");
|
||||
else
|
||||
efl_del(ev->object);
|
||||
}
|
||||
|
@ -575,10 +575,10 @@ static void
|
|||
_alert_text_case1_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, "This is Text Popup");
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, "This is Text Popup");
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -593,7 +593,7 @@ static void
|
|||
_alert_text_case2_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 50);
|
||||
|
@ -601,7 +601,7 @@ _alert_text_case2_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|||
efl_gfx_hint_size_min_set(efl_ui_popup, EINA_SIZE2D(200, 200));
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -616,13 +616,13 @@ static void
|
|||
_alert_text_case3_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
efl_gfx_hint_size_min_set(efl_ui_popup, EINA_SIZE2D(200, 200));
|
||||
efl_gfx_hint_size_max_set(efl_ui_popup, EINA_SIZE2D(300, 300));
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, "This is Text Popup");
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, "This is Text Popup");
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -635,12 +635,12 @@ static void
|
|||
_alert_text_case4_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
efl_gfx_hint_size_min_set(efl_ui_popup, EINA_SIZE2D(200, 200));
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, "This is Text Popup");
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, "This is Text Popup");
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -655,10 +655,10 @@ static void
|
|||
_alert_text_case5_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, "This is Text Popup");
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, "This is Text Popup");
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -674,13 +674,13 @@ static void
|
|||
_alert_text_case6_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 50);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -699,7 +699,7 @@ static void
|
|||
_alert_text_case7_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 50);
|
||||
|
@ -707,7 +707,7 @@ _alert_text_case7_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
|||
efl_gfx_hint_size_min_set(efl_ui_popup, EINA_SIZE2D(200, 200));
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -724,13 +724,13 @@ static void
|
|||
_alert_text_case8_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 50);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -749,13 +749,13 @@ static void
|
|||
_alert_text_case9_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 50);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -774,13 +774,13 @@ static void
|
|||
_alert_text_case10_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 10);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -799,13 +799,13 @@ static void
|
|||
_alert_text_case11_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 10);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -824,13 +824,13 @@ static void
|
|||
_alert_text_case12_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 10);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -849,13 +849,13 @@ static void
|
|||
_alert_text_case13_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 20);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
@ -874,13 +874,13 @@ static void
|
|||
_alert_text_case14_cb(void *data, const Efl_Event *ev EINA_UNUSED)
|
||||
{
|
||||
Eo *win = data;
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_TEXT_ALERT_POPUP_CLASS, win);
|
||||
Eo *efl_ui_popup= efl_add(EFL_UI_ALERT_POPUP_CLASS, win);
|
||||
|
||||
Eina_Strbuf *message_buf = eina_strbuf_new();
|
||||
create_message(message_buf, "This is Text Popup ", 50);
|
||||
|
||||
efl_text_set(efl_part(efl_ui_popup, "title"), "title");
|
||||
efl_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
efl_ui_widget_scrollable_text_set(efl_ui_popup, eina_strbuf_string_get(message_buf));
|
||||
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_POSITIVE, "Yes", NULL);
|
||||
efl_ui_alert_popup_button_set(efl_ui_popup, EFL_UI_ALERT_POPUP_BUTTON_NEGATIVE, "No", NULL);
|
||||
|
|
|
@ -268,7 +268,6 @@ typedef Eo Efl_Ui_Spotlight_Indicator;
|
|||
# include <efl_ui_multi_selectable.eo.h>
|
||||
# include <efl_ui_popup.eo.h>
|
||||
# include <efl_ui_alert_popup.eo.h>
|
||||
# include <efl_ui_text_alert_popup.eo.h>
|
||||
# include <efl_ui_popup_part_backwall.eo.h>
|
||||
# include <efl_ui_grid.eo.h>
|
||||
# include <efl_ui_list.eo.h>
|
||||
|
|
|
@ -311,7 +311,6 @@ typedef Eo Efl_Ui_Focus_Manager;
|
|||
# include <efl_ui_text.eo.h>
|
||||
# include <efl_ui_popup.eo.h>
|
||||
# include <efl_ui_alert_popup.eo.h>
|
||||
# include <efl_ui_text_alert_popup.eo.h>
|
||||
# include <efl_ui_popup_part_backwall.eo.h>
|
||||
# include <efl_ui_text_factory_images.eo.h>
|
||||
# include <efl_ui_text_factory_emoticons.eo.h>
|
||||
|
|
|
@ -1,274 +0,0 @@
|
|||
#ifdef HAVE_CONFIG_H
|
||||
# include "elementary_config.h"
|
||||
#endif
|
||||
|
||||
#define EFL_PART_PROTECTED
|
||||
|
||||
#include <Elementary.h>
|
||||
|
||||
#include "elm_priv.h"
|
||||
#include "efl_ui_popup_private.h"
|
||||
#include "efl_ui_text_alert_popup_private.h"
|
||||
#include "efl_ui_text_alert_popup_part.eo.h"
|
||||
#include "elm_part_helper.h"
|
||||
|
||||
#define MY_CLASS EFL_UI_TEXT_ALERT_POPUP_CLASS
|
||||
#define MY_CLASS_NAME "Efl.Ui.Text_Alert_Popup"
|
||||
|
||||
//static const char PART_NAME_TEXT[] = "text";
|
||||
|
||||
static void
|
||||
_scroller_sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, Eina_Size2D obj_min, Eina_Size2D text_min)
|
||||
{
|
||||
Eina_Size2D max_size, min_size;
|
||||
|
||||
max_size = efl_gfx_hint_size_max_get(obj);
|
||||
|
||||
if (max_size.w != -1)
|
||||
max_size.w = (obj_min.w > max_size.w) ? obj_min.w : max_size.w;
|
||||
if (max_size.h != -1)
|
||||
max_size.h = (obj_min.h > max_size.h) ? obj_min.h : max_size.h;
|
||||
|
||||
min_size = efl_gfx_hint_size_min_get(obj);
|
||||
|
||||
Eina_Size2D size;
|
||||
size.w = (obj_min.w > min_size.w) ? obj_min.w : min_size.w;
|
||||
size.h = (obj_min.h > min_size.h) ? obj_min.h : min_size.h;
|
||||
|
||||
text_min.w = (obj_min.w > text_min.w) ? obj_min.w : text_min.w;
|
||||
text_min.h = (obj_min.h > text_min.h) ? obj_min.h : text_min.h;
|
||||
|
||||
Eina_Size2D new_min = obj_min;
|
||||
|
||||
if ((max_size.w == -1) && (max_size.h == -1))
|
||||
{
|
||||
efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE);
|
||||
efl_gfx_entity_size_set(obj, size);
|
||||
}
|
||||
else if ((max_size.w == -1) && (max_size.h != -1))
|
||||
{
|
||||
if (max_size.h < text_min.h)
|
||||
{
|
||||
efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE);
|
||||
size = EINA_SIZE2D(size.w, max_size.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
new_min.h = text_min.h;
|
||||
efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_TRUE);
|
||||
size = EINA_SIZE2D(size.w, text_min.h);
|
||||
}
|
||||
}
|
||||
else if ((max_size.w != -1) && (max_size.h == -1))
|
||||
{
|
||||
if (max_size.w < text_min.w)
|
||||
{
|
||||
efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE);
|
||||
size = EINA_SIZE2D(max_size.w, size.h);
|
||||
}
|
||||
else
|
||||
{
|
||||
new_min.w = text_min.w;
|
||||
efl_ui_scrollable_match_content_set(pd->scroller, EINA_TRUE, EINA_FALSE);
|
||||
size = EINA_SIZE2D(text_min.w, size.h);
|
||||
}
|
||||
}
|
||||
else if ((max_size.w != -1) && (max_size.h != -1))
|
||||
{
|
||||
Eina_Size2D new_size;
|
||||
Eina_Bool min_limit_w = EINA_FALSE;
|
||||
Eina_Bool min_limit_h = EINA_FALSE;
|
||||
|
||||
if (max_size.w < text_min.w)
|
||||
{
|
||||
new_size.w = max_size.w;
|
||||
}
|
||||
else
|
||||
{
|
||||
min_limit_w = EINA_TRUE;
|
||||
new_min.w = text_min.w;
|
||||
new_size.w = text_min.w;
|
||||
}
|
||||
|
||||
if (max_size.h < text_min.h)
|
||||
{
|
||||
new_size.h = max_size.h;
|
||||
}
|
||||
else
|
||||
{
|
||||
min_limit_h = EINA_TRUE;
|
||||
new_min.h = text_min.h;
|
||||
new_size.h = text_min.h;
|
||||
}
|
||||
|
||||
efl_ui_scrollable_match_content_set(pd->scroller, min_limit_w, min_limit_h);
|
||||
size = new_size;
|
||||
}
|
||||
efl_gfx_entity_size_set(obj, size);
|
||||
efl_canvas_group_calculate(pd->scroller);
|
||||
|
||||
efl_gfx_hint_size_restricted_min_set(obj, new_min);
|
||||
}
|
||||
|
||||
static void
|
||||
_sizing_eval(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
|
||||
Evas_Coord obj_minw = -1, obj_minh = -1;
|
||||
Evas_Coord text_minw = -1, text_minh = -1;
|
||||
Eina_Size2D text_min;
|
||||
|
||||
//Calculate popup's min size including scroller's min size
|
||||
{
|
||||
elm_label_line_wrap_set(pd->message, ELM_WRAP_NONE);
|
||||
efl_canvas_group_calculate(pd->message);
|
||||
text_min = efl_gfx_hint_size_combined_min_get(pd->message);
|
||||
elm_label_line_wrap_set(pd->message, ELM_WRAP_MIXED);
|
||||
efl_canvas_group_calculate(pd->message);
|
||||
|
||||
efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_TRUE);
|
||||
efl_canvas_group_calculate(pd->scroller);
|
||||
|
||||
elm_coords_finger_size_adjust(1, &text_minw, 1, &text_minh);
|
||||
edje_object_size_min_restricted_calc
|
||||
(wd->resize_obj, &text_minw, &text_minh, text_minw, text_minh);
|
||||
}
|
||||
|
||||
//Calculate popup's min size except scroller's min size
|
||||
{
|
||||
efl_ui_scrollable_match_content_set(pd->scroller, EINA_FALSE, EINA_FALSE);
|
||||
efl_canvas_group_calculate(pd->scroller);
|
||||
|
||||
elm_coords_finger_size_adjust(1, &obj_minw, 1, &obj_minh);
|
||||
edje_object_size_min_restricted_calc
|
||||
(wd->resize_obj, &obj_minw, &obj_minh, obj_minw, obj_minh);
|
||||
}
|
||||
|
||||
text_min.h = text_minh;
|
||||
_scroller_sizing_eval(obj, pd, EINA_SIZE2D(obj_minw, obj_minh), text_min);
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_text_alert_popup_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd)
|
||||
{
|
||||
EFL_UI_POPUP_DATA_GET_OR_RETURN(obj, ppd);
|
||||
ppd->in_calc = EINA_TRUE;
|
||||
_sizing_eval(obj, pd);
|
||||
efl_canvas_group_need_recalculate_set(pd->scroller, EINA_FALSE);
|
||||
efl_canvas_group_need_recalculate_set(obj, EINA_FALSE);
|
||||
|
||||
efl_canvas_group_calculate(efl_super(obj, MY_CLASS));
|
||||
ppd->in_calc = EINA_FALSE;
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_efl_ui_text_alert_popup_content_set(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd EINA_UNUSED, const char *part, Eo *content)
|
||||
{
|
||||
return efl_content_set(efl_part(efl_super(obj, MY_CLASS), part), content);
|
||||
}
|
||||
|
||||
Eo *
|
||||
_efl_ui_text_alert_popup_content_get(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd EINA_UNUSED, const char *part)
|
||||
{
|
||||
return efl_content_get(efl_part(efl_super(obj, MY_CLASS), part));
|
||||
}
|
||||
|
||||
static Eo *
|
||||
_efl_ui_text_alert_popup_content_unset(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd EINA_UNUSED, const char *part)
|
||||
{
|
||||
return efl_content_unset(efl_part(efl_super(obj, MY_CLASS), part));
|
||||
}
|
||||
|
||||
static Eina_Bool
|
||||
_efl_ui_text_alert_popup_text_set(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, const char *part, const char *label)
|
||||
{
|
||||
if (part && !strcmp(part, "efl.text"))
|
||||
{
|
||||
if (!pd->message)
|
||||
{
|
||||
// TODO: Change internal component to Efl.Ui.Widget
|
||||
pd->message = elm_label_add(obj);
|
||||
//elm_widget_element_update(obj, pd->message, PART_NAME_TEXT);
|
||||
efl_gfx_hint_weight_set(pd->message, EVAS_HINT_EXPAND,
|
||||
EVAS_HINT_EXPAND);
|
||||
efl_content_set(pd->scroller, pd->message);
|
||||
}
|
||||
elm_object_text_set(pd->message, label);
|
||||
efl_canvas_group_change(obj);
|
||||
}
|
||||
else
|
||||
efl_text_set(efl_part(efl_super(obj, MY_CLASS), part), label);
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
const char *
|
||||
_efl_ui_text_alert_popup_text_get(const Eo *obj EINA_UNUSED, Efl_Ui_Text_Alert_Popup_Data *pd, const char *part)
|
||||
{
|
||||
if (part && !strcmp(part, "efl.text"))
|
||||
{
|
||||
if (pd->message)
|
||||
return elm_object_text_get(pd->message);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return efl_text_get(efl_part(efl_super(obj, MY_CLASS), part));
|
||||
}
|
||||
|
||||
EOLIAN static void
|
||||
_efl_ui_text_alert_popup_efl_text_text_set(Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd, const char *label)
|
||||
{
|
||||
_efl_ui_text_alert_popup_text_set(obj, pd, "efl.text", label);
|
||||
}
|
||||
|
||||
EOLIAN static const char*
|
||||
_efl_ui_text_alert_popup_efl_text_text_get(const Eo *obj, Efl_Ui_Text_Alert_Popup_Data *pd)
|
||||
{
|
||||
return _efl_ui_text_alert_popup_text_get(obj, pd, "efl.text");
|
||||
}
|
||||
|
||||
EOLIAN static Eo *
|
||||
_efl_ui_text_alert_popup_efl_object_constructor(Eo *obj,
|
||||
Efl_Ui_Text_Alert_Popup_Data *pd)
|
||||
{
|
||||
ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd, NULL);
|
||||
|
||||
if (!elm_widget_theme_klass_get(obj))
|
||||
elm_widget_theme_klass_set(obj, "text_alert_popup");
|
||||
obj = efl_constructor(efl_super(obj, MY_CLASS));
|
||||
efl_canvas_object_type_set(obj, MY_CLASS_NAME);
|
||||
|
||||
pd->scroller = efl_add(EFL_UI_SCROLLER_CLASS, obj,
|
||||
efl_ui_widget_style_set(efl_added, "popup/no_inset_shadow"),
|
||||
efl_ui_scrollbar_bar_mode_set(efl_added, EFL_UI_SCROLLBAR_MODE_OFF, EFL_UI_SCROLLBAR_MODE_AUTO));
|
||||
|
||||
efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.content"),
|
||||
pd->scroller);
|
||||
|
||||
return obj;
|
||||
}
|
||||
|
||||
/* Efl.Part begin */
|
||||
|
||||
static Eina_Bool
|
||||
_part_is_efl_ui_text_alert_popup_part(const Eo *obj EINA_UNUSED, const char *part)
|
||||
{
|
||||
//Use Efl.Ui.Widget's "background" and "shadow" parts
|
||||
if (eina_streq(part, "background") || eina_streq(part, "shadow"))
|
||||
return EINA_FALSE;
|
||||
|
||||
return EINA_TRUE;
|
||||
}
|
||||
|
||||
ELM_PART_OVERRIDE_PARTIAL(efl_ui_text_alert_popup, EFL_UI_TEXT_ALERT_POPUP, Efl_Ui_Text_Alert_Popup_Data, _part_is_efl_ui_text_alert_popup_part)
|
||||
ELM_PART_OVERRIDE_CONTENT_SET(efl_ui_text_alert_popup, EFL_UI_TEXT_ALERT_POPUP, Efl_Ui_Text_Alert_Popup_Data)
|
||||
ELM_PART_OVERRIDE_CONTENT_GET(efl_ui_text_alert_popup, EFL_UI_TEXT_ALERT_POPUP, Efl_Ui_Text_Alert_Popup_Data)
|
||||
ELM_PART_OVERRIDE_CONTENT_UNSET(efl_ui_text_alert_popup, EFL_UI_TEXT_ALERT_POPUP, Efl_Ui_Text_Alert_Popup_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_SET(efl_ui_text_alert_popup, EFL_UI_TEXT_ALERT_POPUP, Efl_Ui_Text_Alert_Popup_Data)
|
||||
ELM_PART_OVERRIDE_TEXT_GET(efl_ui_text_alert_popup, EFL_UI_TEXT_ALERT_POPUP, Efl_Ui_Text_Alert_Popup_Data)
|
||||
#include "efl_ui_text_alert_popup_part.eo.c"
|
||||
|
||||
/* Efl.Part end */
|
||||
|
||||
#include "efl_ui_text_alert_popup.eo.c"
|
|
@ -1,12 +0,0 @@
|
|||
import eina_types;
|
||||
|
||||
class @beta Efl.Ui.Text_Alert_Popup extends Efl.Ui.Alert_Popup implements Efl.Text
|
||||
{
|
||||
[[EFL UI Text Alert Popup class]]
|
||||
implements {
|
||||
Efl.Object.constructor;
|
||||
Efl.Canvas.Group.group_calculate;
|
||||
Efl.Text.text { get; set; }
|
||||
Efl.Part.part_get;
|
||||
}
|
||||
}
|
|
@ -1,10 +0,0 @@
|
|||
class @beta Efl.Ui.Text_Alert_Popup_Part extends Efl.Ui.Layout_Part implements Efl.Content, Efl.Text
|
||||
{
|
||||
[[Efl UI Text Alert Popup internal part class]]
|
||||
data: null;
|
||||
implements {
|
||||
Efl.Content.content { get; set; }
|
||||
Efl.Content.content_unset;
|
||||
Efl.Text.text { get; set; }
|
||||
}
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
#ifndef EFL_UI_TEXT_ALERT_POPUP_H
|
||||
#define EFL_UI_TEXT_ALERT_POPUP_H
|
||||
|
||||
#include "Elementary.h"
|
||||
|
||||
typedef struct _Efl_Ui_Text_Alert_Popup_Data Efl_Ui_Text_Alert_Popup_Data;
|
||||
struct _Efl_Ui_Text_Alert_Popup_Data
|
||||
{
|
||||
Eo *scroller;
|
||||
Eo *message;
|
||||
};
|
||||
|
||||
#endif
|
|
@ -84,8 +84,6 @@ pub_eo_files = [
|
|||
'efl_ui_popup_part_backwall.eo',
|
||||
'efl_ui_alert_popup.eo',
|
||||
'efl_ui_alert_popup_part.eo',
|
||||
'efl_ui_text_alert_popup.eo',
|
||||
'efl_ui_text_alert_popup_part.eo',
|
||||
'efl_ui_text_editable.eo',
|
||||
'efl_ui_text_async.eo',
|
||||
'efl_ui_text_factory_images.eo',
|
||||
|
@ -308,7 +306,6 @@ elementary_headers_unstable = [
|
|||
'efl_ui_widget_image.h',
|
||||
'efl_ui_popup_private.h',
|
||||
'efl_ui_alert_popup_private.h',
|
||||
'efl_ui_text_alert_popup_private.h',
|
||||
'elm_widget_index.h',
|
||||
'elm_widget_inwin.h',
|
||||
'elm_widget_label.h',
|
||||
|
@ -868,7 +865,6 @@ elementary_src = [
|
|||
'efl_ui_box_private.h',
|
||||
'efl_ui_popup.c',
|
||||
'efl_ui_alert_popup.c',
|
||||
'efl_ui_text_alert_popup.c',
|
||||
'efl_ui_table.c',
|
||||
'efl_ui_table_static.c',
|
||||
'efl_ui_table_layout.c',
|
||||
|
|
|
@ -445,7 +445,7 @@ EFL_END_TEST
|
|||
|
||||
EFL_START_TEST(efl_ui_test_popup_text_alert)
|
||||
{
|
||||
Eo *popup = _popup_alert_setup(EFL_UI_TEXT_ALERT_POPUP_CLASS);
|
||||
Eo *popup = _popup_alert_setup(EFL_UI_ALERT_POPUP_CLASS);
|
||||
char test_string[] = "This is Text Popup";
|
||||
unsigned int string_counts[] =
|
||||
{
|
||||
|
@ -510,12 +510,12 @@ EFL_START_TEST(efl_ui_test_popup_text_alert)
|
|||
for (j = 0; j < string_counts[i]; j++)
|
||||
eina_strbuf_append(buf, test_string);
|
||||
|
||||
efl_text_set(popup, eina_strbuf_string_get(buf));
|
||||
efl_ui_widget_scrollable_text_set(popup, eina_strbuf_string_get(buf));
|
||||
efl_gfx_hint_size_max_set(popup, test_expands[i]);
|
||||
efl_canvas_group_calculate(popup);
|
||||
|
||||
/* get internal label object: VERY illegal */
|
||||
scroller = efl_content_get(efl_part(efl_super(popup, efl_ui_text_alert_popup_class_get()), "efl.content"));
|
||||
scroller = efl_content_get(efl_part(efl_super(popup, EFL_UI_ALERT_POPUP_CLASS), "efl.content"));
|
||||
label = efl_content_get(scroller);
|
||||
|
||||
/* label should never be larger than scroller horizontally
|
||||
|
|
Loading…
Reference in New Issue