[gtk] viewport: Use gtk_widget_set_overflow()
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk] viewport: Use gtk_widget_set_overflow()
- Date: Fri, 8 Feb 2019 17:33:48 +0000 (UTC)
commit 8ef417dad11ab43e88fb73429d5abf3ddf59da37
Author: Benjamin Otte <otte redhat com>
Date: Fri Feb 8 18:05:40 2019 +0100
viewport: Use gtk_widget_set_overflow()
gtk/gtkviewport.c | 40 +---------------------------------------
1 file changed, 1 insertion(+), 39 deletions(-)
---
diff --git a/gtk/gtkviewport.c b/gtk/gtkviewport.c
index d1f33c46fa..8a8f7e032a 100644
--- a/gtk/gtkviewport.c
+++ b/gtk/gtkviewport.c
@@ -31,7 +31,6 @@
#include "gtkmarshalers.h"
#include "gtkprivate.h"
#include "gtkscrollable.h"
-#include "gtksnapshot.h"
#include "gtktypebuiltins.h"
#include "gtkwidgetprivate.h"
@@ -94,8 +93,6 @@ static void gtk_viewport_get_property (GObject *object,
GValue *value,
GParamSpec *pspec);
static void gtk_viewport_destroy (GtkWidget *widget);
-static void gtk_viewport_snapshot (GtkWidget *widget,
- GtkSnapshot *snapshot);
static void gtk_viewport_size_allocate (GtkWidget *widget,
int width,
int height,
@@ -197,25 +194,6 @@ viewport_set_adjustment_values (GtkViewport *viewport,
viewport_size);
}
-static GtkWidget *
-gtk_viewport_pick (GtkWidget *widget,
- double x,
- double y)
-{
- if (x >= 0 && x <= gtk_widget_get_width (widget) &&
- y >= 0 && y <= gtk_widget_get_height(widget))
- {
- return GTK_WIDGET_CLASS (gtk_viewport_parent_class)->pick (widget, x, y);
- }
- else
- {
- if (gtk_widget_contains (widget, x, y))
- return widget;
- else
- return NULL;
- }
-}
-
static void
gtk_viewport_measure (GtkWidget *widget,
GtkOrientation orientation,
@@ -251,10 +229,8 @@ gtk_viewport_class_init (GtkViewportClass *class)
gobject_class->get_property = gtk_viewport_get_property;
widget_class->destroy = gtk_viewport_destroy;
- widget_class->snapshot = gtk_viewport_snapshot;
widget_class->size_allocate = gtk_viewport_size_allocate;
widget_class->measure = gtk_viewport_measure;
- widget_class->pick = gtk_viewport_pick;
gtk_widget_class_set_accessible_role (widget_class, ATK_ROLE_VIEWPORT);
@@ -359,6 +335,7 @@ gtk_viewport_init (GtkViewport *viewport)
widget = GTK_WIDGET (viewport);
gtk_widget_set_has_surface (widget, FALSE);
+ gtk_widget_set_overflow (widget, GTK_OVERFLOW_HIDDEN);
priv->shadow_type = GTK_SHADOW_IN;
priv->hadjustment = NULL;
@@ -506,21 +483,6 @@ gtk_viewport_get_shadow_type (GtkViewport *viewport)
return priv->shadow_type;
}
-static void
-gtk_viewport_snapshot (GtkWidget *widget,
- GtkSnapshot *snapshot)
-{
- gtk_snapshot_push_clip (snapshot,
- &GRAPHENE_RECT_INIT(
- 0, 0,
- gtk_widget_get_width (widget),
- gtk_widget_get_height (widget)));
-
- GTK_WIDGET_CLASS (gtk_viewport_parent_class)->snapshot (widget, snapshot);
-
- gtk_snapshot_pop (snapshot);
-}
-
static void
gtk_viewport_size_allocate (GtkWidget *widget,
int width,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]