summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBoris Faure <billiob@gmail.com>2015-04-30 21:06:06 +0200
committerBoris Faure <billiob@gmail.com>2015-04-30 21:06:06 +0200
commit27179b6525ea8c16e812124e558fe37e48613aa3 (patch)
tree4ef64cadc0b042677322e6ff0ded9ed42497890d /src
parentf64356baac159406357f7160df0c5c6ecc1220d7 (diff)
restore animation when moving between tabs. Closes T2380
Diffstat (limited to 'src')
-rw-r--r--src/bin/win.c37
1 files changed, 35 insertions, 2 deletions
diff --git a/src/bin/win.c b/src/bin/win.c
index 69044c9..717ba27 100644
--- a/src/bin/win.c
+++ b/src/bin/win.c
@@ -1665,6 +1665,11 @@ _tabs_selector_cb_exit(void *data,
1665 void *info EINA_UNUSED); 1665 void *info EINA_UNUSED);
1666 1666
1667static void 1667static void
1668_tabs_selector_cb_ending(void *data,
1669 Evas_Object *obj EINA_UNUSED,
1670 void *info EINA_UNUSED);
1671
1672static void
1668_tabs_restore(Tabs *tabs) 1673_tabs_restore(Tabs *tabs)
1669{ 1674{
1670 Eina_List *l; 1675 Eina_List *l;
@@ -1698,6 +1703,8 @@ _tabs_restore(Tabs *tabs)
1698 _tabs_selector_cb_selected, tabs); 1703 _tabs_selector_cb_selected, tabs);
1699 evas_object_smart_callback_del_full(tabs->selector, "exit", 1704 evas_object_smart_callback_del_full(tabs->selector, "exit",
1700 _tabs_selector_cb_exit, tabs); 1705 _tabs_selector_cb_exit, tabs);
1706 evas_object_smart_callback_del_full(tabs->selector, "ending",
1707 _tabs_selector_cb_ending, tabs);
1701 evas_object_del(tabs->selector); 1708 evas_object_del(tabs->selector);
1702 evas_object_del(tabs->selector_bg); 1709 evas_object_del(tabs->selector_bg);
1703 tabs->selector = NULL; 1710 tabs->selector = NULL;
@@ -1718,6 +1725,15 @@ _tabs_restore(Tabs *tabs)
1718} 1725}
1719 1726
1720static void 1727static void
1728_tabs_selector_cb_ending(void *data,
1729 Evas_Object *obj EINA_UNUSED,
1730 void *info EINA_UNUSED)
1731{
1732 Tabs *tabs = data;
1733 edje_object_signal_emit(tabs->selector_bg, "end", "terminology");
1734}
1735
1736static void
1721_tabs_selector_cb_selected(void *data, 1737_tabs_selector_cb_selected(void *data,
1722 Evas_Object *obj EINA_UNUSED, 1738 Evas_Object *obj EINA_UNUSED,
1723 void *info) 1739 void *info)
@@ -1750,7 +1766,7 @@ _tabs_selector_cb_exit(void *data,
1750} 1766}
1751 1767
1752static void 1768static void
1753_cb_tab_selector_show(Tabs *tabs) 1769_cb_tab_selector_show(Tabs *tabs, Tab_Item *to_item)
1754{ 1770{
1755 Term_Container *tc = (Term_Container *)tabs; 1771 Term_Container *tc = (Term_Container *)tabs;
1756 Eina_List *l; 1772 Eina_List *l;
@@ -1824,10 +1840,13 @@ _cb_tab_selector_show(Tabs *tabs)
1824 /* XXX: refresh */ 1840 /* XXX: refresh */
1825 tc->parent->swallow(tc->parent, tc, tc); 1841 tc->parent->swallow(tc->parent, tc, tc);
1826 1842
1843 evas_object_show(tabs->selector_bg);
1827 evas_object_smart_callback_add(tabs->selector, "selected", 1844 evas_object_smart_callback_add(tabs->selector, "selected",
1828 _tabs_selector_cb_selected, tabs); 1845 _tabs_selector_cb_selected, tabs);
1829 evas_object_smart_callback_add(tabs->selector, "exit", 1846 evas_object_smart_callback_add(tabs->selector, "exit",
1830 _tabs_selector_cb_exit, tabs); 1847 _tabs_selector_cb_exit, tabs);
1848 evas_object_smart_callback_add(tabs->selector, "ending",
1849 _tabs_selector_cb_ending, tabs);
1831 z = 1.0; 1850 z = 1.0;
1832 sel_go(tabs->selector); 1851 sel_go(tabs->selector);
1833 count = eina_list_count(tabs->tabs); 1852 count = eina_list_count(tabs->tabs);
@@ -1836,6 +1855,12 @@ _cb_tab_selector_show(Tabs *tabs)
1836 if (z > 1.0) z = 1.0; 1855 if (z > 1.0) z = 1.0;
1837 sel_orig_zoom_set(tabs->selector, z); 1856 sel_orig_zoom_set(tabs->selector, z);
1838 sel_zoom(tabs->selector, z); 1857 sel_zoom(tabs->selector, z);
1858 if (to_item)
1859 {
1860 sel_entry_selected_set(tabs->selector, to_item->tc->selector_img,
1861 EINA_TRUE);
1862 sel_exit(tabs->selector);
1863 }
1839 elm_object_focus_set(tabs->selector, EINA_TRUE); 1864 elm_object_focus_set(tabs->selector, EINA_TRUE);
1840} 1865}
1841 1866
@@ -1861,7 +1886,7 @@ _cb_select(void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED)
1861 continue; 1886 continue;
1862 } 1887 }
1863 1888
1864 _cb_tab_selector_show(tabs); 1889 _cb_tab_selector_show(tabs, NULL);
1865 return; 1890 return;
1866 } 1891 }
1867} 1892}
@@ -2267,7 +2292,15 @@ _tabs_focus(Term_Container *tc, Term_Container *relative)
2267 tab_item = l->data; 2292 tab_item = l->data;
2268 if (tab_item != tabs->current) 2293 if (tab_item != tabs->current)
2269 { 2294 {
2295 Config *config = tc->wn->config;
2270 tabs->current->tc->unfocus(tabs->current->tc, tc); 2296 tabs->current->tc->unfocus(tabs->current->tc, tc);
2297
2298 if (config->tab_zoom >= 0.01 && config->notabs)
2299 {
2300 _cb_tab_selector_show(tabs, tab_item);
2301 return;
2302 }
2303
2271 tc->swallow(tc, tabs->current->tc, relative); 2304 tc->swallow(tc, tabs->current->tc, relative);
2272 } 2305 }
2273 tc->parent->focus(tc->parent, tc); 2306 tc->parent->focus(tc->parent, tc);