Enlightenment CVS committal Author : lok Project : e17 Module : proto
Dir : e17/proto/etk/src/lib Modified Files: etk_notebook.c etk_notebook.h Log Message: [Etk_Notebook] the frame border of the notebook is now show/hide with the tabs =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/etk_notebook.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -3 -r1.22 -r1.23 --- etk_notebook.c 31 Jul 2006 20:08:00 -0000 1.22 +++ etk_notebook.c 1 Aug 2006 05:40:57 -0000 1.23 @@ -27,6 +27,7 @@ static void _etk_notebook_child_add(Etk_Container *container, Etk_Widget *widget); static void _etk_notebook_child_remove(Etk_Container *container, Etk_Widget *widget); static Evas_List *_etk_notebook_children_get(Etk_Container *container); +static void _etk_notebook_show_frame_borders_set(Etk_Notebook_Page *page, Etk_Bool tab_bar_visible); static void _etk_notebook_tab_toggled_cb(Etk_Object *object, void *data); static void _etk_notebook_tab_bar_focused_cb(Etk_Object *object, void *data); @@ -386,13 +387,27 @@ */ void etk_notebook_show_tabs_set(Etk_Notebook *notebook, Etk_Bool show_tabs) { - if (show_tabs == ETK_FALSE) + Evas_List *page = NULL; + + if (notebook == NULL) + return; + + notebook->tab_bar_visible = show_tabs; + if (notebook->tab_bar) { - etk_widget_hide(notebook->tab_bar); + show_tabs ? etk_widget_show(notebook->tab_bar) : etk_widget_hide(notebook->tab_bar); } - else if (show_tabs == ETK_TRUE) + if (notebook->pages) { - etk_widget_show(notebook->tab_bar); + page = notebook->pages; + while (page) + { + if (page->data) + { + _etk_notebook_show_frame_borders_set(page->data, show_tabs); + } + page = evas_list_next(page); + } } } @@ -403,7 +418,7 @@ */ Etk_Bool etk_notebook_show_tabs_get(Etk_Notebook *notebook) { - return etk_widget_is_visible(ETK_NOTEBOOK(notebook)->tab_bar); + return notebook->tab_bar_visible; } /************************** @@ -421,6 +436,7 @@ notebook->pages = NULL; notebook->current_page = NULL; notebook->tab_bar_focused = ETK_FALSE; + notebook->tab_bar_focused = ETK_TRUE; _etk_notebook_tab_bar_create(notebook); @@ -601,6 +617,19 @@ return children; } +/* Set the frame borders visible if tab_bar_visible is true */ +static void _etk_notebook_show_frame_borders_set(Etk_Notebook_Page *page, Etk_Bool tab_bar_visible) +{ + if (tab_bar_visible == ETK_TRUE) + { + etk_widget_theme_group_set(page->frame, "frame"); + } + else + { + etk_widget_theme_group_set(page->frame, NULL); + } +} + /************************** * * Callbacks and handlers @@ -738,7 +767,10 @@ etk_widget_show(new_page->tab); etk_signal_connect("toggled", ETK_OBJECT(new_page->tab), ETK_CALLBACK(_etk_notebook_tab_toggled_cb), notebook); - new_page->frame = etk_widget_new(ETK_BIN_TYPE, "theme_group", "frame", NULL); + if (notebook->tab_bar_visible) + new_page->frame = etk_widget_new(ETK_BIN_TYPE, "theme_group", "frame", NULL); + else + new_page->frame = etk_widget_new(ETK_BIN_TYPE, "theme_group", NULL, NULL); etk_widget_parent_set(new_page->frame, ETK_WIDGET(notebook)); etk_widget_visibility_locked_set(new_page->frame, ETK_TRUE); etk_widget_hide(new_page->frame); @@ -749,6 +781,7 @@ _etk_notebook_page_switch(notebook, new_page); etk_widget_size_recalc_queue(ETK_WIDGET(notebook)); + return new_page; } =================================================================== RCS file: /cvs/e/e17/proto/etk/src/lib/etk_notebook.h,v retrieving revision 1.14 retrieving revision 1.15 diff -u -3 -r1.14 -r1.15 --- etk_notebook.h 31 Jul 2006 20:08:00 -0000 1.14 +++ etk_notebook.h 1 Aug 2006 05:40:57 -0000 1.15 @@ -45,6 +45,7 @@ Etk_Widget *tab_bar; Etk_Bool tab_bar_focused; + Etk_Bool tab_bar_visible; Evas_List *pages; Etk_Notebook_Page *current_page; ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ enlightenment-cvs mailing list enlightenment-cvs@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs