From 775030f888d145141a4404b956ce696761dd482e Mon Sep 17 00:00:00 2001 From: Jihoon Chung Date: Mon, 10 Dec 2012 18:07:36 +0900 Subject: [PATCH] Revert Back button [Issue#] N/A [Problem] N/A [Cause] N/A [Solution] Revert floating backbutton for Hosted web app [SCMRequest] N/A Change-Id: I39605fbc526156a17ee131b42da78dcc7580f8b3 --- data/Daemon.edc | 32 ++++++++++++++++++++++++++++++++ src/wrt-client/window_data.cpp | 6 ++++++ src/wrt-client/window_data.h | 1 + src/wrt-client/wrt-client.cpp | 20 ++++++++++++++++++++ 4 files changed, 59 insertions(+) mode change 100755 => 100644 src/wrt-client/window_data.cpp mode change 100755 => 100644 src/wrt-client/window_data.h diff --git a/data/Daemon.edc b/data/Daemon.edc index 23dd6b7..25eb355 100644 --- a/data/Daemon.edc +++ b/data/Daemon.edc @@ -25,6 +25,28 @@ collections { } } part { + name: "elm.swallow.backward"; + type: SWALLOW; + mouse_events: 1; + repeat_events: 0; + scale: 1; + description { + state: "default" 0.0; + visible: 0; + min: 91 79; + max: 91 79; + fixed: 1 1; + align: 1.0 1.0; + rel1 { relative: 1.0 1.0; } + rel2 { relative: 1.0 1.0; } + } + description { + state: "visible" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { name: "elm.swallow.toolbar"; type: SWALLOW; mouse_events: 1; @@ -118,6 +140,16 @@ collections { }//end of parts programs { + program { name: "show,backward"; + signal: "show,backward,signal"; + action: STATE_SET "visible" 0.0; + target: "elm.swallow.backward"; + } + program { name: "hide,backward"; + signal: "hide,backward,signal"; + action: STATE_SET "default" 0.0; + target: "elm.swallow.backward"; + } program { name: "show,toolbar"; signal: "show,toolbar,signal"; action: STATE_SET "visible" 0.0; diff --git a/src/wrt-client/window_data.cpp b/src/wrt-client/window_data.cpp old mode 100755 new mode 100644 index 7a75649..8f91abf --- a/src/wrt-client/window_data.cpp +++ b/src/wrt-client/window_data.cpp @@ -116,15 +116,21 @@ void WindowData::toggleIndicator(bool fullscreen) void WindowData::setViewMode( const char *title, bool fullscreen, + bool backbutton, CtxMenuItems ctxMenuItems) { LogDebug("setViewMode " <Reset(); + m_windowData->emitSignalForUserLayout(EDJE_SHOW_BACKWARD_SIGNAL, ""); m_widgetState = WidgetState_Running; } else { if (true == checkArgument()) @@ -521,6 +522,7 @@ void WrtClient::launchStep() m_widget->SetUserDelegates(cbs); m_widget->Show(); + m_windowData->emitSignalForUserLayout(EDJE_SHOW_BACKWARD_SIGNAL, ""); ADD_PROFILING_POINT("launchStep", "stop"); } @@ -530,6 +532,16 @@ void WrtClient::initializeWindowModes() Assert(m_dao); auto windowModes = m_dao->getWindowModes(); bool fullscreen = false; + bool backbutton = false; + if (m_dao->getWidgetType().appType == WrtDB::APP_TYPE_TIZENWEBAPP) { + WidgetSettings widgetSettings; + m_dao->getWidgetSettings(widgetSettings); + WidgetSettingList settings(widgetSettings); + backbutton = + (settings.getBackButtonPresence() == BackButton_Enable); + } + + FOREACH(it, windowModes) { std::string viewMode = DPL::ToUTF8String(*it); @@ -583,6 +595,7 @@ void WrtClient::initializeWindowModes() m_windowData->setViewMode(name.c_str(), fullscreen, + backbutton, ctxMenuItems); } @@ -644,6 +657,13 @@ void WrtClient::connectElmCallback() WidgetSettings widgetSettings; m_dao->getWidgetSettings(widgetSettings); WidgetSettingList settings(widgetSettings); + if (settings.getBackButtonPresence() == BackButton_Enable) { + m_windowData->addFloatBackButtonCallback( + "clicked", + &WrtClient::backButtonCallback, + this); + } + WidgetSettingScreenLock rotationValue = settings.getRotationValue(); if (rotationValue == Screen_Portrait) { elm_win_rotation_with_resize_set(m_windowData->m_win, 0); -- 2.7.4