GTK3: replace depracated gtk_widget_size_request with gtk_widget_get_preferred_size
This commit is contained in:
parent
1b8d58e81e
commit
9c41b25138
|
@ -540,7 +540,11 @@ menu_position (GtkMenu *menu,
|
|||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -181,7 +181,11 @@ menu_position_func (GtkMenu *menu,
|
|||
|
||||
*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);
|
||||
|
@ -206,7 +210,11 @@ button_press_event (GtkWidget *widget,
|
|||
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 */
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue