[Email] Fix composer bringin animation 39/98239/1
authorIgor Nazarov <i.nazarov@samsung.com>
Mon, 14 Nov 2016 17:06:46 +0000 (19:06 +0200)
committerIgor Nazarov <i.nazarov@samsung.com>
Mon, 14 Nov 2016 17:06:46 +0000 (19:06 +0200)
Change-Id: I6e6a6f529609c994cb084aa728a07fa084f829ab

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

index b76dd1d..90f6520 100644 (file)
@@ -556,17 +556,18 @@ 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 (view->cs_bringin_to_ewk ||
+       if ((prefer_bringin && isCollapsed && 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 (view->cs_bringin_to_ewk) {
-                       new_scroll_pos = view->cs_edge_scroll_pos;
-               } else if (caret_scroller_top <= view->cs_rttb_height + caret_padding) {
+
+               if (caret_scroller_top <= view->cs_rttb_height + caret_padding) {
                        new_scroll_pos = caret_content_top - view->cs_rttb_height - caret_padding;
-               } else {
+               } else if (caret_scroller_bottom >= view->cs_height - caret_padding) {
                        new_scroll_pos = caret_content_bottom - view->cs_height + caret_padding;
+               } else {
+                       new_scroll_pos = view->cs_edge_scroll_pos;
                }
 
                if ((view->cs_scroll_pos >= view->cs_edge_scroll_pos) &&