From 06b668cbdb9827497bc889b90a8ac73e94f6206d Mon Sep 17 00:00:00 2001 From: Sangpyo Kim Date: Mon, 27 Aug 2012 15:34:13 +0900 Subject: [Title] hiding zoom button when the zoom is not available. [Issue#] N_SE-5910 [Problem] Zoom is not available at some pages [Cause] some of webpages have fixed scale factor. [Solution] hiding the zoom button when the zoom is not available [Team] Browser UI [Developer] sangpyo7.kim [Request] N/A Change-Id: I2b9cb66627d406d6491a08bc79d0316a11dd0de9 --- src/browser-view/browser-view.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/browser-view/browser-view.cpp b/src/browser-view/browser-view.cpp index cbfa592..82b9a8f 100755 --- a/src/browser-view/browser-view.cpp +++ b/src/browser-view/browser-view.cpp @@ -1306,7 +1306,7 @@ void Browser_View::__ewk_view_mouse_down_cb(void* data, Evas* evas, Evas_Object* BROWSER_LOGD("__ewk_view_mouse_down_cb"); #ifdef ZOOM_BUTTON - double sacle_factor = ewk_view_scale_get(browser_view->m_focused_window->m_ewk_view); + double scale_factor = ewk_view_scale_get(browser_view->m_focused_window->m_ewk_view); double min_scale = 0; double max_scale = 0; @@ -1319,10 +1319,15 @@ void Browser_View::__ewk_view_mouse_down_cb(void* data, Evas* evas, Evas_Object* if (zoom_button_flag == false) return; - if (browser_view->m_zoom_button_timer) - ecore_timer_del(browser_view->m_zoom_button_timer); - browser_view->m_zoom_button_timer = ecore_timer_add(3, __zoom_button_timeout_cb, browser_view); - edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), "show,zoom_buttons,signal", ""); + + ewk_view_scale_range_get(browser_view->m_focused_window->m_ewk_view, + &min_scale, &max_scale); + if (scale_factor > min_scale && scale_factor < max_scale) { + if (browser_view->m_zoom_button_timer) + ecore_timer_del(browser_view->m_zoom_button_timer); + browser_view->m_zoom_button_timer = ecore_timer_add(3, __zoom_button_timeout_cb, browser_view); + edje_object_signal_emit(elm_layout_edje_get(browser_view->m_main_layout), "show,zoom_buttons,signal", ""); + } #endif } -- cgit v1.2.3