[Issue] https://bugs.tizen.org/jira/browse/TT-225
[Problem] User cannot exit the screen zoom.
[Cause] Screen zoom is not in ViewManager stack, so it can't be supported
by onBackPressed callback.
[Solution] Added boost signal in PlatformInputManager on "Escape"
and "Backspace" keys.
[Verify] Launch browser > Open web page > More Menu > Screen zoom
Zoom up/down the page. Then press "escape" -> Screen zoom should
disappear and the page should return to normal scale.
Change-Id: Ica7a37a9fe15f3bb27bf4f54dce53238b90cb7b5
// MERGE_ME dont know if should be commented out
else if(!keyName.compare("BackSpace") || !keyName.compare("XF86Back"))
self->backPressed();
// MERGE_ME dont know if should be commented out
else if(!keyName.compare("BackSpace") || !keyName.compare("XF86Back"))
self->backPressed();
+ else if(!keyName.compare("Escape"))
+ self->escapePressed();
} else if(type == ECORE_EVENT_KEY_UP) {
M_ASSERT(event);
Ecore_Event_Key *ev = static_cast<Ecore_Event_Key *>(event);
} else if(type == ECORE_EVENT_KEY_UP) {
M_ASSERT(event);
Ecore_Event_Key *ev = static_cast<Ecore_Event_Key *>(event);
boost::signals2::signal<void ()> leftPressed;
boost::signals2::signal<void ()> rightPressed;
boost::signals2::signal<void ()> backPressed;
boost::signals2::signal<void ()> leftPressed;
boost::signals2::signal<void ()> rightPressed;
boost::signals2::signal<void ()> backPressed;
+ boost::signals2::signal<void ()> escapePressed;
boost::signals2::signal<void ()> mouseClicked;
/**
boost::signals2::signal<void ()> mouseClicked;
/**
m_platformInputManager->returnPressed.connect(boost::bind(&elm_exit));
m_platformInputManager->backPressed.connect(boost::bind(&SimpleUI::onBackPressed, this));
m_platformInputManager->returnPressed.connect(boost::bind(&elm_exit));
m_platformInputManager->backPressed.connect(boost::bind(&SimpleUI::onBackPressed, this));
+ m_platformInputManager->escapePressed.connect(boost::bind(&SimpleUI::onEscapePressed, this));
m_platformInputManager->mouseClicked.connect(
boost::bind(&SimpleUI::onMouseClick, this));
m_platformInputManager->mouseClicked.connect(
boost::bind(&SimpleUI::onMouseClick, this));
void SimpleUI::onBackPressed()
{
BROWSER_LOGD("[%s]", __func__);
void SimpleUI::onBackPressed()
{
BROWSER_LOGD("[%s]", __func__);
- if (m_webPageUI->isHomePageActive()) {
+ if (m_zoomUI->isVisible()) {
+ m_zoomUI->escapeZoom();
+ } else if (m_webPageUI->isHomePageActive()) {
m_quickAccess->backButtonClicked();
} else {
if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus)
m_quickAccess->backButtonClicked();
} else {
if (!m_webPageUI->getURIEntry().hasFocus() && !m_wvIMEStatus)
+void SimpleUI::onEscapePressed()
+{
+ BROWSER_LOGD("[%s]", __func__);
+ m_zoomUI->escapeZoom();
+}
+
void SimpleUI::reloadEnable(bool enable)
{
m_webPageUI->setReloadButtonEnabled(enable);
void SimpleUI::reloadEnable(bool enable)
{
m_webPageUI->setReloadButtonEnabled(enable);
void onReturnPressed(MenuButton *m);
void onBackPressed();
void onReturnPressed(MenuButton *m);
void onBackPressed();
+ void onEscapePressed();
void searchWebPage(std::string &text, int flags);
void searchWebPage(std::string &text, int flags);
evas_object_show(m_nav_layout);
}
evas_object_show(m_nav_layout);
}
+bool ZoomUI::isVisible()
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ if (evas_object_visible_get(m_layout) || (*(getZoom()) != ZOOM_DEFAULT))
+ return true;
+ else
+ return false;
+}
+
void ZoomUI::createLayout(Evas_Object *parent)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
void ZoomUI::createLayout(Evas_Object *parent)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+void ZoomUI::escapeZoom()
+{
+ BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
+ if (isVisible()) {
+ setZoom(ZoomUI::ZOOM_DEFAULT);
+ hideUI();
+ }
+}
+
Eina_Bool ZoomUI::_key_down_cb(void* data, int, void* event_info)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
Eina_Bool ZoomUI::_key_down_cb(void* data, int, void* event_info)
{
BROWSER_LOGD("[%s:%d] ", __PRETTY_FUNCTION__, __LINE__);
void show(Evas_Object* parent);
void showNavigation();
void clearItems();
void show(Evas_Object* parent);
void showNavigation();
void clearItems();
+ bool isVisible();
+ void escapeZoom();
boost::signals2::signal<void ()> closeZoomUI;
boost::signals2::signal<void (int)> setZoom;
boost::signals2::signal<void ()> closeZoomUI;
boost::signals2::signal<void (int)> setZoom;