TizenRefApp-7457 [Email] Fix initial scrolling in Composer issue in 21/93121/1
authorIgor Nazarov <i.nazarov@samsung.com>
Thu, 20 Oct 2016 07:54:17 +0000 (10:54 +0300)
committerIgor Nazarov <i.nazarov@samsung.com>
Thu, 20 Oct 2016 09:53:29 +0000 (12:53 +0300)
landscape mode

Change-Id: I7fbb3f38ed716b7aa97cbc356cb4cefe66258405

modules/composer/src/email-composer-initial-view.c

index 9acfd7f..3d8eb37 100644 (file)
@@ -444,6 +444,7 @@ static void _initial_view_cs_update(EmailComposerView *view, int event_mask)
                event_mask |= COMPOSER_CSEF_RESIZE_EVENTS;
                if (view->selected_widget == view->ewk_view) {
                        view->cs_bringin_to_ewk = true;
+                       debug_log("Enable bringin to EWK");
                }
                view->cs_ready = true;
                debug_log("Ready");
@@ -556,11 +557,14 @@ static void _initial_view_cs_handle_ewk_selection_change(EmailComposerView *view
        const int caret_scroller_top = caret_content_top - view->cs_scroll_pos;
        const int caret_scroller_bottom = caret_content_bottom - view->cs_scroll_pos;
 
-       if ((caret_scroller_top <= view->cs_rttb_height + caret_padding) ||
+       if (view->cs_bringin_to_ewk ||
+               (caret_scroller_top <= view->cs_rttb_height + caret_padding) ||
                (caret_scroller_bottom >= view->cs_height - caret_padding)) {
 
                int new_scroll_pos = 0;
-               if (caret_scroller_top <= view->cs_rttb_height + caret_padding) {
+               if (view->cs_bringin_to_ewk) {
+                       new_scroll_pos = view->cs_edge_scroll_pos;
+               } else if (caret_scroller_top <= view->cs_rttb_height + caret_padding) {
                        new_scroll_pos = caret_content_top - view->cs_rttb_height - caret_padding;
                } else {
                        new_scroll_pos = caret_content_bottom - view->cs_height + caret_padding;
@@ -578,12 +582,6 @@ static void _initial_view_cs_handle_ewk_selection_change(EmailComposerView *view
                }
 
                view->cs_bringin_to_ewk = false;
-
-       } else if (prefer_bringin && view->cs_bringin_to_ewk) {
-               if (view->cs_scroll_pos < view->cs_edge_scroll_pos) {
-                       composer_initial_view_cs_bring_in(view, view->cs_edge_scroll_pos);
-               }
-               view->cs_bringin_to_ewk = false;
        }
 
        debug_leave();