[gtk] image: size request is always CONSTANT_SIZE



commit e1b6496af760d4b93a2a17c80816dc1a3348b97c
Author: Benjamin Otte <otte redhat com>
Date:   Wed Jul 4 05:12:53 2018 +0200

    image: size request is always CONSTANT_SIZE
    
    It's always -gtk-icon-size in both directions, even for paintables.
    There's no width-for-height happening.

 gtk/gtkiconhelper.c        | 16 ----------------
 gtk/gtkiconhelperprivate.h |  1 -
 gtk/gtkimage.c             | 10 ----------
 3 files changed, 27 deletions(-)
---
diff --git a/gtk/gtkiconhelper.c b/gtk/gtkiconhelper.c
index a817eed679..502907e5fd 100644
--- a/gtk/gtkiconhelper.c
+++ b/gtk/gtkiconhelper.c
@@ -426,22 +426,6 @@ gtk_icon_helper_new (GtkCssNode *css_node,
   return self;
 }
 
-GtkSizeRequestMode
-gtk_icon_helper_get_request_mode (GtkIconHelper *self)
-{
-  switch (gtk_image_definition_get_storage_type (self->def))
-    {
-    case GTK_IMAGE_PAINTABLE:
-      return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
-
-    case GTK_IMAGE_ICON_NAME:
-    case GTK_IMAGE_GICON:
-    case GTK_IMAGE_EMPTY:
-    default:
-      return GTK_SIZE_REQUEST_CONSTANT_SIZE;
-    }
-}
-
 int
 gtk_icon_helper_get_size (GtkIconHelper *self)
 {
diff --git a/gtk/gtkiconhelperprivate.h b/gtk/gtkiconhelperprivate.h
index e2498f62d7..b7656bb849 100644
--- a/gtk/gtkiconhelperprivate.h
+++ b/gtk/gtkiconhelperprivate.h
@@ -64,7 +64,6 @@ GdkPaintable *_gtk_icon_helper_peek_paintable (GtkIconHelper *self);
 GtkImageDefinition *gtk_icon_helper_get_definition (GtkIconHelper *self);
 const gchar *_gtk_icon_helper_get_icon_name (GtkIconHelper *self);
 
-GtkSizeRequestMode gtk_icon_helper_get_request_mode (GtkIconHelper *self);
 int gtk_icon_helper_get_size (GtkIconHelper *self);
 
 gboolean _gtk_icon_helper_get_force_scale_pixbuf (GtkIconHelper *self);
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 97df60c4e8..6be66f46da 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -131,15 +131,6 @@ static GParamSpec *image_props[NUM_PROPERTIES] = { NULL, };
 
 G_DEFINE_TYPE_WITH_PRIVATE (GtkImage, gtk_image, GTK_TYPE_WIDGET)
 
-static GtkSizeRequestMode
-gtk_image_get_request_mode (GtkWidget *widget)
-{
-  GtkImage *image = GTK_IMAGE (widget);
-  GtkImagePrivate *priv = gtk_image_get_instance_private (image);
-
-  return gtk_icon_helper_get_request_mode (priv->icon_helper);
-}
-
 static void
 gtk_image_class_init (GtkImageClass *class)
 {
@@ -154,7 +145,6 @@ gtk_image_class_init (GtkImageClass *class)
 
   widget_class = GTK_WIDGET_CLASS (class);
   widget_class->snapshot = gtk_image_snapshot;
-  widget_class->get_request_mode = gtk_image_get_request_mode;
   widget_class->measure = gtk_image_measure;
   widget_class->unrealize = gtk_image_unrealize;
   widget_class->style_updated = gtk_image_style_updated;


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