diff options
author | posial <p.osial@samsung.com> | 2015-12-11 18:21:42 +0100 |
---|---|---|
committer | Przemys?aw Osial <p.osial@samsung.com> | 2015-12-11 09:25:36 -0800 |
commit | 3e185f86440c043a003b6a8cf8be09fbe7dd775b (patch) | |
tree | 6a6710c168b47d3c6937d69b15ab5ca81cb3fa77 /services/QuickAccess | |
parent | dfb74b3e6ecd504ecc83d784e5cb11d91e60ffe6 (diff) | |
download | browser-3e185f86440c043a003b6a8cf8be09fbe7dd775b.tar.gz browser-3e185f86440c043a003b6a8cf8be09fbe7dd775b.tar.bz2 browser-3e185f86440c043a003b6a8cf8be09fbe7dd775b.zip |
Pagecontrol for QuickAccess
[Issue] http://web.sec.samsung.net/bugzilla/show_bug.cgi?id=15206
[Problem] No current page indicator in QuickAccess
[Solution] Implement custom pagecontrol
[Verify] Open QuickAccess, switch between most visited and bookmarks.
Check if behavoiur is correct.
Change-Id: Id38933c03462969aeb690edc69c38ffa7c104d2c
Diffstat (limited to 'services/QuickAccess')
-rw-r--r-- | services/QuickAccess/QuickAccess.cpp | 24 | ||||
-rw-r--r-- | services/QuickAccess/QuickAccess.h | 2 | ||||
-rw-r--r-- | services/QuickAccess/edc/BrowserPageControl_mob.edc | 153 | ||||
-rw-r--r-- | services/QuickAccess/edc/QuickAccess_mob.edc | 8 |
4 files changed, 183 insertions, 4 deletions
diff --git a/services/QuickAccess/QuickAccess.cpp b/services/QuickAccess/QuickAccess.cpp index 1eccd391..4fc8bd20 100644 --- a/services/QuickAccess/QuickAccess.cpp +++ b/services/QuickAccess/QuickAccess.cpp @@ -76,6 +76,7 @@ QuickAccess::QuickAccess() , m_bookmark_item_class(nullptr) , m_detailPopup(this) #if PROFILE_MOBILE + , m_index(nullptr) , m_verticalScroller(nullptr) , m_centerLayout(nullptr) , m_bookmarkManagerTileclass(nullptr) @@ -153,6 +154,18 @@ Evas_Object* QuickAccess::createQuickAccessLayout(Evas_Object* parent) #if !PROFILE_MOBILE Evas_Object* topButtons = createTopButtons(layout); elm_object_part_content_set(layout, "buttons", topButtons); +#else + m_index = elm_index_add(layout); + evas_object_size_hint_weight_set(m_index, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); + evas_object_size_hint_align_set(m_index, EVAS_HINT_FILL, EVAS_HINT_FILL); + elm_object_style_set(m_index, "browser_pagecontrol"); + elm_index_horizontal_set(m_index, EINA_TRUE); + elm_index_autohide_disabled_set(m_index, EINA_TRUE); + elm_object_part_content_set(layout, "buttons", m_index); + + elm_index_item_append(m_index, "1", NULL, (void *) QuickAccess::MOST_VISITED_PAGE); + elm_index_item_append(m_index, "2", NULL, (void *) QuickAccess::BOOKMARK_PAGE); + elm_index_level_go(m_index, 0); #endif m_horizontalScroller = elm_scroller_add(layout); @@ -439,6 +452,14 @@ void QuickAccess::addBookmarkManagerTile() { elm_gengrid_item_append(m_bookmarkGengrid, m_bookmarkManagerTileclass, this, _bookmark_manager_clicked, this); } + +void QuickAccess::setIndexPage(const int page) const +{ + Elm_Object_Item* it = elm_index_item_find(m_index, (void *)page); + if (it != NULL) { + elm_index_item_selected_set(it, EINA_TRUE); + } +} #endif char* QuickAccess::_grid_bookmark_text_get(void *data, Evas_Object *, const char *part) @@ -510,8 +531,8 @@ void QuickAccess::showMostVisited() #if PROFILE_MOBILE elm_object_part_text_set(m_layout, "screen_title", "Most Visited"); + setIndexPage(QuickAccess::MOST_VISITED_PAGE); #endif - if (m_historyItems.empty()) { setEmptyView(true); return; @@ -535,6 +556,7 @@ void QuickAccess::showBookmarks() BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__); #if PROFILE_MOBILE elm_object_part_text_set(m_layout, "screen_title", "Bookmark"); + setIndexPage(QuickAccess::BOOKMARK_PAGE); #else refreshFocusChain(); elm_object_focus_set(m_bookmarksButton, true); diff --git a/services/QuickAccess/QuickAccess.h b/services/QuickAccess/QuickAccess.h index cfe55bed..8ad27225 100644 --- a/services/QuickAccess/QuickAccess.h +++ b/services/QuickAccess/QuickAccess.h @@ -75,6 +75,7 @@ private: #if PROFILE_MOBILE void addBookmarkManagerTile(); + void setIndexPage(const int page) const; #else Evas_Object* createBottomButton(Evas_Object *parent); #endif @@ -127,6 +128,7 @@ private: static const int BOOKMARK_PAGE = 1; #if PROFILE_MOBILE + Evas_Object* m_index; Evas_Object* m_verticalScroller; Evas_Object* m_centerLayout; Elm_Gengrid_Item_Class * m_bookmarkManagerTileclass; diff --git a/services/QuickAccess/edc/BrowserPageControl_mob.edc b/services/QuickAccess/edc/BrowserPageControl_mob.edc new file mode 100644 index 00000000..f2aa5ad8 --- /dev/null +++ b/services/QuickAccess/edc/BrowserPageControl_mob.edc @@ -0,0 +1,153 @@ +#define INDEX_PAGECONTROL_IND_INC 30 14 +#define INDEX_PAGECONTROL_IND_MIN_INC 14 14 + +collections { + group { + name: "elm/index/base/vertical/browser_pagecontrol"; + alias: "elm/index/base/horizontal/browser_pagecontrol"; + parts { + part {name: "clip"; + type: RECT; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + visible: 0; + color: 255 255 255 0; + } + description { + state: "active" 0.0; + visible: 1; + color: 255 255 255 255; + } + } + part { + name: "elm.swallow.index.0"; + type: SWALLOW; + scale: 1; + mouse_events: 0; + repeat_events: 0; + clip_to: "clip"; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1.relative: 0.5 0.5; + rel2.relative: 0.5 0.5; + } + } + part { + name: "elm.swallow.event.0"; + type: SWALLOW; + mouse_events: 0; + repeat_events: 0; + description { + state: "default" 0.0; + align: 0.5 0.5; + } + } + } + programs { + program { + name: "active"; + signal: "elm,state,active"; + source: "elm"; + action: STATE_SET "active" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + } + program { + name: "inactive"; + signal: "elm,state,inactive"; + source: "elm"; + action: STATE_SET "default" 0.0; + transition: DECELERATE 0.5; + target: "clip"; + } + } + } + group { + name: "elm/index/item/vertical/browser_pagecontrol"; + alias: "elm/index/item_odd/vertical/browser_pagecontrol"; + alias: "elm/index/item/horizontal/browser_pagecontrol"; + alias: "elm/index/item_odd/horizontal/browser_pagecontrol"; + images { + image: "page_Indicator_nor.png" COMP; + image: "page_Indicator_sel.png" COMP; + } + parts { + part { + name: "bg"; + type: RECT; + scale: 1; + description { + state: "default" 0.0; + min: INDEX_PAGECONTROL_IND_INC; + max: INDEX_PAGECONTROL_IND_INC; + visible: 0; + align: 0.5 0.5; + } + } + part { + name: "indicator1"; + type: IMAGE; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + fixed: 1 1; + min: INDEX_PAGECONTROL_IND_MIN_INC; + max: INDEX_PAGECONTROL_IND_MIN_INC; + image { + normal: "page_Indicator_nor.png"; + } + } + description { + state: "active" 0.0; + inherit: "default" 0.0; + visible: 0; + } + } + part { + name: "indicator2"; + type: IMAGE; + mouse_events: 0; + scale: 1; + description { + state: "default" 0.0; + align: 0.5 0.5; + fixed: 1 1; + min: INDEX_PAGECONTROL_IND_MIN_INC; + max: INDEX_PAGECONTROL_IND_MIN_INC; + image.normal: "page_Indicator_sel.png"; + visible: 0; + } + description { + state: "active" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + } + programs { + program { + name: "active"; + signal: "elm,state,active"; + source: "elm"; + action: STATE_SET "active" 0.0; + target: "indicator1"; + target: "indicator2"; + transition: LINEAR 0.2; + } + program { + name: "inactive"; + signal: "elm,state,inactive"; + source: "elm"; + action: STATE_SET "default" 0.0; + target: "indicator1"; + target: "indicator2"; + transition: LINEAR 0.2; + } + } + } +}
\ No newline at end of file diff --git a/services/QuickAccess/edc/QuickAccess_mob.edc b/services/QuickAccess/edc/QuickAccess_mob.edc index e7f02bc9..4bf3214e 100644 --- a/services/QuickAccess/edc/QuickAccess_mob.edc +++ b/services/QuickAccess/edc/QuickAccess_mob.edc @@ -1,5 +1,6 @@ #include "../../../core/Tools/edc/InvisibleButton.edc" #include "../../../core/Tools/edc/Spacer.edc" +#include "BrowserPageControl_mob.edc" #define URI_INPUTBOX_LENGTH 1720 #define URL_HISTORY_ITEM_H 82 @@ -298,14 +299,15 @@ group { } part { - name: "buttons"; // TODO: change to dots when they will be available + /* pagecontrol container for mobile */ + name: "buttons"; type: SWALLOW; scale: 1; mouse_events: 1; description { state: "default" 0.0; - align: 0.0 0.0; - fixed: 1 1; + align: 0.5 0.0; + fixed: 0 1; min: 0 71; max: -1 71; rel1 { |