diff options
Diffstat (limited to 'shell')
-rw-r--r-- | shell/e-shell-content.c | 16 | ||||
-rw-r--r-- | shell/e-shell-sidebar.c | 2 | ||||
-rw-r--r-- | shell/e-shell-switcher.c | 19 | ||||
-rw-r--r-- | shell/e-shell-taskbar.c | 16 | ||||
-rw-r--r-- | shell/e-shell-window-actions.c | 8 | ||||
-rw-r--r-- | shell/main.c | 15 |
6 files changed, 46 insertions, 30 deletions
diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 5d5857cfc2..658bb2a6fc 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -201,7 +201,7 @@ shell_content_size_allocate (GtkWidget *widget, priv = E_SHELL_CONTENT_GET_PRIVATE (widget); - widget->allocation = *allocation; + gtk_widget_set_allocation (widget, allocation); child = priv->searchbar; @@ -254,11 +254,13 @@ shell_content_forall (GtkContainer *container, gpointer callback_data) { EShellContentPrivate *priv; + GtkWidget *parent; priv = E_SHELL_CONTENT_GET_PRIVATE (container); + parent = gtk_widget_get_parent (priv->searchbar); if (include_internals && priv->searchbar != NULL && - container == GTK_CONTAINER (priv->searchbar->parent)) + container == GTK_CONTAINER (parent)) callback (priv->searchbar, callback_data); /* Chain up to parent's forall() method. */ @@ -409,6 +411,7 @@ e_shell_content_run_advanced_search_dialog (EShellContent *shell_content) { EShellView *shell_view; EShellWindow *shell_window; + GtkWidget *content_area; GtkWidget *dialog; GtkWidget *widget; EFilterRule *rule; @@ -445,8 +448,8 @@ e_shell_content_run_advanced_search_dialog (EShellContent *shell_content) gtk_container_set_border_width (GTK_CONTAINER (widget), 3); gtk_window_set_default_size (GTK_WINDOW (dialog), 600, 300); - gtk_box_pack_start ( - GTK_BOX (GTK_DIALOG (dialog)->vbox), widget, TRUE, TRUE, 0); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); g_signal_connect_swapped ( rule, "changed", G_CALLBACK ( @@ -510,6 +513,7 @@ e_shell_content_run_save_search_dialog (EShellContent *shell_content) { EShellView *shell_view; EShellWindow *shell_window; + GtkWidget *content_area; GtkWidget *dialog; GtkWidget *widget; EFilterRule *rule; @@ -547,8 +551,8 @@ e_shell_content_run_save_search_dialog (EShellContent *shell_content) gtk_container_set_border_width (GTK_CONTAINER (widget), 3); gtk_window_set_default_size (GTK_WINDOW (dialog), 500, 300); - gtk_box_pack_start ( - GTK_BOX (GTK_DIALOG (dialog)->vbox), widget, TRUE, TRUE, 0); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (dialog)); + gtk_box_pack_start (GTK_BOX (content_area), widget, TRUE, TRUE, 0); g_signal_connect_swapped ( rule, "changed", G_CALLBACK ( diff --git a/shell/e-shell-sidebar.c b/shell/e-shell-sidebar.c index edb8ba5299..0c2aa48440 100644 --- a/shell/e-shell-sidebar.c +++ b/shell/e-shell-sidebar.c @@ -258,7 +258,7 @@ shell_sidebar_size_allocate (GtkWidget *widget, priv = E_SHELL_SIDEBAR_GET_PRIVATE (widget); - widget->allocation = *allocation; + gtk_widget_set_allocation (widget, allocation); child = priv->event_box; gtk_widget_size_request (child, &child_requisition); diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index 43a2a4c3e9..aace0a0073 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -71,7 +71,7 @@ G_DEFINE_TYPE_WITH_CODE ( static gint shell_switcher_layout_actions (EShellSwitcher *switcher) { - GtkAllocation *allocation; + GtkAllocation allocation; gint num_btns = g_list_length (switcher->priv->proxies), btns_per_row; GList **rows, *p; gboolean icons_only; @@ -82,11 +82,12 @@ shell_switcher_layout_actions (EShellSwitcher *switcher) gint x, y; gint i; - allocation = >K_WIDGET (switcher)->allocation; - y = allocation->y + allocation->height; + gtk_widget_get_allocation (GTK_WIDGET (switcher), &allocation); + + y = allocation.y + allocation.height; if (num_btns == 0) - return allocation->height; + return allocation.height; icons_only = (switcher->priv->style == GTK_TOOLBAR_ICONS); @@ -101,7 +102,7 @@ shell_switcher_layout_actions (EShellSwitcher *switcher) } /* Figure out how many rows and columns we'll use. */ - btns_per_row = MAX (1, allocation->width / (max_width + H_PADDING)); + btns_per_row = MAX (1, allocation.width / (max_width + H_PADDING)); if (!icons_only) { /* If using text buttons, we want to try to have a * completely filled-in grid, but if we can't, we want @@ -138,12 +139,12 @@ shell_switcher_layout_actions (EShellSwitcher *switcher) for (i = row_last; i >= 0; i--) { gint len, extra_width; - x = H_PADDING + allocation->x; + x = H_PADDING + allocation.x; y -= max_height; len = g_list_length (rows[i]); if (!icons_only) extra_width = - (allocation->width - (len * max_width) - + (allocation.width - (len * max_width) - (len * H_PADDING)) / len; else extra_width = 0; @@ -167,7 +168,7 @@ shell_switcher_layout_actions (EShellSwitcher *switcher) g_list_free (rows [i]); g_free (rows); - return y - allocation->y; + return y - allocation.y; } static void @@ -287,7 +288,7 @@ shell_switcher_size_allocate (GtkWidget *widget, switcher = E_SHELL_SWITCHER (widget); - widget->allocation = *allocation; + gtk_widget_set_allocation (widget, allocation); if (switcher->priv->toolbar_visible) height = shell_switcher_layout_actions (switcher); diff --git a/shell/e-shell-taskbar.c b/shell/e-shell-taskbar.c index bf8dfa7e2a..43865470de 100644 --- a/shell/e-shell-taskbar.c +++ b/shell/e-shell-taskbar.c @@ -64,20 +64,26 @@ static void shell_taskbar_activity_remove (EShellTaskbar *shell_taskbar, EActivity *activity) { - GtkBox *box; GtkWidget *proxy; + GtkContainer *container; GHashTable *proxy_table; + GList *children; - box = GTK_BOX (shell_taskbar->priv->hbox); proxy_table = shell_taskbar->priv->proxy_table; proxy = g_hash_table_lookup (proxy_table, activity); g_return_if_fail (proxy != NULL); g_hash_table_remove (proxy_table, activity); - gtk_container_remove (GTK_CONTAINER (box), proxy); - if (box->children == NULL) - gtk_widget_hide (GTK_WIDGET (box)); + container = GTK_CONTAINER (shell_taskbar->priv->hbox); + gtk_container_remove (container, proxy); + + children = gtk_container_get_children (container); + + if (children == NULL) + gtk_widget_hide (GTK_WIDGET (container)); + + g_list_free (children); } static void diff --git a/shell/e-shell-window-actions.c b/shell/e-shell-window-actions.c index 9b14730c7b..d33be7de1d 100644 --- a/shell/e-shell-window-actions.c +++ b/shell/e-shell-window-actions.c @@ -674,12 +674,16 @@ static void action_close_cb (GtkAction *action, EShellWindow *shell_window) { - GtkWidget *widget = GTK_WIDGET (shell_window); + GtkWidget *widget; + GdkWindow *window; GdkEvent *event; + widget = GTK_WIDGET (shell_window); + window = gtk_widget_get_window (widget); + /* Synthesize a delete_event on this window. */ event = gdk_event_new (GDK_DELETE); - event->any.window = g_object_ref (widget->window); + event->any.window = g_object_ref (window); event->any.send_event = TRUE; gtk_main_do_event (event); gdk_event_free (event); diff --git a/shell/main.c b/shell/main.c index 188fdfcc1a..c36afc6d1a 100644 --- a/shell/main.c +++ b/shell/main.c @@ -127,6 +127,8 @@ categories_icon_theme_hack (void) static gboolean show_development_warning(void) { + GtkWidget *action_area; + GtkWidget *content_area; GtkWidget *vbox; GtkWidget *label; GtkWidget *warning_dialog; @@ -146,16 +148,15 @@ show_development_warning(void) gtk_dialog_set_has_separator ( GTK_DIALOG (warning_dialog), FALSE); - gtk_container_set_border_width ( - GTK_CONTAINER (GTK_DIALOG (warning_dialog)->vbox), 0); - gtk_container_set_border_width ( - GTK_CONTAINER (GTK_DIALOG (warning_dialog)->action_area), 12); + action_area = gtk_dialog_get_action_area (GTK_DIALOG (warning_dialog)); + content_area = gtk_dialog_get_content_area (GTK_DIALOG (warning_dialog)); + + gtk_container_set_border_width (GTK_CONTAINER (action_area), 12); + gtk_container_set_border_width (GTK_CONTAINER (content_area), 0); vbox = gtk_vbox_new (FALSE, 12); gtk_container_set_border_width (GTK_CONTAINER (vbox), 12); - gtk_box_pack_start ( - GTK_BOX (GTK_DIALOG (warning_dialog)->vbox), - vbox, TRUE, TRUE, 0); + gtk_box_pack_start (GTK_BOX (content_area), vbox, TRUE, TRUE, 0); text = g_strdup_printf( /* xgettext:no-c-format */ |