From: Jihoon Chung Date: Thu, 20 Dec 2012 05:24:28 +0000 (+0900) Subject: Remove title X-Git-Tag: 2.1b_release~22^2~151 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b17428a6f248756e22e8f068b8112e13d8511ba6;p=platform%2Fframework%2Fweb%2Fwrt.git Remove title [Issue#] JIRA (N_SE-17414) [Problem] Title is displayed [Cause] Code for title isn't disabled [Solution] Disable title even viewmode is maximized [SCMRequest] N/A Change-Id: I3c3c4058d558de1a6e789c0e19ff436d412ac7b2 --- diff --git a/src/wrt-client/window_data.cpp b/src/wrt-client/window_data.cpp index 8f91abf..6d7ba51 100644 --- a/src/wrt-client/window_data.cpp +++ b/src/wrt-client/window_data.cpp @@ -114,7 +114,6 @@ void WindowData::toggleIndicator(bool fullscreen) } void WindowData::setViewMode( - const char *title, bool fullscreen, bool backbutton, CtxMenuItems ctxMenuItems) @@ -131,116 +130,12 @@ void WindowData::setViewMode( createFloatBackButton(); } - m_title = title; m_ctxMenuItems = ctxMenuItems; if(m_debugMode) { - if(fullscreen) - showHiddenOption(m_user_layout); - else - createTitle(m_title.c_str(), m_ctxMenuItems); - + showHiddenOption(m_user_layout); createToolbar(m_ctxMenuItems); } - else - if(!fullscreen) - createTitle(m_title.c_str(), m_ctxMenuItems); -} - -void WindowData::createTitle(const char *data, CtxMenuItems ctxMenuItems) -{ - LogDebug("createTitle"); - showTitle(data); - if(m_debugMode) { - createMoreButton(); - createTitleToolbar(ctxMenuItems); - } -} - -void WindowData::showTitle(const char *data) -{ - LogInfo("showTitle"); - - Elm_Object_Item* naviIt = elm_naviframe_top_item_get(m_navigation); - elm_naviframe_item_title_visible_set(naviIt, EINA_TRUE); - elm_object_item_text_set(naviIt, data); -} - -void WindowData::hideTitle() -{ - LogInfo("hideTitle"); - - Elm_Object_Item* naviIt = elm_naviframe_top_item_get(m_navigation); - elm_object_item_signal_emit(naviIt, "elm,state,optionheader,instant_close", ""); - optionheaderClose = FALSE; - - elm_naviframe_item_title_visible_set(naviIt, EINA_FALSE); -} - -void WindowData::createMoreButton() -{ - Evas_Object *btn = elm_button_add(m_navigation); - if (!btn) - return; - Elm_Object_Item* naviIt = elm_naviframe_top_item_get(m_navigation); - elm_object_style_set(btn, "naviframe/more/default"); - evas_object_smart_callback_add(btn, "clicked", moreButtonCallback, this); - elm_object_item_part_content_set(naviIt, "title_more_btn", btn); - evas_object_show(btn); - -} - -void WindowData::createTitleToolbar(CtxMenuItems ctxMenuItems) -{ - Elm_Object_Item *toolbarIt; - Evas_Object *toolbarButton; - Elm_Object_Item *naviIt = elm_naviframe_top_item_get(m_navigation); - - Evas_Object *toolbar = elm_toolbar_add(m_navigation); - if (!toolbar) - return; - elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND); - - elm_object_style_set(toolbar, "naviframe"); - - toolbarButton = elm_button_add(m_navigation); - if (!toolbarButton) - return; - - std::list::iterator itor; - for (itor = ctxMenuItems.begin(); itor != ctxMenuItems.end(); ++itor) { - toolbarButton = elm_button_add(toolbar); - elm_object_style_set(toolbarButton, "naviframe_contrl/default"); - evas_object_size_hint_align_set(toolbarButton, - EVAS_HINT_FILL, - EVAS_HINT_FILL); - elm_object_text_set(toolbarButton, ((*itor).label).c_str()); - evas_object_smart_callback_add(toolbarButton, - "clicked", - (*itor).callback, - (*itor).data); - toolbarIt = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL); - elm_object_item_part_content_set(toolbarIt, "object", toolbarButton); - } - - toolbarButton = elm_button_add(toolbar); - elm_object_style_set(toolbarButton, "naviframe_contrl/default"); - evas_object_size_hint_align_set(toolbarButton, - EVAS_HINT_FILL, - EVAS_HINT_FILL); - elm_object_text_set(toolbarButton, WRT_OPTION_LABEL_FULLVIEW); - evas_object_smart_callback_add(toolbarButton, - "clicked", - changeViewModeCallback, - this); - toolbarIt = elm_toolbar_item_append(toolbar, NULL, NULL, NULL, NULL); - elm_object_item_part_content_set(toolbarIt, "object", toolbarButton); - - elm_object_item_part_content_set(naviIt, "optionheader", toolbar); - elm_object_item_signal_emit(naviIt, - "elm,state,optionheader,instant_close", - ""); - optionheaderClose = TRUE; } void WindowData::createToolbar(CtxMenuItems ctxMenuItems) @@ -346,16 +241,6 @@ void WindowData::hideToolbar() } } -void WindowData::createTitleButton() -{ - // Add left button for back action - m_naviBackButton = elm_button_add(m_navigation); - elm_object_style_set(m_naviBackButton, "navigationbar_backbutton/default"); - - Elm_Object_Item* naviIt = elm_naviframe_top_item_get(m_navigation); - elm_object_item_part_content_set(naviIt, "prev_btn", m_naviBackButton); -} - void WindowData::createFloatBackButton() { // Add float backbutton on the left coner @@ -367,15 +252,6 @@ void WindowData::createFloatBackButton() evas_object_show(m_floatBackButton); } -void WindowData::updateTitleButton(const bool display) -{ - if (display) { - evas_object_show(m_naviBackButton); - } else { - evas_object_hide(m_naviBackButton); - } -} - Evas_Object* WindowData::createWindow(unsigned long pid) { Evas_Object* window = elm_win_add(NULL, "wrt-widget", ELM_WIN_BASIC); @@ -578,11 +454,9 @@ void WindowData::changeViewModeCallback(void *data, Elm_Object_Item *naviIt = elm_naviframe_top_item_get(This->m_navigation); if(elm_naviframe_item_title_visible_get(naviIt)) { - This->hideTitle(); This->showHiddenOption(This->m_user_layout); } else { - This->createTitle(This->m_title.c_str(), This->m_ctxMenuItems); This ->hideToolbar(); } } @@ -636,7 +510,6 @@ void WindowData::toggleFullscreen(bool fullscreen) if (!m_fullscreen) { //If ViewMode is not fullscreen, toggle the title bar and indicator - fullscreen ? hideTitle() : showTitle(m_title.c_str()); toggleIndicator(fullscreen); } alreadyFullscreen = !alreadyFullscreen; diff --git a/src/wrt-client/window_data.h b/src/wrt-client/window_data.h index 94be95c..e5de07d 100644 --- a/src/wrt-client/window_data.h +++ b/src/wrt-client/window_data.h @@ -119,14 +119,12 @@ class WindowData : private DPL::Noncopyable const char* source); void changeViewMode(); - void createTitleToolbar(CtxMenuItems ctxMenuItems); void createToolbar(CtxMenuItems ctxMenuItems); void showToolbar(); void hideToolbar(); void createOptionButton(); void destroyOptionButton(); void setViewMode( - const char *title, bool fullscreen, bool backbutton, CtxMenuItems ctxMenuItems); @@ -167,14 +165,8 @@ class WindowData : private DPL::Noncopyable void hideHiddenOption(Evas_Object* parent); void alignProgressPosition(); - void createTitle(const char* data, CtxMenuItems ctxMenuItems); - void showTitle(const char* data); - void hideTitle(); - void createMoreButton(); - void createTitleButton(); - void createFloatBackButton(); - void updateTitleButton(const bool display); void toggleIndicator(bool indicator); + void createFloatBackButton(); }; #endif /* WINDOW_INITIALIZE_H_ */ diff --git a/src/wrt-client/wrt-client.cpp b/src/wrt-client/wrt-client.cpp index addf2c4..c590938 100644 --- a/src/wrt-client/wrt-client.cpp +++ b/src/wrt-client/wrt-client.cpp @@ -590,8 +590,7 @@ void WrtClient::initializeWindowModes() ctxMenuForward.data = this; ctxMenuItems.push_back(ctxMenuForward); - m_windowData->setViewMode(name.c_str(), - fullscreen, + m_windowData->setViewMode(fullscreen, backbutton, ctxMenuItems); }