diff options
author | raveit65 <[email protected]> | 2016-08-09 12:22:45 +0200 |
---|---|---|
committer | raveit65 <[email protected]> | 2016-08-12 22:37:47 +0200 |
commit | f7308f8d78c839411b76b6e45868156dd3543506 (patch) | |
tree | 4169334262d209c14db4ef22b3393873e5bde4c4 | |
parent | f5164f75918a8e65ccde9565c4fd9f366064172e (diff) | |
download | caja-f7308f8d78c839411b76b6e45868156dd3543506.tar.bz2 caja-f7308f8d78c839411b76b6e45868156dd3543506.tar.xz |
GTK+-3 window: port GtkTable to GtkGrid
-rw-r--r-- | src/caja-navigation-window.c | 15 | ||||
-rw-r--r-- | src/caja-spatial-window.c | 18 | ||||
-rw-r--r-- | src/caja-window-private.h | 4 | ||||
-rw-r--r-- | src/caja-window.c | 18 |
4 files changed, 53 insertions, 2 deletions
diff --git a/src/caja-navigation-window.c b/src/caja-navigation-window.c index fbaaf5a4..8c1db6a8 100644 --- a/src/caja-navigation-window.c +++ b/src/caja-navigation-window.c @@ -153,15 +153,20 @@ caja_navigation_window_init (CajaNavigationWindow *window) #if GTK_CHECK_VERSION(3, 0, 0) window->details->content_paned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL); + gtk_widget_set_hexpand (window->details->content_paned, TRUE); + gtk_widget_set_vexpand (window->details->content_paned, TRUE); + gtk_grid_attach (GTK_GRID (CAJA_WINDOW (window)->details->grid), + window->details->content_paned, + 0, 3, 1, 1); #else window->details->content_paned = gtk_hpaned_new (); -#endif gtk_table_attach (GTK_TABLE (CAJA_WINDOW (window)->details->table), window->details->content_paned, /* X direction */ /* Y direction */ 0, 1, 3, 4, GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); +#endif gtk_widget_show (window->details->content_paned); vbox = gtk_vbox_new (FALSE, 0); @@ -198,7 +203,12 @@ caja_navigation_window_init (CajaNavigationWindow *window) toolbar = gtk_ui_manager_get_widget (ui_manager, "/Toolbar"); #if GTK_CHECK_VERSION(3, 0, 0) gtk_style_context_add_class (gtk_widget_get_style_context (toolbar), GTK_STYLE_CLASS_PRIMARY_TOOLBAR); -#endif + window->details->toolbar = toolbar; + gtk_widget_set_hexpand (toolbar, TRUE); + gtk_grid_attach (GTK_GRID (CAJA_WINDOW (window)->details->grid), + toolbar, + 0, 1, 1, 1); +#else window->details->toolbar = toolbar; gtk_table_attach (GTK_TABLE (CAJA_WINDOW (window)->details->table), toolbar, @@ -206,6 +216,7 @@ caja_navigation_window_init (CajaNavigationWindow *window) 0, 1, 1, 2, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0); +#endif gtk_widget_show (toolbar); caja_navigation_window_initialize_toolbars (window); diff --git a/src/caja-spatial-window.c b/src/caja-spatial-window.c index fa426dcf..83e65011 100644 --- a/src/caja-spatial-window.c +++ b/src/caja-spatial-window.c @@ -1008,6 +1008,23 @@ caja_spatial_window_init (CajaSpatialWindow *window) win = CAJA_WINDOW (window); +#if GTK_CHECK_VERSION(3, 0, 0) + gtk_widget_set_hexpand (win->details->statusbar, TRUE); + gtk_grid_attach (GTK_GRID (win->details->grid), + win->details->statusbar, + 0, 5, 1, 1); + gtk_widget_show (win->details->statusbar); + + pane = caja_window_pane_new (win); + win->details->panes = g_list_prepend (win->details->panes, pane); + + vbox = gtk_vbox_new (FALSE, 0); + gtk_widget_set_hexpand (vbox, TRUE); + gtk_widget_set_vexpand (vbox, TRUE); + gtk_grid_attach (GTK_GRID (CAJA_WINDOW (window)->details->grid), + vbox, + 0, 1, 1, 3); +#else gtk_table_attach (GTK_TABLE (win->details->table), win->details->statusbar, /* X direction */ /* Y direction */ @@ -1026,6 +1043,7 @@ caja_spatial_window_init (CajaSpatialWindow *window) 0, 1, 1, 4, GTK_EXPAND | GTK_FILL | GTK_SHRINK, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0); +#endif gtk_widget_show (vbox); window->details->content_box = vbox; diff --git a/src/caja-window-private.h b/src/caja-window-private.h index 1147163f..a2361790 100644 --- a/src/caja-window-private.h +++ b/src/caja-window-private.h @@ -42,7 +42,11 @@ struct _CajaNavigationWindowPane; /* FIXME bugzilla.gnome.org 42575: Migrate more fields into here. */ struct CajaWindowDetails { +#if GTK_CHECK_VERSION (3, 0, 0) + GtkWidget *grid; +#else GtkWidget *table; +#endif GtkWidget *statusbar; GtkWidget *menubar; diff --git a/src/caja-window.c b/src/caja-window.c index 4fae7f39..96c97e4e 100644 --- a/src/caja-window.c +++ b/src/caja-window.c @@ -130,7 +130,11 @@ static const struct static void caja_window_init (CajaWindow *window) { +#if GTK_CHECK_VERSION (3, 0, 0) + GtkWidget *grid; +#else GtkWidget *table; +#endif GtkWidget *menu; GtkWidget *statusbar; @@ -178,10 +182,18 @@ caja_window_init (CajaWindow *window) /* Set initial window title */ gtk_window_set_title (GTK_WINDOW (window), _("Caja")); +#if GTK_CHECK_VERSION (3, 0, 0) + grid = gtk_grid_new (); + gtk_orientable_set_orientation (GTK_ORIENTABLE (grid), GTK_ORIENTATION_VERTICAL); + window->details->grid = grid; + gtk_widget_show (grid); + gtk_container_add (GTK_CONTAINER (window), grid); +#else table = gtk_table_new (1, 6, FALSE); window->details->table = table; gtk_widget_show (table); gtk_container_add (GTK_CONTAINER (window), table); +#endif statusbar = gtk_statusbar_new (); gtk_widget_set_name (statusbar, "statusbar-noborder"); @@ -201,6 +213,11 @@ caja_window_init (CajaWindow *window) menu = gtk_ui_manager_get_widget (window->details->ui_manager, "/MenuBar"); window->details->menubar = menu; +#if GTK_CHECK_VERSION(3, 0, 0) + gtk_widget_set_hexpand (menu, TRUE); + gtk_widget_show (menu); + gtk_grid_attach (GTK_GRID (grid), menu, 0, 0, 1, 1); +#else gtk_widget_show (menu); gtk_table_attach (GTK_TABLE (table), menu, @@ -208,6 +225,7 @@ caja_window_init (CajaWindow *window) 0, 1, 0, 1, GTK_EXPAND | GTK_FILL | GTK_SHRINK, 0, 0, 0); +#endif /* Register to menu provider extension signal managing menu updates */ g_signal_connect_object (caja_signaller_get_current (), "popup_menu_changed", |