Commit 901c3ddc authored by Michael Natterer's avatar Michael Natterer 😴

Get rid of the deprecated gtk_icon_size_lookup_for_settings()

and use gtk_icon_size_lookup() instead.
parent 6ab3a559
......@@ -230,14 +230,12 @@ item_options_dialog_new (GimpImage *image,
if (gimp_get_color_tag_color (color_tag, &color, FALSE))
{
GtkSettings *settings = gtk_widget_get_settings (dialog);
gint w, h;
gint w, h;
image = gimp_color_area_new (&color, GIMP_COLOR_AREA_FLAT, 0);
gimp_color_area_set_color_config (GIMP_COLOR_AREA (image),
context->gimp->config->color_management);
gtk_icon_size_lookup_for_settings (settings,
GTK_ICON_SIZE_MENU, &w, &h);
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &w, &h);
gtk_widget_set_size_request (image, w, h);
}
else
......
......@@ -396,10 +396,7 @@ gimp_action_set_proxy (GimpAction *action,
gimp_color_area_set_color_config (GIMP_COLOR_AREA (area),
action->context->gimp->config->color_management);
gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (proxy),
GTK_ICON_SIZE_MENU,
&width, &height);
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
gtk_widget_set_size_request (area, width, height);
gtk_image_menu_item_set_image (GTK_IMAGE_MENU_ITEM (proxy), area);
gtk_image_menu_item_set_always_show_image (GTK_IMAGE_MENU_ITEM (proxy),
......@@ -436,9 +433,7 @@ gimp_action_set_proxy (GimpAction *action,
border_width = 1;
}
gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (proxy),
size, &width, &height);
gtk_icon_size_lookup (size, &width, &height);
view = gimp_view_new_full (action->context, action->viewable,
width, height, border_width,
FALSE, FALSE, FALSE);
......
......@@ -346,14 +346,13 @@ gimp_color_editor_get_preview (GimpDocked *docked,
GimpContext *context,
GtkIconSize size)
{
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (docked));
GtkWidget *preview;
gint width;
gint height;
GtkWidget *preview;
gint width;
gint height;
preview = gimp_fg_bg_view_new (context);
if (gtk_icon_size_lookup_for_settings (settings, size, &width, &height))
if (gtk_icon_size_lookup (size, &width, &height))
gtk_widget_set_size_request (preview, width, height);
return preview;
......
......@@ -189,7 +189,6 @@ gimp_container_box_get_preview (GimpDocked *docked,
GimpContext *context,
GtkIconSize size)
{
GimpContainerBox *box = GIMP_CONTAINER_BOX (docked);
GimpContainerView *view = GIMP_CONTAINER_VIEW (docked);
GimpContainer *container;
GtkWidget *preview;
......@@ -202,8 +201,7 @@ gimp_container_box_get_preview (GimpDocked *docked,
g_return_val_if_fail (container != NULL, NULL);
gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (GTK_WIDGET (box)),
size, &width, &height);
gtk_icon_size_lookup (size, &width, &height);
prop_name = gimp_context_type_to_prop_name (gimp_container_get_children_type (container));
......
......@@ -272,9 +272,7 @@ gimp_controller_list_init (GimpControllerList *list)
g_object_add_weak_pointer (G_OBJECT (list->remove_button),
(gpointer) &list->remove_button);
gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (GTK_WIDGET (list)),
icon_size, &icon_width, &icon_height);
gtk_icon_size_lookup (icon_size, &icon_width, &icon_height);
list->dest = gimp_container_tree_view_new (NULL, NULL, icon_height, 0);
gimp_container_tree_view_set_main_column_title (GIMP_CONTAINER_TREE_VIEW (list->dest),
_("Active Controllers"));
......
......@@ -148,10 +148,7 @@ gimp_device_editor_init (GimpDeviceEditor *editor)
gtk_orientable_set_orientation (GTK_ORIENTABLE (editor),
GTK_ORIENTATION_HORIZONTAL);
gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (GTK_WIDGET (editor)),
GTK_ICON_SIZE_BUTTON,
&icon_width, &icon_height);
gtk_icon_size_lookup (GTK_ICON_SIZE_BUTTON, &icon_width, &icon_height);
private->treeview = gimp_container_tree_view_new (NULL, NULL, icon_height, 0);
gtk_widget_set_size_request (private->treeview, 200, -1);
gtk_paned_pack1 (GTK_PANED (editor), private->treeview, TRUE, FALSE);
......
......@@ -293,7 +293,6 @@ gimp_dock_window_constructed (GObject *object)
GimpMenuFactory *menu_factory;
GtkAccelGroup *accel_group;
Gimp *gimp;
GtkSettings *settings;
gint menu_view_width = -1;
gint menu_view_height = -1;
......@@ -448,11 +447,9 @@ gimp_dock_window_constructed (GObject *object)
dock_window,
0);
settings = gtk_widget_get_settings (GTK_WIDGET (dock_window));
gtk_icon_size_lookup_for_settings (settings,
DEFAULT_MENU_VIEW_SIZE,
&menu_view_width,
&menu_view_height);
gtk_icon_size_lookup (DEFAULT_MENU_VIEW_SIZE,
&menu_view_width,
&menu_view_height);
g_object_set (dock_window->p->image_combo,
"container", dock_window->p->image_container,
......@@ -610,18 +607,15 @@ gimp_dock_window_style_updated (GtkWidget *widget)
if (dock_window->p->image_combo)
{
GtkSettings *settings;
GtkBorder border;
gint menu_view_width = 18;
gint menu_view_height = 18;
gint focus_line_width;
gint focus_padding;
settings = gtk_widget_get_settings (dock_window->p->image_combo);
gtk_icon_size_lookup_for_settings (settings,
menu_view_size,
&menu_view_width,
&menu_view_height);
GtkBorder border;
gint menu_view_width = 18;
gint menu_view_height = 18;
gint focus_line_width;
gint focus_padding;
gtk_icon_size_lookup (menu_view_size,
&menu_view_width,
&menu_view_height);
gtk_widget_style_get (dock_window->p->auto_button,
"focus-line-width", &focus_line_width,
......
......@@ -187,13 +187,11 @@ gimp_procedure_action_connect_proxy (GtkAction *action,
if (pixbuf)
{
GtkSettings *settings = gtk_widget_get_settings (proxy);
gint width;
gint height;
GtkWidget *image;
GtkWidget *image;
gint width;
gint height;
gtk_icon_size_lookup_for_settings (settings, GTK_ICON_SIZE_MENU,
&width, &height);
gtk_icon_size_lookup (GTK_ICON_SIZE_MENU, &width, &height);
if (width != gdk_pixbuf_get_width (pixbuf) ||
height != gdk_pixbuf_get_height (pixbuf))
......
......@@ -314,13 +314,11 @@ gimp_tool_options_editor_get_preview (GimpDocked *docked,
GimpContext *context,
GtkIconSize size)
{
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (docked));
GtkWidget *view;
gint width;
gint height;
gtk_icon_size_lookup_for_settings (settings, size, &width, &height);
GtkWidget *view;
gint width;
gint height;
gtk_icon_size_lookup (size, &width, &height);
view = gimp_prop_view_new (G_OBJECT (context), "tool", context, height);
GIMP_VIEW (view)->renderer->size = -1;
gimp_view_renderer_set_size_full (GIMP_VIEW (view)->renderer,
......
......@@ -432,7 +432,6 @@ gimp_get_icon_size (GtkWidget *widget,
gint max_width;
gint max_height;
GtkIconSize icon_size = GTK_ICON_SIZE_MENU;
GtkSettings *settings;
g_return_val_if_fail (GTK_IS_WIDGET (widget), icon_size);
g_return_val_if_fail (icon_name != NULL, icon_size);
......@@ -446,10 +445,7 @@ gimp_get_icon_size (GtkWidget *widget,
if (! icon_set)
return GTK_ICON_SIZE_INVALID;
settings = gtk_widget_get_settings (widget);
if (! gtk_icon_size_lookup_for_settings (settings, max_size,
&max_width, &max_height))
if (! gtk_icon_size_lookup (max_size, &max_width, &max_height))
{
max_width = 1024;
max_height = 1024;
......@@ -462,8 +458,7 @@ gimp_get_icon_size (GtkWidget *widget,
gint icon_width;
gint icon_height;
if (gtk_icon_size_lookup_for_settings (settings, sizes[i],
&icon_width, &icon_height))
if (gtk_icon_size_lookup (sizes[i], &icon_width, &icon_height))
{
if (icon_width <= width &&
icon_height <= height &&
......
......@@ -215,8 +215,7 @@ gimp_cell_renderer_color_get_size (GtkCellRenderer *cell,
gint xpad;
gint ypad;
gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (widget),
private->size, &calc_width, &calc_height);
gtk_icon_size_lookup (private->size, &calc_width, &calc_height);
gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
......
......@@ -488,9 +488,7 @@ gimp_cell_renderer_toggle_create_pixbuf (GimpCellRendererToggle *toggle,
{
gint width, height;
if (! gtk_icon_size_lookup_for_settings (gtk_widget_get_settings (widget),
priv->stock_size,
&width, &height))
if (! gtk_icon_size_lookup (priv->stock_size, &width, &height))
{
width = 20;
height = 20;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment