[gthumb] grid view: implement the GtkScrollable::get_border function



commit 70712e57ff69813c687d4d5e95db488759720118
Author: Paolo Bacchilega <paobac src gnome org>
Date:   Thu Nov 21 08:25:42 2019 +0100

    grid view: implement the GtkScrollable::get_border function

 gthumb/gth-grid-view.c | 26 +++++++++++++++++++++++---
 1 file changed, 23 insertions(+), 3 deletions(-)
---
diff --git a/gthumb/gth-grid-view.c b/gthumb/gth-grid-view.c
index 0e9d97fe..45537e5f 100644
--- a/gthumb/gth-grid-view.c
+++ b/gthumb/gth-grid-view.c
@@ -58,6 +58,7 @@
 
 static void gth_grid_view_gth_file_selection_interface_init (GthFileSelectionInterface *iface);
 static void gth_grid_view_gth_file_view_interface_init (GthFileViewInterface *iface);
+static void gth_grid_view_gtk_scrollable_interface_init (GtkScrollableInterface *iface);
 
 
 enum {
@@ -219,7 +220,8 @@ G_DEFINE_TYPE_WITH_CODE (GthGridView,
                                                gth_grid_view_gth_file_selection_interface_init)
                         G_IMPLEMENT_INTERFACE (GTH_TYPE_FILE_VIEW,
                                                gth_grid_view_gth_file_view_interface_init)
-                        G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
+                        G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE,
+                                               gth_grid_view_gtk_scrollable_interface_init))
 
 
 /* -- gth_grid_view_item -- */
@@ -2631,6 +2633,17 @@ gth_grid_view_get_drag_dest_pos (GthFileView *file_view,
 }
 
 
+/* -- GtkScrollable interface -- */
+
+
+static gboolean
+gth_grid_view_get_border (GtkScrollable *scrollable,
+                         GtkBorder     *border)
+{
+       return FALSE;
+}
+
+
 /* GtkWidget methods */
 
 
@@ -3641,7 +3654,7 @@ gth_grid_view_get_property (GObject    *object,
                g_value_set_object (value, self->priv->hadjustment);
                break;
        case PROP_HSCROLL_POLICY:
-               /* FIXME */
+               g_value_set_enum (value, GTK_SCROLL_NATURAL);
                break;
        case PROP_MODEL:
                g_value_set_object (value, self->priv->model);
@@ -3656,7 +3669,7 @@ gth_grid_view_get_property (GObject    *object,
                g_value_set_object (value, self->priv->vadjustment);
                break;
        case PROP_VSCROLL_POLICY:
-               /* FIXME */
+               g_value_set_enum (value, GTK_SCROLL_NATURAL);
                break;
        default:
                G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -3875,6 +3888,13 @@ gth_grid_view_gth_file_view_interface_init (GthFileViewInterface *iface)
 }
 
 
+static void
+gth_grid_view_gtk_scrollable_interface_init (GtkScrollableInterface *iface)
+{
+       iface->get_border = gth_grid_view_get_border;
+}
+
+
 static void
 gth_grid_view_init (GthGridView *self)
 {


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