mouse_events: 0;
description {
state: "default" 0.0;
- min: 30 0;
+ min: 0 0;
fixed: 1 0;
rel1{relative: 0.0 0.0; to: "entry.main.bg";}
rel2{relative: 0.0 1.0; to: "entry.main.bg";}
mouse_events: 0;
description {
state: "default" 0.0;
- min: 17 0;
+ min: 0 0;
fixed: 1 0;
rel1{relative: 1.0 0.0; to: "entry.main.bg";}
rel2{relative: 1.0 1.0; to: "entry.main.bg";}
min: 0 MSG_COMPOSER_RECIPIENT_TO_FIELD_MIN_H;
max: -1 -1;
rel1 { to_x: "entry_padding_left"; to_y: "entry_padding_top"; relative: 1.0 1.0; }
- rel2 { to_x: "contact_padding_left"; to_y: "entry_padding_bottom"; relative: 0.0 0.0; }
- }
- description {
- state: "show_with_invalid_icon" 0.0;
- inherit: "default" 0.0;
- min: 0 MSG_COMPOSER_RECIPIENT_TO_FIELD_MIN_H;
- max: -1 -1;
- rel1 { to_x: "entry_padding_left"; to_y: "entry_padding_top"; relative: 1.0 1.0;}
- rel2 { to_x: "img.invalid_icon"; to_y: "entry_padding_bottom"; relative: 0.0 0.0; }
- }
- }
- part {
- name: "bottom_line";
- type: RECT;
- scale: 1;
- repeat_events: 1;
- description {
- state: "default" 0.0;
- rel1 { to: "swl.entry"; relative: 0.0 0.0; }
- rel2 { to: "swl.entry"; relative: 1.0 1.0; }
- min: 0 3;
- max: -1 3;
- fixed: 1 1;
- align: 0.0 1.0;
- color: 0 0 0 51;
- visible: 0;
- }
- description {
- state: "show" 0.0;
- inherit: "default" 0.0;
- visible: 1;
+ rel2 { to_x: "swl.contact_btn"; to_y: "entry_padding_bottom"; relative: 0.0 0.0; }
}
}
part {
state: "default" 0.0;
min: 0 0;
fixed: 1 0;
- rel1{relative: 0.0 0.0; to: "rect.btn";}
- rel2{relative: 0.0 1.0; to: "rect.btn";}
+ rel1{relative: 0.0 0.0; to: "swl.contact_btn";}
+ rel2{relative: 0.0 1.0; to: "swl.contact_btn";}
align: 1.0 0.0;
}
}
target: "swl.entry";
target: "entry.main.bg";
target: "swl.contact_btn";
- target: "bottom_line";
}
program {
name: "hide_entry";
target: "swl.entry";
target: "entry.main.bg";
target: "swl.contact_btn";
- target: "bottom_line";
}
program {
name: "show_invalid_icon";
void showButton(ButtonType buttonType);
void setEditMode(bool isEdit);
void showInvalidIcon(bool show);
+ void showClearButton(bool show);
private:
// Out signals:
void onBtnUnpressed(Evas_Object *obj, void *event_info);
void onContactBtnClicked(Evas_Object *obj, void *event_info);
void onPlusBtnClicked(Evas_Object *obj, void *event_info);
+ void onClearButtonClicked(Evas_Object *obj, void *event_info);
void onGeometryChanged(Evas_Object *obj, void *event_info);
Evas_Object *getPlusBtn();
Evas_Object *getContactBtn();
Evas_Object *createAreaRect(Evas_Object *parent);
+ Evas_Object *createClearButton(Evas_Object *parent);
void setContactBtnColor(Evas_Object *btn, int r, int g, int b, int a);
void deleteNextRecipient();
void selectLastItem();
private:
Evas_Object *m_pLayout;
Evas_Object *m_pEntry;
+ Evas_Object *m_pEntryLayout;
Evas_Object *m_pContactBtn;
Evas_Object *m_pPlusBtn;
Evas_Object *m_pRect;
: View()
, m_pLayout(nullptr)
, m_pEntry(nullptr)
+ , m_pEntryLayout(nullptr)
, m_pContactBtn(nullptr)
, m_pPlusBtn(nullptr)
, m_pRect(nullptr)
if(m_pEntry)
return m_pEntry;
- m_pEntry = elm_entry_add(m_pLayout);
+ m_pEntryLayout = elm_layout_add(m_pLayout);
+ elm_layout_theme_set(m_pEntryLayout, "layout", "searchfield", "singleline");
+ elm_object_part_content_set(m_pEntryLayout, "elm.swallow.button", createClearButton(m_pEntryLayout));
+ elm_object_part_content_set(m_pLayout, "swl.entry", m_pEntryLayout);
+
+ m_pEntry = elm_entry_add(m_pEntryLayout);
evas_object_show(m_pEntry);
evas_object_size_hint_weight_set(m_pEntry, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
evas_object_size_hint_align_set(m_pEntry, EVAS_HINT_FILL, EVAS_HINT_FILL);
- emitSignal(m_pEntry, "elm,action,hide,search_icon", "");
- elm_entry_editable_set(m_pEntry, EINA_TRUE);
- elm_entry_single_line_set(m_pEntry, EINA_TRUE);
- elm_entry_scrollable_set(m_pEntry, EINA_TRUE);
- eext_entry_selection_back_event_allow_set(m_pEntry, EINA_TRUE);
+ elm_entry_editable_set(m_pEntry, true);
+ elm_entry_single_line_set(m_pEntry, true);
+ elm_entry_scrollable_set(m_pEntry, true);
+ eext_entry_selection_back_event_allow_set(m_pEntry, true);
elm_scroller_policy_set(m_pEntry, ELM_SCROLLER_POLICY_OFF, ELM_SCROLLER_POLICY_OFF);
elm_entry_autocapital_type_set(m_pEntry, ELM_AUTOCAPITAL_TYPE_NONE);
elm_entry_input_panel_return_key_type_set(m_pEntry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT);
evas_object_smart_callback_add(m_pEntry, "maxlength,reached", SMART_CALLBACK(ConvRecipientsPanelView, onEntryMaxlengthReached), this);
evas_object_event_callback_add(m_pEntry, EVAS_CALLBACK_KEY_DOWN, EVAS_EVENT_CALLBACK(ConvRecipientsPanelView, onKeyDown), this);
addGeometryChangedCb(m_pEntry);
- elm_object_part_content_set(m_pLayout, "swl.entry", m_pEntry);
- return m_pEntry;
+ elm_object_content_set(m_pEntryLayout, m_pEntry);
+ return m_pEntryLayout;
}
Evas_Object *ConvRecipientsPanelView::createAreaRect(Evas_Object *parent)
return m_pRect;
}
+Evas_Object *ConvRecipientsPanelView::createClearButton(Evas_Object *parent)
+{
+ Evas_Object *button = elm_button_add(parent);
+ evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(ConvRecipientsPanelView, onClearButtonClicked), this);
+ elm_object_focus_allow_set(button, false);
+ evas_object_smart_callback_add(button, "clicked", SMART_CALLBACK(ConvRecipientsPanelView, onClearButtonClicked), this);;
+ elm_object_style_set(button, "editfield_clear");
+ evas_object_show(button);
+ return button;
+}
+
Evas_Object *ConvRecipientsPanelView::getContactBtn()
{
if(m_pContactBtn)
emitSignal(m_pLayout, sig, "*");
}
+void ConvRecipientsPanelView::showClearButton(bool show)
+{
+ const char *sig = show ? "elm,action,show,button" : "elm,action,hide,button";
+ emitSignal(m_pEntryLayout, sig, "");
+}
+
void ConvRecipientsPanelView::onEntryChanged(Evas_Object *obj, void *event_info)
{
+ MSG_LOG("");
+ showClearButton(getEntryFocus() && !isEntryEmpty());
onEntryChanged();
}
void ConvRecipientsPanelView::onEntryFocusChanged(Evas_Object *obj, void *event_info)
{
+ MSG_LOG("");
+ showClearButton(getEntryFocus() && !isEntryEmpty());
onEntryFocusChanged();
}
onPlusButtonClicked();
}
+void ConvRecipientsPanelView::ConvRecipientsPanelView::onClearButtonClicked(Evas_Object *obj, void *event_info)
+{
+ MSG_LOG("");
+ clearEntry();
+}
+
MbeRecipientItem *ConvRecipientsPanelView::getSelectedItem() const
{
return m_pMbe ? m_pMbe->getSelectedItem() : nullptr;