[gimp/gtk3-port: 251/386] Get rid of the deprecated gtk_icon_size_lookup_for_settings()



commit 3539c4c88bea189277aa227ebc12db4c6a3aab06
Author: Michael Natterer <mitch gimp org>
Date:   Sun Apr 29 02:53:51 2018 +0200

    Get rid of the deprecated gtk_icon_size_lookup_for_settings()
    
    and use gtk_icon_size_lookup() instead.

 app/dialogs/item-options-dialog.c       |    6 ++----
 app/widgets/gimpaction.c                |    9 ++-------
 app/widgets/gimpcoloreditor.c           |    9 ++++-----
 app/widgets/gimpcontainerbox.c          |    3 +--
 app/widgets/gimpcontrollerlist.c        |    4 +---
 app/widgets/gimpdeviceeditor.c          |    5 +----
 app/widgets/gimpdockwindow.c            |   30 ++++++++++++------------------
 app/widgets/gimpprocedureaction.c       |   10 ++++------
 app/widgets/gimptooloptionseditor.c     |   10 ++++------
 app/widgets/gimpwidgets-utils.c         |    9 ++-------
 libgimpwidgets/gimpcellrenderercolor.c  |    3 +--
 libgimpwidgets/gimpcellrenderertoggle.c |    4 +---
 12 files changed, 35 insertions(+), 67 deletions(-)
---
diff --git a/app/dialogs/item-options-dialog.c b/app/dialogs/item-options-dialog.c
index 9b91779..15a77c5 100644
--- a/app/dialogs/item-options-dialog.c
+++ b/app/dialogs/item-options-dialog.c
@@ -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
diff --git a/app/widgets/gimpaction.c b/app/widgets/gimpaction.c
index 0fe98c1..47161e7 100644
--- a/app/widgets/gimpaction.c
+++ b/app/widgets/gimpaction.c
@@ -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);
diff --git a/app/widgets/gimpcoloreditor.c b/app/widgets/gimpcoloreditor.c
index 24ac25b..c3bd90d 100644
--- a/app/widgets/gimpcoloreditor.c
+++ b/app/widgets/gimpcoloreditor.c
@@ -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;
diff --git a/app/widgets/gimpcontainerbox.c b/app/widgets/gimpcontainerbox.c
index c2d0d94..b3da9cf 100644
--- a/app/widgets/gimpcontainerbox.c
+++ b/app/widgets/gimpcontainerbox.c
@@ -202,8 +202,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));
 
diff --git a/app/widgets/gimpcontrollerlist.c b/app/widgets/gimpcontrollerlist.c
index 2a78aa0..54b5f07 100644
--- a/app/widgets/gimpcontrollerlist.c
+++ b/app/widgets/gimpcontrollerlist.c
@@ -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"));
diff --git a/app/widgets/gimpdeviceeditor.c b/app/widgets/gimpdeviceeditor.c
index d4854e7..099240d 100644
--- a/app/widgets/gimpdeviceeditor.c
+++ b/app/widgets/gimpdeviceeditor.c
@@ -147,10 +147,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);
diff --git a/app/widgets/gimpdockwindow.c b/app/widgets/gimpdockwindow.c
index ae52fbc..88cdd71 100644
--- a/app/widgets/gimpdockwindow.c
+++ b/app/widgets/gimpdockwindow.c
@@ -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,
diff --git a/app/widgets/gimpprocedureaction.c b/app/widgets/gimpprocedureaction.c
index da53b5f..ce20aaf 100644
--- a/app/widgets/gimpprocedureaction.c
+++ b/app/widgets/gimpprocedureaction.c
@@ -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))
diff --git a/app/widgets/gimptooloptionseditor.c b/app/widgets/gimptooloptionseditor.c
index 8395bea..4b243ed 100644
--- a/app/widgets/gimptooloptionseditor.c
+++ b/app/widgets/gimptooloptionseditor.c
@@ -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,
diff --git a/app/widgets/gimpwidgets-utils.c b/app/widgets/gimpwidgets-utils.c
index 6bc3cb1..c274d19 100644
--- a/app/widgets/gimpwidgets-utils.c
+++ b/app/widgets/gimpwidgets-utils.c
@@ -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     &&
diff --git a/libgimpwidgets/gimpcellrenderercolor.c b/libgimpwidgets/gimpcellrenderercolor.c
index 958914a..0557c61 100644
--- a/libgimpwidgets/gimpcellrenderercolor.c
+++ b/libgimpwidgets/gimpcellrenderercolor.c
@@ -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);
 
diff --git a/libgimpwidgets/gimpcellrenderertoggle.c b/libgimpwidgets/gimpcellrenderertoggle.c
index 743cd58..f957395 100644
--- a/libgimpwidgets/gimpcellrenderertoggle.c
+++ b/libgimpwidgets/gimpcellrenderertoggle.c
@@ -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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]