diff options
author | Wolfgang Ulbrich <[email protected]> | 2015-11-20 00:40:13 +0100 |
---|---|---|
committer | Wolfgang Ulbrich <[email protected]> | 2015-12-01 23:25:13 +0100 |
commit | 9c41b25138d7bff3554d4be038f92c16d56dc734 (patch) | |
tree | a69ba189c5626a2a0e4998bc3acf716f734e6910 | |
parent | 1b8d58e81e5ef71c217b7dd3dc8f72e1552ff826 (diff) | |
download | pluma-9c41b25138d7bff3554d4be038f92c16d56dc734.tar.bz2 pluma-9c41b25138d7bff3554d4be038f92c16d56dc734.tar.xz |
GTK3: replace depracated gtk_widget_size_request with gtk_widget_get_preferred_size
-rw-r--r-- | pluma/pluma-documents-panel.c | 6 | ||||
-rw-r--r-- | pluma/pluma-status-combo-box.c | 12 | ||||
-rw-r--r-- | pluma/pluma-utils.c | 8 |
3 files changed, 23 insertions, 3 deletions
diff --git a/pluma/pluma-documents-panel.c b/pluma/pluma-documents-panel.c index 1ba7a5c0..97308efe 100644 --- a/pluma/pluma-documents-panel.c +++ b/pluma/pluma-documents-panel.c @@ -539,8 +539,12 @@ menu_position (GtkMenu *menu, wy = rect.y; gdk_window_get_origin (gtk_widget_get_window (w), x, y); - + +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition); +#else gtk_widget_size_request (GTK_WIDGET (menu), &requisition); +#endif if (gtk_widget_get_direction (w) == GTK_TEXT_DIR_RTL) { diff --git a/pluma/pluma-status-combo-box.c b/pluma/pluma-status-combo-box.c index f138ab2c..aaae9824 100644 --- a/pluma/pluma-status-combo-box.c +++ b/pluma/pluma-status-combo-box.c @@ -180,8 +180,12 @@ menu_position_func (GtkMenu *menu, GtkAllocation allocation; *push_in = FALSE; - + +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (gtk_widget_get_toplevel (GTK_WIDGET (menu)), NULL, &request); +#else gtk_widget_size_request (gtk_widget_get_toplevel (GTK_WIDGET (menu)), &request); +#endif /* get the origin... */ gdk_window_get_origin (gtk_widget_get_window (GTK_WIDGET (combo)), x, y); @@ -205,8 +209,12 @@ button_press_event (GtkWidget *widget, GtkRequisition request; GtkAllocation allocation; gint max_height; - + +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (combo->priv->menu, NULL, &request); +#else gtk_widget_size_request (combo->priv->menu, &request); +#endif gtk_widget_get_allocation (GTK_WIDGET (combo), &allocation); /* do something relative to our own height here, maybe we can do better */ diff --git a/pluma/pluma-utils.c b/pluma/pluma-utils.c index 657003d6..19405ebf 100644 --- a/pluma/pluma-utils.c +++ b/pluma/pluma-utils.c @@ -134,7 +134,11 @@ pluma_utils_menu_position_under_widget (GtkMenu *menu, widget = GTK_WIDGET (user_data); widget_get_origin (widget, x, y); +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition); +#else gtk_widget_size_request (GTK_WIDGET (menu), &requisition); +#endif gtk_widget_get_allocation (widget, &allocation); @@ -189,7 +193,11 @@ pluma_utils_menu_position_under_tree_view (GtkMenu *menu, if (gtk_widget_get_direction (GTK_WIDGET (tree)) == GTK_TEXT_DIR_RTL) { GtkRequisition requisition; +#if GTK_CHECK_VERSION (3, 0, 0) + gtk_widget_get_preferred_size (GTK_WIDGET (menu), NULL, &requisition); +#else gtk_widget_size_request (GTK_WIDGET (menu), &requisition); +#endif *x += rect.width - requisition.width; } } |