From: Maksym Veremeyenko Date: Tue, 14 Jun 2011 13:06:01 +0000 (+0300) Subject: files plane now contains dirs and files X-Git-Url: http://research.m1stereo.tv/gitweb?a=commitdiff_plain;h=450db4d7571b16cdba45e03c11ab623dcf5d52dc;p=rugen files plane now contains dirs and files --- diff --git a/src/interface.c b/src/interface.c index f969749..9b16055 100644 --- a/src/interface.c +++ b/src/interface.c @@ -662,30 +662,49 @@ static GtkWidget* create_pane_filedir( GtkWidget* top ) { - GtkWidget* table1, *scrolledwindow1, *list_dir; - - table1 = gtk_table_new (1, 1, FALSE); - gtk_widget_show (table1); - - scrolledwindow1 = gtk_scrolled_window_new (NULL, NULL); - gtk_widget_show (scrolledwindow1); - gtk_table_attach (GTK_TABLE (table1), scrolledwindow1, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_SHRINK | GTK_FILL), - (GtkAttachOptions) (GTK_EXPAND | GTK_SHRINK | GTK_FILL), 0, 0); - gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow1), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - - list_dir = gtk_tree_view_new (); - gtk_widget_show (list_dir); - gtk_container_add (GTK_CONTAINER (scrolledwindow1), list_dir); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (list_dir), FALSE); - - GLADE_HOOKUP_OBJECT (top, table1, "table1"); - GLADE_HOOKUP_OBJECT (top, scrolledwindow1, "scrolledwindow1"); - GLADE_HOOKUP_OBJECT (top, list_dir, "list_dir"); - - gtk_widget_grab_focus (list_dir); - - return table1; + GtkWidget* vpaned; + GtkWidget* scrolledwindow[2]; + GtkWidget* list[2]; + + /* create a vertical pane for dirs list and clips list */ + vpaned = gtk_vpaned_new (); + gtk_widget_show (vpaned); + + /* create two scrolled window for lists areas */ + scrolledwindow[0] = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow[0]); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow[0]), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + scrolledwindow[1] = gtk_scrolled_window_new (NULL, NULL); + gtk_widget_show (scrolledwindow[1]); + gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow[1]), + GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + + /* pane them */ + gtk_widget_set_size_request (vpaned, 400 , -1); + gtk_paned_pack1 (GTK_PANED (vpaned), scrolledwindow[0], FALSE, FALSE); + gtk_widget_set_size_request (scrolledwindow[0], 150, -1); + gtk_paned_pack2 (GTK_PANED (vpaned), scrolledwindow[1], TRUE, FALSE); + gtk_widget_set_size_request (scrolledwindow[1], 250, -1); + + /* list_dirs */ + list[0] = gtk_tree_view_new (); + gtk_widget_show (list[0]); + gtk_container_add (GTK_CONTAINER (scrolledwindow[0]), list[0]); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (list[0]), FALSE); + GLADE_HOOKUP_OBJECT (top, list[0], "list_dir"); + + /* list_clips */ + list[1] = gtk_tree_view_new (); + gtk_widget_show (list[1]); + gtk_container_add (GTK_CONTAINER (scrolledwindow[1]), list[1]); + gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (list[1]), FALSE); + gtk_tree_view_set_enable_search (GTK_TREE_VIEW (list[1]), FALSE); + GLADE_HOOKUP_OBJECT (top, list[1], "list_clips"); + + gtk_widget_grab_focus (list[0]); + + return vpaned; }; static @@ -695,7 +714,6 @@ create_pane_playlist( GtkWidget* top ) GtkWidget *vpaned1; GtkWidget *table5; GtkWidget *scrolledwindow6; - GtkWidget *list_clips; GtkWidget *table4; GtkWidget *scrolledwindow5; GtkWidget *treeview1; @@ -717,12 +735,6 @@ create_pane_playlist( GtkWidget* top ) (GtkAttachOptions) (GTK_EXPAND | GTK_SHRINK | GTK_FILL), 0, 0); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolledwindow6), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - list_clips = gtk_tree_view_new (); - gtk_widget_show (list_clips); - gtk_container_add (GTK_CONTAINER (scrolledwindow6), list_clips); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (list_clips), FALSE); - gtk_tree_view_set_enable_search (GTK_TREE_VIEW (list_clips), FALSE); - table4 = gtk_table_new (2, 1, FALSE); gtk_paned_pack2 (GTK_PANED (vpaned1), table4, TRUE, TRUE); @@ -752,7 +764,6 @@ create_pane_playlist( GtkWidget* top ) GLADE_HOOKUP_OBJECT (top, vpaned1, "vpaned1"); GLADE_HOOKUP_OBJECT (top, table5, "table5"); GLADE_HOOKUP_OBJECT (top, scrolledwindow6, "scrolledwindow6"); - GLADE_HOOKUP_OBJECT (top, list_clips, "list_clips"); GLADE_HOOKUP_OBJECT (top, table4, "table4"); GLADE_HOOKUP_OBJECT (top, scrolledwindow5, "scrolledwindow5"); GLADE_HOOKUP_OBJECT (top, treeview1, "treeview1");