Commit 25928a8a authored by Emmanuel Lepage's avatar Emmanuel Lepage
Browse files

[ #13499 ] Use parent container instead of tracking every main screen widgets individualy

parent c08d2960
......@@ -48,6 +48,7 @@ typedef struct {
GtkWidget* view;
GtkWidget* tree;
GtkWidget* searchbar;
GtkWidget* mainwidget;
// Calllist vars
GQueue* callQueue;
......
......@@ -45,6 +45,7 @@ calltab_t* calltab_init(gboolean searchbar_type, const gchar * const name)
ret->callQueue = g_queue_new();
ret->selectedCall = NULL;
ret->mainwidget = NULL;
return ret;
}
......
......@@ -1125,9 +1125,15 @@ void calltree_display(calltab_t *tab)
} else
ERROR("Not a valid call tab (%d, %s)", __LINE__, __FILE__);
gtk_widget_hide(active_calltree_tab->tree);
if (active_calltree_tab->mainwidget)
gtk_widget_hide(active_calltree_tab->mainwidget);
else
gtk_widget_hide(active_calltree_tab->tree);
active_calltree_tab = tab;
gtk_widget_show(active_calltree_tab->tree);
if (active_calltree_tab->mainwidget)
gtk_widget_show(active_calltree_tab->mainwidget);
else
gtk_widget_show(active_calltree_tab->tree);
GtkTreeSelection *sel = gtk_tree_view_get_selection(GTK_TREE_VIEW(active_calltree_tab->view));
g_signal_emit_by_name(sel, "changed");
......
......@@ -262,23 +262,27 @@ create_main_window()
widget = create_toolbar_actions(ui_manager);
pack_main_window_start(GTK_BOX(vbox), widget, FALSE, TRUE, 0);
/* Add paned */
/* Setup call main widget*/
GtkWidget *vpaned = gtk_vpaned_new();
current_calls_tab->mainwidget = vpaned;
gtk_widget_show (vpaned);
gtk_box_pack_start(GTK_BOX(vbox), vpaned, TRUE, TRUE, 0);
/* Setup history main widget */
GtkWidget *history_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
history_tab->mainwidget = history_vbox;
gtk_box_set_homogeneous(GTK_BOX(history_vbox), FALSE);
gtk_box_pack_start(GTK_BOX(history_vbox), history_tab->tree, TRUE, TRUE, 0);
/* Add tree views */
// gtk_box_pack_start(GTK_BOX(vbox), current_calls_tab->tree, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), history_tab->tree, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), contacts_tab->tree, TRUE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), history_vbox, TRUE, TRUE, 0);
gtk_paned_pack1 (GTK_PANED (vpaned), current_calls_tab->tree, TRUE, FALSE);
gtk_paned_add1 (GTK_PANED (vpaned), history_tab->tree);
gtk_paned_add1 (GTK_PANED (vpaned), contacts_tab->tree);
gtk_paned_pack2 (GTK_PANED (vpaned), tab_widget, FALSE, FALSE);
/* Add playback scale */
/* Add playback scale and setup history tab */
seekslider = GTK_WIDGET(sfl_seekslider_new());
pack_main_window_start(GTK_BOX(vbox), seekslider, FALSE, TRUE, 0);
pack_main_window_start(GTK_BOX(history_vbox), seekslider, FALSE, TRUE, 0);
gtk_box_pack_start(GTK_BOX(vbox), subvbox, FALSE, FALSE, 0);
......@@ -314,7 +318,7 @@ create_main_window()
gtk_widget_show_all(window);
/* dont't show the history */
gtk_widget_hide(history_tab->tree);
gtk_widget_hide(history_vbox);
/* dont't show the contact list */
gtk_widget_hide(contacts_tab->tree);
......
......@@ -981,7 +981,7 @@ toggle_addressbook_cb(GtkToggleAction *action, gpointer user_data UNUSED)
{
if (gtk_toggle_action_get_active(action)) {
calltree_display(contacts_tab);
main_window_show_playback_scale();
main_window_hide_playback_scale();
}
else {
calltree_display(current_calls_tab);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment