parent
2bb063d443
commit
ed1dcddafb
|
@ -3854,6 +3854,15 @@ collections {
|
|||
tag: "link" "+ color=#800 underline=on underline_color=#8008";
|
||||
tag: "hilight" "+ font=Sans:style=Bold";
|
||||
}
|
||||
style { name: "entry_textblock_disabled_style";
|
||||
base: "font=Sans font_size=10 align=left color=#00000080 wrap=word";
|
||||
tag: "br" "\n";
|
||||
tag: "tab" "\t";
|
||||
tag: "em" "+ font=Sans:style=Oblique";
|
||||
tag: "b" "+ font=Sans:style=Bold";
|
||||
tag: "link" "+ color=#00000080 underline=on underline_color=#00000080";
|
||||
tag: "hilight" "+ font=Sans:style=Bold";
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "elm.text";
|
||||
|
@ -3875,6 +3884,13 @@ collections {
|
|||
min: 0 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_textblock_disabled_style";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
|
@ -3884,6 +3900,18 @@ collections {
|
|||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3905,6 +3933,13 @@ collections {
|
|||
min: 1 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_textblock_disabled_style";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
/*
|
||||
part { name: "sel";
|
||||
|
@ -3930,6 +3965,18 @@ collections {
|
|||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
/*
|
||||
program { name: "selmode0";
|
||||
signal: "elm,state,select,on";
|
||||
|
@ -3959,6 +4006,15 @@ collections {
|
|||
tag: "link" "+ color=#800 underline=on underline_color=#8008";
|
||||
tag: "hilight" "+ font=Sans:style=Bold";
|
||||
}
|
||||
style { name: "entry_single_textblock_disabled_style";
|
||||
base: "font=Sans font_size=10 align=left color=#00000080 wrap=none";
|
||||
tag: "br" "\n";
|
||||
tag: "tab" "\t";
|
||||
tag: "em" "+ font=Sans:style=Oblique";
|
||||
tag: "b" "+ font=Sans:style=Bold";
|
||||
tag: "link" "+ color=#00000080 underline=on underline_color=#00000080";
|
||||
tag: "hilight" "+ font=Sans:style=Bold";
|
||||
}
|
||||
}
|
||||
parts {
|
||||
part { name: "elm.text";
|
||||
|
@ -3977,6 +4033,13 @@ collections {
|
|||
min: 1 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_single_textblock_disabled_style";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
|
@ -3986,6 +4049,18 @@ collections {
|
|||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4006,6 +4081,13 @@ collections {
|
|||
min: 1 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_single_textblock_disabled_style";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
|
@ -4015,6 +4097,18 @@ collections {
|
|||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4035,6 +4129,13 @@ collections {
|
|||
min: 0 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_textblock_disabled_style";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
|
@ -4044,6 +4145,18 @@ collections {
|
|||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4064,6 +4177,13 @@ collections {
|
|||
min: 1 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_textblock_disabled_style";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
|
@ -4073,6 +4193,18 @@ collections {
|
|||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -4095,6 +4227,13 @@ collections {
|
|||
min: 1 1;
|
||||
}
|
||||
}
|
||||
description { state: "disabled" 0.0;
|
||||
inherit: "default" 0.0;
|
||||
text {
|
||||
style: "entry_single_textblock_disabled_style";
|
||||
min: 0 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
programs {
|
||||
|
@ -4104,6 +4243,18 @@ collections {
|
|||
action: FOCUS_SET;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "disable";
|
||||
signal: "elm,state,disabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "disabled" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
program { name: "enable";
|
||||
signal: "elm,state,enabled";
|
||||
source: "elm";
|
||||
action: STATE_SET "default" 0.0;
|
||||
target: "elm.text";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -32,6 +32,13 @@ my_entry_bt_4(void *data, Evas_Object *obj, void *event_info)
|
|||
elm_entry_entry_insert(en, "Insert some <b>BOLD</> text");
|
||||
}
|
||||
|
||||
static void
|
||||
anchor_test(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Object *en = data;
|
||||
elm_entry_entry_insert(en, "ANCHOR CLICKED");
|
||||
}
|
||||
|
||||
void
|
||||
test_entry(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
@ -114,7 +121,7 @@ test_entry(void *data, Evas_Object *obj, void *event_info)
|
|||
void
|
||||
test_entry_scrolled(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Evas_Object *win, *bg, *bx, *bx2, *bt, *en, *sc;
|
||||
Evas_Object *win, *bg, *bx, *bx2, *bt, *en, *sc, *sp;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
win = elm_win_add(NULL, "entry-scrolled", ELM_WIN_BASIC);
|
||||
|
@ -138,6 +145,67 @@ test_entry_scrolled(void *data, Evas_Object *obj, void *event_info)
|
|||
evas_object_size_hint_align_set(sc, -1.0, -1.0);
|
||||
elm_box_pack_end(bx, sc);
|
||||
|
||||
en = elm_entry_add(win);
|
||||
elm_entry_single_line_set(en, 1);
|
||||
elm_entry_entry_set(en, "Disabled entry");
|
||||
evas_object_size_hint_weight_set(en, 1.0, 0.0);
|
||||
evas_object_size_hint_align_set(en, -1.0, 0.0);
|
||||
elm_object_disabled_set(en, 1);
|
||||
elm_scroller_content_set(sc, en);
|
||||
evas_object_show(en);
|
||||
|
||||
evas_object_show(sc);
|
||||
|
||||
sc = elm_scroller_add(win);
|
||||
elm_scroller_content_min_limit(sc, 0, 1);
|
||||
elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
|
||||
evas_object_size_hint_weight_set(sc, 1.0, 0.0);
|
||||
evas_object_size_hint_align_set(sc, -1.0, -1.0);
|
||||
elm_box_pack_end(bx, sc);
|
||||
|
||||
en = elm_entry_add(win);
|
||||
elm_entry_password_set(en, 1);
|
||||
elm_entry_entry_set(en, "Access denied, give up!");
|
||||
evas_object_size_hint_weight_set(en, 1.0, 0.0);
|
||||
evas_object_size_hint_align_set(en, -1.0, 0.0);
|
||||
elm_object_disabled_set(en, 1);
|
||||
elm_scroller_content_set(sc, en);
|
||||
evas_object_show(en);
|
||||
|
||||
evas_object_show(sc);
|
||||
|
||||
sc = elm_scroller_add(win);
|
||||
evas_object_size_hint_weight_set(sc, 1.0, 1.0);
|
||||
evas_object_size_hint_align_set(sc, -1.0, -1.0);
|
||||
elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_ON, ELM_SCROLLER_POLICY_ON);
|
||||
elm_box_pack_end(bx, sc);
|
||||
|
||||
en = elm_entry_add(win);
|
||||
elm_entry_entry_set(en,
|
||||
"Multi-line disabled entry widget :)<br>"
|
||||
"We can use markup <b>like this</> for styling and<br>"
|
||||
"formatting <em>like this</>, as well as<br>"
|
||||
"<a href=X><link>links in the text</></a>, but it won't be editable or clickable.");
|
||||
evas_object_size_hint_weight_set(en, 1.0, 1.0);
|
||||
evas_object_size_hint_align_set(en, -1.0, -1.0);
|
||||
elm_object_disabled_set(en, 1);
|
||||
elm_scroller_content_set(sc, en);
|
||||
evas_object_show(en);
|
||||
|
||||
evas_object_show(sc);
|
||||
|
||||
sp = elm_separator_add(win);
|
||||
elm_separator_horizontal_set(sp, 1);
|
||||
elm_box_pack_end(bx, sp);
|
||||
evas_object_show(sp);
|
||||
|
||||
sc = elm_scroller_add(win);
|
||||
elm_scroller_content_min_limit(sc, 0, 1);
|
||||
elm_scroller_policy_set(sc, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
|
||||
evas_object_size_hint_weight_set(sc, 1.0, 0.0);
|
||||
evas_object_size_hint_align_set(sc, -1.0, -1.0);
|
||||
elm_box_pack_end(bx, sc);
|
||||
|
||||
en = elm_entry_add(win);
|
||||
elm_entry_single_line_set(en, 1);
|
||||
elm_entry_entry_set(en, "This is a single line");
|
||||
|
@ -181,6 +249,7 @@ test_entry_scrolled(void *data, Evas_Object *obj, void *event_info)
|
|||
"in here to edit it. By the way, links are<br>"
|
||||
"called <a href=anc-02>Anchors</a> so you will need<br>"
|
||||
"to refer to them this way. At the end here is a really long line to test line wrapping to see if it works. But just in case this line is not long enough I will add more here to really test it out, as Elementary really needs some good testing to see if entry widgets work as advertised.");
|
||||
evas_object_smart_callback_add(en, "anchor,clicked", anchor_test, en);
|
||||
evas_object_size_hint_weight_set(en, 1.0, 1.0);
|
||||
evas_object_size_hint_align_set(en, -1.0, -1.0);
|
||||
elm_scroller_content_set(sc, en);
|
||||
|
|
|
@ -773,7 +773,7 @@ extern "C" {
|
|||
// * table doesnt do homogenous properly
|
||||
//
|
||||
//// (incomplete - medium priority)
|
||||
// * disabled supported only for buttons & toolbar items atm
|
||||
// * need to add support for disabled in all widgets. Button, toolbar and entry are currently done.
|
||||
// * on the fly theme changes - test (should work)
|
||||
// * need a hold-scroll counter in elm_widget
|
||||
// * hoversel only vertical right now - make horizontal
|
||||
|
|
|
@ -24,10 +24,12 @@ struct _Widget_Data
|
|||
Eina_Bool have_selection : 1;
|
||||
Eina_Bool selmode : 1;
|
||||
Eina_Bool deferred_cur : 1;
|
||||
Eina_Bool disabled : 1;
|
||||
};
|
||||
|
||||
static void _del_hook(Evas_Object *obj);
|
||||
static void _theme_hook(Evas_Object *obj);
|
||||
static void _disable_hook(Evas_Object *obj);
|
||||
static void _sizing_eval(Evas_Object *obj);
|
||||
static void _on_focus_hook(void *data, Evas_Object *obj);
|
||||
static void _resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
@ -71,6 +73,22 @@ _theme_hook(Evas_Object *obj)
|
|||
_sizing_eval(obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_disable_hook(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
if (elm_widget_disabled_get(obj))
|
||||
{
|
||||
edje_object_signal_emit(wd->ent, "elm,state,disabled", "elm");
|
||||
wd->disabled = EINA_TRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
edje_object_signal_emit(wd->ent, "elm,state,enabled", "elm");
|
||||
wd->disabled = EINA_FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_win_recalc_job(void *data)
|
||||
{
|
||||
|
@ -820,7 +838,8 @@ _signal_anchor_up(void *data, Evas_Object *obj, const char *emission, const char
|
|||
}
|
||||
}
|
||||
}
|
||||
evas_object_smart_callback_call(data, "anchor,clicked", &ei);
|
||||
if (!wd->disabled)
|
||||
evas_object_smart_callback_call(data, "anchor,clicked", &ei);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -910,10 +929,12 @@ elm_entry_add(Evas_Object *parent)
|
|||
elm_widget_data_set(obj, wd);
|
||||
elm_widget_del_hook_set(obj, _del_hook);
|
||||
elm_widget_theme_hook_set(obj, _theme_hook);
|
||||
elm_widget_disable_hook_set(obj, _disable_hook);
|
||||
elm_widget_can_focus_set(obj, 1);
|
||||
|
||||
wd->linewrap = EINA_TRUE;
|
||||
wd->editable = EINA_TRUE;
|
||||
wd->disabled = EINA_FALSE;
|
||||
|
||||
wd->ent = edje_object_add(e);
|
||||
evas_object_event_callback_add(wd->ent, EVAS_CALLBACK_MOVE, _move, obj);
|
||||
|
|
Loading…
Reference in New Issue