diff options
-rw-r--r-- | edc/most-visited-sites.edc | 355 | ||||
-rw-r--r-- | images/browser-view-images/most-visited-sites/00_winset_thumbs_bg.png | bin | 0 -> 3233 bytes | |||
-rw-r--r-- | images/browser-view-images/most-visited-sites/00_winset_thumbs_focus_bg.png | bin | 0 -> 3114 bytes | |||
-rw-r--r--[-rwxr-xr-x] | src/browser-common-view.cpp | 11 | ||||
-rwxr-xr-x | src/browser-settings/browser-settings-edit-homepage-view.cpp | 112 | ||||
-rwxr-xr-x | src/browser-settings/browser-settings-edit-homepage-view.h | 7 | ||||
-rw-r--r-- | src/most-visited-sites/most-visited-sites.cpp | 16 |
7 files changed, 334 insertions, 167 deletions
diff --git a/edc/most-visited-sites.edc b/edc/most-visited-sites.edc index 93cb8e0..5d28a53 100644 --- a/edc/most-visited-sites.edc +++ b/edc/most-visited-sites.edc @@ -801,118 +801,247 @@ collections { } } } - group { - name: "elm/gengrid/item/default_grid/browser/most_visited_sites/default"; - data.item: "contents" "elm.swallow.icon elm.swallow.end"; - parts { - part { - name: "bg"; - type: RECT; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { relative: 0.0 0.0; } - rel2 { relative: 1.0 1.0; } - } - } - part { - name: "left_top_padding"; - type: RECT; - description { - state: "default" 0.0; - min: 8 15; - align: 0.0 0.0; - color: 0 0 0 0; - rel1 { relative: 0.0 0.0; to: "bg"; } - rel2 { relative: 0.0 0.0; to: "bg"; } - } - } - part { - name: "right_bottom_padding"; - type: RECT; - description { - state: "default" 0.0; - min: 7 0; - color: 0 0 0 0; - align: 1.0 1.0; - rel1 { relative: 1.0 1.0; to: "bg"; } - rel2 { relative: 1.0 1.0; to: "bg"; } - } - } - part { - name: "area_bg"; - type: RECT; - description { - state: "default" 0.0; - color: 0 0 0 0; - rel1 { relative: 1.0 1.0; to_x: "left_top_padding"; to_y: "left_top_padding";} - rel2 { relative: 0.0 0.0; to_x: "right_bottom_padding"; to_y: "right_bottom_padding";} - } - description { - state: "enabled" 0.0; - inherit: "default" 0.0; - rel1.offset: -6 -6; - rel2.offset: 5 5; - } - } - part { - name: "elm.swallow.icon"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1 { relative: 0.0 0.0; offset: 1 1; to: "area_bg"; } - rel2 { relative: 1.0 1.0; offset: -2 -2; to: "area_bg"; } - } - } - - part { - name: "elm.swallow.end"; - type: SWALLOW; - description { - state: "default" 0.0; - rel1 { relative: 0.0 0.0; to: "elm.swallow.icon"; } - rel2 { relative: 1.0 1.0; to: "elm.swallow.icon"; } - } - } - part { - name: "reorder_bg"; - type: RECT; - description { - state: "default" 0.0; - color: 0 0 0 0; - visible: 0; - align: 0.0 0.0; - rel1 { relative: 0.075 0.075; to: "area_bg"; } - rel2 { relative: 0.925 0.925; to: "area_bg"; } - } - description { - state: "enabled" 0.0; - inherit: "default" 0.0; - color: 0 0 0 128; - visible: 1; - } - } - } - programs { - program { - name: "go_reorder_disabled"; - signal: "elm,state,reorder,disabled"; - source: "elm"; - action: STATE_SET "default" 0.0; - target: "area_bg"; - target: "reorder_bg"; - transition: ACCELERATE 0.3; - } - program { - name: "go_reorder_enabled"; - signal: "elm,state,reorder,enabled"; - source: "elm"; - action: STATE_SET "enabled" 0.0; - target: "area_bg"; - target: "reorder_bg"; - transition: ACCELERATE 0.3; - } - } - } + group { name: "elm/gengrid/item/default_grid/browser/most_visited_sites/default"; + data.item: "contents" "elm.swallow.icon elm.swallow.end"; + images { + image : "browser-view-images/most-visited-sites/00_winset_thumbs_bg.png" COMP; + image : "browser-view-images/most-visited-sites/00_winset_thumbs_focus_bg.png" COMP; + } + parts { + part { name: "bg"; + type: RECT; + description { state: "default" 0.0; + color: 0 0 0 0; + } + } + part { name: "left_top_padding"; + type: RECT; + scale : 1; + description { state: "default" 0.0; + min: 8 18; + align: 0.0 0.0; + visible: 0; + rel1.to: "bg"; + rel2 { + relative: 0.0 0.0; + to: "bg"; + } + } + } + part { name: "right_bottom_padding"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 8 0; + align: 1.0 1.0; + visible: 0; + rel1 { + relative: 1.0 1.0; + to: "bg"; + } + rel2.to: "bg"; + } + } + part { name: "item_bg"; + type: IMAGE; + description { state: "default" 0.0; + rel1 { + relative: 1.0 1.0; + to: "left_top_padding"; + } + rel2 { + relative: 0.0 0.0; + to: "right_bottom_padding"; + } + image.normal: "browser-view-images/most-visited-sites/00_winset_thumbs_bg.png"; + } + } + part { name: "item_bg_left_top_padding"; + type: RECT; + scale : 1; + description { state: "default" 0.0; + min: 2 0; + align: 0.0 0.0; + visible: 0; + rel1.to: "item_bg"; + rel2 { + relative: 0.0 0.0; + to: "item_bg"; + } + } + } + part { name: "item_bg_right_bottom_padding"; + type: RECT; + scale : 1; + description { state: "default" 0.0; + min: 2 6; + align: 1.0 1.0; + visible: 0; + rel1 { + relative: 1.0 1.0; + to: "item_bg"; + } + rel2.to: "item_bg"; + } + } + part { name: "item_real_bg"; + type: RECT; + description { state: "default" 0.0; + color: 190 189 189 255; + rel1 { + relative: 1.0 1.0; + to: "item_bg_left_top_padding"; + } + rel2 { + relative: 0.0 0.0; + to: "item_bg_right_bottom_padding"; + } + } + } + part { name: "item_real_bg_left_top_padding"; + type: RECT; + scale : 1; + description { state: "default" 0.0; + min: 2 2; + align: 0.0 0.0; + visible: 0; + rel1.to: "item_real_bg"; + rel2 { + relative: 0.0 0.0; + to: "item_real_bg"; + } + } + } + part { name: "item_real_bg_right_bottom_padding"; + type: RECT; + scale : 1; + description { state: "default" 0.0; + min: 2 2; + align: 1.0 1.0; + visible: 0; + rel1 { + relative: 1.0 1.0; + to: "item_real_bg"; + } + rel2.to: "item_real_bg"; + } + } + part { name: "elm.swallow.icon"; + type: SWALLOW; + description { state: "default" 0.0; + rel1 { + relative: 1.0 1.0; + to: "item_real_bg_left_top_padding"; + } + rel2 { + relative: 0.0 0.0; + to: "item_real_bg_right_bottom_padding"; + } + } + } + part { name: "elm.swallow.end"; + type: SWALLOW; + description { state: "default" 0.0; + rel1.to: "elm.swallow.icon"; + rel2.to: "elm.swallow.icon"; + } + } + part { name: "reorder_bg"; + type: RECT; + repeat_events: 1; + description { state: "default" 0.0; + //color: GENGRID_PART_BG_COLOR_INC; + color: 0 0 0 0; + rel1.to: "item_bg"; + rel2.to: "item_bg"; + } + description { state: "enabled" 0.0; + inherit: "default" 0.0; + //color: GENGRID_PART_REORDER_BG_COLOR_INC; + color: 0 255 255 255; +// color: 0 0 0 0; + } + } + part { name: "focus_bg_left_top_padding"; + type: RECT; + scale : 1; + description { state: "default" 0.0; + min: 8 16; + align: 0.0 0.0; + visible: 0; + rel1.to: "bg"; + rel2 { + relative: 0.0 0.0; + to: "bg"; + } + } + } + part { name: "focus_bg_right_bottom_padding"; + type: RECT; + scale: 1; + description { state: "default" 0.0; + min: 8 4; + align: 1.0 1.0; + visible: 0; + rel1 { + relative: 1.0 1.0; + to: "bg"; + } + rel2.to: "bg"; + } + } + part { name: "focus_bg"; + type: IMAGE; + description { state: "default" 0.0; + visible: 0; + rel1 { + relative: 1.0 1.0; + to: "focus_bg_left_top_padding"; + } + rel2 { + relative: 0.0 0.0; + to: "focus_bg_right_bottom_padding"; + } + image.normal: "browser-view-images/most-visited-sites/00_winset_thumbs_focus_bg.png"; + } + description { state: "enabled" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { name: "go_mouse_down"; + signal: "mouse,down,1"; + source: "reorder_bg"; + action: STATE_SET "enabled" 0.0; + target: "focus_bg"; + transition: ACCELERATE 0.2; + } + program { name: "go_mouse_up"; + signal: "mouse,up,1"; + source: "reorder_bg"; + action: STATE_SET "default" 0.0; + target: "focus_bg"; + transition: DECELERATE 0.2; + } + program { name: "go_reorder_disabled"; + signal: "elm,state,reorder,disabled"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "reorder_bg"; + target: "focus_bg"; + transition: ACCELERATE 0.3; + } + program { name: "go_reorder_enabled"; + signal: "elm,state,reorder,enabled"; + source: "elm"; + action: STATE_SET "enabled" 0.0; + target: "reorder_bg"; + target: "focus_bg"; + transition: DECELERATE 0.3; + } + } + } }
\ No newline at end of file diff --git a/images/browser-view-images/most-visited-sites/00_winset_thumbs_bg.png b/images/browser-view-images/most-visited-sites/00_winset_thumbs_bg.png Binary files differnew file mode 100644 index 0000000..6226c90 --- /dev/null +++ b/images/browser-view-images/most-visited-sites/00_winset_thumbs_bg.png diff --git a/images/browser-view-images/most-visited-sites/00_winset_thumbs_focus_bg.png b/images/browser-view-images/most-visited-sites/00_winset_thumbs_focus_bg.png Binary files differnew file mode 100644 index 0000000..4f7d66f --- /dev/null +++ b/images/browser-view-images/most-visited-sites/00_winset_thumbs_focus_bg.png diff --git a/src/browser-common-view.cpp b/src/browser-common-view.cpp index 197a163..10ce90c 100755..100644 --- a/src/browser-common-view.cpp +++ b/src/browser-common-view.cpp @@ -927,16 +927,11 @@ char *Browser_Common_View::_trim(char *str) #if defined(HORIZONTAL_UI) Eina_Bool Browser_Common_View::is_landscape(void) { - int window_w = 0; - int window_h = 0; - evas_object_geometry_get(m_win, NULL, NULL, &window_w, &window_h); - if (window_h > window_w) { - BROWSER_LOGD("portrait"); + app_device_orientation_e rotation_value = app_get_device_orientation(); + if (rotation_value == APP_DEVICE_ORIENTATION_0 || rotation_value == APP_DEVICE_ORIENTATION_180) return EINA_FALSE; - } else { - BROWSER_LOGD("landscape"); + else return EINA_TRUE; - } } #endif diff --git a/src/browser-settings/browser-settings-edit-homepage-view.cpp b/src/browser-settings/browser-settings-edit-homepage-view.cpp index e87324c..941a1ba 100755 --- a/src/browser-settings/browser-settings-edit-homepage-view.cpp +++ b/src/browser-settings/browser-settings-edit-homepage-view.cpp @@ -22,7 +22,8 @@ Browser_Settings_Edit_Homepage_View::Browser_Settings_Edit_Homepage_View(Browser_Settings_Main_View *main_view)
:
m_main_view(main_view)
- ,m_content_layout(NULL)
+ ,m_conformant(NULL)
+ ,m_genlist(NULL)
,m_edit_field(NULL)
,m_done_button(NULL)
,m_cancel_button(NULL)
@@ -33,6 +34,10 @@ Browser_Settings_Edit_Homepage_View::Browser_Settings_Edit_Homepage_View(Browser Browser_Settings_Edit_Homepage_View::~Browser_Settings_Edit_Homepage_View(void)
{
BROWSER_LOGD("[%s]", __func__);
+
+ if (m_conformant)
+ evas_object_del(m_conformant);
+ m_conformant = NULL;
}
void Browser_Settings_Edit_Homepage_View::__back_button_clicked_cb(void *data,
@@ -118,52 +123,40 @@ void Browser_Settings_Edit_Homepage_View::__edit_field_changed_cb(void *data, Eina_Bool Browser_Settings_Edit_Homepage_View::_create_main_layout(void)
{
BROWSER_LOGD("[%s]", __func__);
+ elm_win_conformant_set(m_win, EINA_TRUE);
- m_content_layout = elm_layout_add(m_navi_bar);
- if (!m_content_layout) {
- BROWSER_LOGE("elm_layout_add failed");
+ m_conformant = elm_conformant_add(m_win);
+ if (!m_conformant) {
+ BROWSER_LOGE("elm_conformant_add failed");
return EINA_FALSE;
}
- if (!elm_layout_file_set(m_content_layout, BROWSER_EDJE_DIR"/browser-settings.edj",
- "edit_homepage_view")) {
- BROWSER_LOGE("elm_layout_file_set failed"); - return EINA_FALSE; - }
- evas_object_show(m_content_layout);
+ elm_object_style_set(m_conformant, "internal_layout");
+ evas_object_size_hint_align_set(m_conformant, EVAS_HINT_FILL, EVAS_HINT_FILL);
- m_edit_field = br_elm_editfield_add(m_content_layout, EINA_TRUE);
- if (!m_edit_field) {
- BROWSER_LOGE("elm_editfield_add failed");
+ m_genlist = elm_genlist_add(m_conformant);
+ if (!m_genlist) {
+ BROWSER_LOGE("elm_genlist_add failed");
return EINA_FALSE;
}
- br_elm_editfield_entry_single_line_set(m_edit_field, EINA_TRUE);
- br_elm_editfield_label_set(m_edit_field, BR_STRING_URL);
- elm_object_part_content_set(m_content_layout, "elm.swallow.entry", m_edit_field);
- char *homepage = NULL;
- if (br_preference_get_str(USER_HOMEPAGE_KEY, &homepage) == false) {
- BROWSER_LOGE("failed to get %s preference\n", USER_HOMEPAGE_KEY);
- return EINA_FALSE;
- }
- Evas_Object *entry = br_elm_editfield_entry_get(m_edit_field);
- if (homepage) {
- elm_entry_entry_set(entry, homepage);
- free(homepage);
- }
- elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_URL);
- evas_object_size_hint_weight_set(m_edit_field, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
- evas_object_size_hint_align_set(m_edit_field, 1, 0.5);
- elm_entry_cursor_end_set(entry);
- - evas_object_show(m_edit_field);
- elm_object_focus_set(m_edit_field, EINA_TRUE);
- evas_object_smart_callback_add(entry, "changed", __edit_field_changed_cb, this);
-
- Elm_Object_Item *navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_HOMEPAGE,
- NULL, NULL, m_content_layout, "browser_titlebar");
- elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL);
-
- m_done_button = elm_button_add(m_content_layout);
+ m_item_class.item_style = "1icon";
+ m_item_class.func.text_get = NULL;
+ m_item_class.func.content_get = __genlist_icon_get_cb;
+ m_item_class.func.state_get = NULL;
+ m_item_class.func.del = NULL;
+
+ elm_genlist_item_append(m_genlist, &m_item_class, this, NULL, ELM_GENLIST_ITEM_NONE, NULL, NULL);
+ evas_object_show(m_genlist);
+ elm_object_content_set(m_conformant, m_genlist);
+
+ m_navi_it = elm_naviframe_item_push(m_navi_bar, BR_STRING_HOMEPAGE, NULL, NULL,
+ m_conformant, "browser_titlebar");
+
+ evas_object_smart_callback_add(m_navi_bar, "transition,finished", __naviframe_pop_finished_cb, this);
+
+ elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_PREV_BTN, NULL);
+
+ m_done_button = elm_button_add(m_conformant);
if (!m_done_button) {
BROWSER_LOGE("elm_button_add failed");
return EINA_FALSE;
@@ -172,9 +165,9 @@ Eina_Bool Browser_Settings_Edit_Homepage_View::_create_main_layout(void) elm_object_text_set(m_done_button, BR_STRING_DONE);
evas_object_show(m_done_button);
evas_object_smart_callback_add(m_done_button, "clicked", __done_button_clicked_cb, this);
- elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN, m_done_button);
+ elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_RIGHT_BTN, m_done_button);
- m_cancel_button = elm_button_add(m_content_layout);
+ m_cancel_button = elm_button_add(m_conformant);
if (!m_cancel_button) {
BROWSER_LOGE("elm_button_add failed");
return EINA_FALSE;
@@ -183,8 +176,41 @@ Eina_Bool Browser_Settings_Edit_Homepage_View::_create_main_layout(void) elm_object_text_set(m_cancel_button, BR_STRING_CANCEL);
evas_object_show(m_cancel_button);
evas_object_smart_callback_add(m_cancel_button, "clicked", __cancel_button_clicked_cb, this);
- elm_object_item_part_content_set(navi_it, ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN, m_cancel_button);
+ elm_object_item_part_content_set(m_navi_it, ELM_NAVIFRAME_ITEM_TITLE_LEFT_BTN, m_cancel_button);
return EINA_TRUE;
}
+Evas_Object *Browser_Settings_Edit_Homepage_View::__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part)
+{
+ if (!data)
+ return NULL;
+
+ Browser_Settings_Edit_Homepage_View *edit_homepage_view = (Browser_Settings_Edit_Homepage_View *)data;
+
+ if (!strncmp(part, "elm.icon", strlen("elm.icon"))) {
+ edit_homepage_view->m_edit_field = br_elm_editfield_add(obj, EINA_TRUE);
+ if (!edit_homepage_view->m_edit_field) {
+ BROWSER_LOGE("elm_editfield_add failed");
+ return NULL;
+ }
+ br_elm_editfield_entry_single_line_set(edit_homepage_view->m_edit_field, EINA_TRUE);
+ br_elm_editfield_label_set(edit_homepage_view->m_edit_field, BR_STRING_URL);
+
+ char *homepage = NULL;
+ if (br_preference_get_str(USER_HOMEPAGE_KEY, &homepage) == false)
+ BROWSER_LOGE("failed to get %s preference\n", USER_HOMEPAGE_KEY);
+
+ elm_entry_entry_set(br_elm_editfield_entry_get(edit_homepage_view->m_edit_field), homepage);
+
+ evas_object_smart_callback_add(br_elm_editfield_entry_get(edit_homepage_view->m_edit_field),
+ "changed", __edit_field_changed_cb, edit_homepage_view);
+
+ ecore_idler_add(edit_homepage_view->__set_focus_editfield_idler_cb, edit_homepage_view->m_edit_field);
+ return edit_homepage_view->m_edit_field;
+ }
+
+ return NULL;
+}
+
+
diff --git a/src/browser-settings/browser-settings-edit-homepage-view.h b/src/browser-settings/browser-settings-edit-homepage-view.h index 69893db..99cb138 100755 --- a/src/browser-settings/browser-settings-edit-homepage-view.h +++ b/src/browser-settings/browser-settings-edit-homepage-view.h @@ -37,12 +37,17 @@ private: static void __done_button_clicked_cb(void *data, Evas_Object *obj, void *event_info);
static void __cancel_button_clicked_cb(void *data, Evas_Object *obj, void *event_info);
static void __edit_field_changed_cb(void *data, Evas_Object *obj, void *event_info);
+ static Evas_Object *__genlist_icon_get_cb(void *data, Evas_Object *obj, const char *part);
- Evas_Object *m_content_layout;
+ Evas_Object *m_conformant;
+ Evas_Object *m_genlist;
Evas_Object *m_edit_field;
Evas_Object *m_done_button;
Evas_Object *m_cancel_button;
+ Elm_Genlist_Item_Class m_item_class;
+ Elm_Object_Item *m_navi_it;
+
Browser_Settings_Main_View *m_main_view;
};
diff --git a/src/most-visited-sites/most-visited-sites.cpp b/src/most-visited-sites/most-visited-sites.cpp index dc38d9e..15024f6 100644 --- a/src/most-visited-sites/most-visited-sites.cpp +++ b/src/most-visited-sites/most-visited-sites.cpp @@ -733,7 +733,19 @@ Evas_Object *Most_Visited_Sites::__gengrid_icon_get_cb(void *data, Evas_Object * BROWSER_LOGE("elm_layout_add failed"); return NULL; } - ecore_idler_add(__gengrid_icon_get_idler_cb, item); + + if (item->history_id) { + ecore_idler_add(__gengrid_icon_get_idler_cb, item); + } else { + if (!elm_layout_file_set(item->layout, BROWSER_EDJE_DIR"/most-visited-sites.edj", + "most_visited_sites_empty_item")) { + BROWSER_LOGE("elm_layout_file_set failed"); + return NULL; + } + evas_object_size_hint_weight_set(item->layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(item->layout, EVAS_HINT_FILL, EVAS_HINT_FILL); + } + return item->layout; } return NULL; @@ -1110,7 +1122,7 @@ Evas_Object *Most_Visited_Sites::create_most_visited_sites_main_layout(void) // elm_gengrid_reorder_mode_set(m_gengrid, EINA_TRUE); // m_gengrid_item_class = elm_gengrid_item_class_new(); // m_gengrid_item_class->item_style = "default_grid/browser/most_visited_sites"; - m_gengrid_item_class.item_style = "default_grid"; + m_gengrid_item_class.item_style = "default_grid/browser/most_visited_sites"; m_gengrid_item_class.func.text_get = NULL; m_gengrid_item_class.func.content_get = __gengrid_icon_get_cb; m_gengrid_item_class.func.state_get = NULL; |