[gtk+/overlay: 14/34] overlay: make the offsets signed
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/overlay: 14/34] overlay: make the offsets signed
- Date: Sat, 11 Jun 2011 00:59:50 +0000 (UTC)
commit 73f8f06e709d4828be2176db739e815c5eceb5fe
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Thu May 26 23:14:40 2011 +0200
overlay: make the offsets signed
demos/gtk-demo/overlay.c | 6 +++---
gtk/gtkoverlay.c | 20 ++++++++++----------
gtk/gtkoverlay.h | 12 ++++++------
3 files changed, 19 insertions(+), 19 deletions(-)
---
diff --git a/demos/gtk-demo/overlay.c b/demos/gtk-demo/overlay.c
index 0f3e4b7..0ab6528 100644
--- a/demos/gtk-demo/overlay.c
+++ b/demos/gtk-demo/overlay.c
@@ -50,7 +50,7 @@ do_overlay (GtkWidget *do_widget)
label = gtk_label_new ("Hello world");
gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_widget_set_valign (label, GTK_ALIGN_END);
- gtk_overlay_add (GTK_OVERLAY (overlay), label, 20, 5);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label, -20, -5);
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_START);
@@ -60,7 +60,7 @@ do_overlay (GtkWidget *do_widget)
label = gtk_label_new ("Hello world");
gtk_widget_set_halign (label, GTK_ALIGN_START);
gtk_widget_set_valign (label, GTK_ALIGN_END);
- gtk_overlay_add (GTK_OVERLAY (overlay), label, 20, 5);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label, 20, -5);
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_END);
@@ -70,7 +70,7 @@ do_overlay (GtkWidget *do_widget)
label = gtk_label_new ("Hello world");
gtk_widget_set_halign (label, GTK_ALIGN_END);
gtk_widget_set_valign (label, GTK_ALIGN_START);
- gtk_overlay_add (GTK_OVERLAY (overlay), label, 20, 5);
+ gtk_overlay_add (GTK_OVERLAY (overlay), label, -20, 5);
entry = gtk_entry_new ();
gtk_widget_set_halign (entry, GTK_ALIGN_START);
diff --git a/gtk/gtkoverlay.c b/gtk/gtkoverlay.c
index b5847f6..ce88c0e 100644
--- a/gtk/gtkoverlay.c
+++ b/gtk/gtkoverlay.c
@@ -272,13 +272,13 @@ gtk_overlay_size_allocate (GtkWidget *widget,
switch (valign)
{
case GTK_ALIGN_START:
- alloc.x = MAX (main_alloc.x, main_alloc.width - req.width - x_offset);
+ alloc.x = MAX (main_alloc.x, main_alloc.width - req.width + x_offset);
alloc.y = y_offset;
break;
case GTK_ALIGN_END:
- alloc.x = MAX (main_alloc.x, main_alloc.width - req.width - x_offset);
- alloc.y = MAX (main_alloc.y, main_alloc.height - req.height - y_offset);
+ alloc.x = MAX (main_alloc.x, main_alloc.width - req.width + x_offset);
+ alloc.y = MAX (main_alloc.y, main_alloc.height - req.height + y_offset);
break;
default:
@@ -296,7 +296,7 @@ gtk_overlay_size_allocate (GtkWidget *widget,
case GTK_ALIGN_END:
alloc.x = x_offset;
- alloc.y = MAX (main_alloc.y, main_alloc.height - req.height - y_offset);
+ alloc.y = MAX (main_alloc.y, main_alloc.height - req.height + y_offset);
break;
default:
@@ -739,8 +739,8 @@ gtk_overlay_get_relative_widget (GtkOverlay *overlay)
void
gtk_overlay_add (GtkOverlay *overlay,
GtkWidget *widget,
- guint x_offset,
- guint y_offset)
+ gint x_offset,
+ gint y_offset)
{
GtkOverlayChild *child;
@@ -769,8 +769,8 @@ gtk_overlay_add (GtkOverlay *overlay,
void
gtk_overlay_set_offset (GtkOverlay *overlay,
GtkWidget *widget,
- guint x_offset,
- guint y_offset)
+ gint x_offset,
+ gint y_offset)
{
g_return_if_fail (GTK_IS_OVERLAY (overlay));
@@ -789,8 +789,8 @@ gtk_overlay_set_offset (GtkOverlay *overlay,
void
gtk_overlay_get_offset (GtkOverlay *overlay,
GtkWidget *widget,
- guint *x_offset,
- guint *y_offset)
+ gint *x_offset,
+ gint *y_offset)
{
GtkOverlayChild *child;
diff --git a/gtk/gtkoverlay.h b/gtk/gtkoverlay.h
index 161e688..5d52f6f 100644
--- a/gtk/gtkoverlay.h
+++ b/gtk/gtkoverlay.h
@@ -77,18 +77,18 @@ GtkWidget *gtk_overlay_get_relative_widget (GtkOverlay *overlay);
void gtk_overlay_add (GtkOverlay *overlay,
GtkWidget *widget,
- guint x_offset,
- guint y_offset);
+ gint x_offset,
+ gint y_offset);
void gtk_overlay_set_offset (GtkOverlay *overlay,
GtkWidget *widget,
- guint x_offset,
- guint y_offset);
+ gint x_offset,
+ gint y_offset);
void gtk_overlay_get_offset (GtkOverlay *overlay,
GtkWidget *widget,
- guint *x_offset,
- guint *y_offset);
+ gint *x_offset,
+ gint *y_offset);
G_END_DECLS
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]