]> Pileus Git - ~andy/gtk/commitdiff
Add a snap_edge_set property to deal with the fact that we have an unset
authorOwen Taylor <otaylor@redhat.com>
Thu, 7 Nov 2002 19:35:37 +0000 (19:35 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Thu, 7 Nov 2002 19:35:37 +0000 (19:35 +0000)
Thu Nov  7 14:24:45 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkhandlebox.c: Add a snap_edge_set property to
        deal with the fact that we have an unset state for
        the snap_edge property. (Reported by Matthias Clasen
        #97505)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkhandlebox.c

index 08b46a5cd739347d14d1bcd70698573e544b33ae..aca30263eaf415423be6245368aa590e79134bdc 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Thu Nov  7 14:24:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkhandlebox.c: Add a snap_edge_set property to
+       deal with the fact that we have an unset state for
+       the snap_edge property. (Reported by Matthias Clasen
+       #97505)
+       
 Thu Nov  7 12:53:08 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.[ch] gtk/gtkwindow.c gtk/gtkinvisible.c: 
index 08b46a5cd739347d14d1bcd70698573e544b33ae..aca30263eaf415423be6245368aa590e79134bdc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Nov  7 14:24:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkhandlebox.c: Add a snap_edge_set property to
+       deal with the fact that we have an unset state for
+       the snap_edge property. (Reported by Matthias Clasen
+       #97505)
+       
 Thu Nov  7 12:53:08 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.[ch] gtk/gtkwindow.c gtk/gtkinvisible.c: 
index 08b46a5cd739347d14d1bcd70698573e544b33ae..aca30263eaf415423be6245368aa590e79134bdc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Nov  7 14:24:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkhandlebox.c: Add a snap_edge_set property to
+       deal with the fact that we have an unset state for
+       the snap_edge property. (Reported by Matthias Clasen
+       #97505)
+       
 Thu Nov  7 12:53:08 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.[ch] gtk/gtkwindow.c gtk/gtkinvisible.c: 
index 08b46a5cd739347d14d1bcd70698573e544b33ae..aca30263eaf415423be6245368aa590e79134bdc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Nov  7 14:24:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkhandlebox.c: Add a snap_edge_set property to
+       deal with the fact that we have an unset state for
+       the snap_edge property. (Reported by Matthias Clasen
+       #97505)
+       
 Thu Nov  7 12:53:08 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.[ch] gtk/gtkwindow.c gtk/gtkinvisible.c: 
index 08b46a5cd739347d14d1bcd70698573e544b33ae..aca30263eaf415423be6245368aa590e79134bdc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Nov  7 14:24:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkhandlebox.c: Add a snap_edge_set property to
+       deal with the fact that we have an unset state for
+       the snap_edge property. (Reported by Matthias Clasen
+       #97505)
+       
 Thu Nov  7 12:53:08 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.[ch] gtk/gtkwindow.c gtk/gtkinvisible.c: 
index 08b46a5cd739347d14d1bcd70698573e544b33ae..aca30263eaf415423be6245368aa590e79134bdc 100644 (file)
@@ -1,3 +1,10 @@
+Thu Nov  7 14:24:45 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkhandlebox.c: Add a snap_edge_set property to
+       deal with the fact that we have an unset state for
+       the snap_edge property. (Reported by Matthias Clasen
+       #97505)
+       
 Thu Nov  7 12:53:08 2002  Owen Taylor  <otaylor@redhat.com>
 
        * gtk/gtkwidget.[ch] gtk/gtkwindow.c gtk/gtkinvisible.c: 
index ec7c22d5f7a2a2887507a7e9391406f5a0caaed8..aa31060f5cee31d97b5f25f0d4130dfebf646a99 100644 (file)
@@ -37,7 +37,8 @@ enum {
   PROP_SHADOW,
   PROP_SHADOW_TYPE,
   PROP_HANDLE_POSITION,
-  PROP_SNAP_EDGE
+  PROP_SNAP_EDGE,
+  PROP_SNAP_EDGE_SET
 };
 
 #define DRAG_HANDLE_SIZE 10
@@ -214,6 +215,14 @@ gtk_handle_box_class_init (GtkHandleBoxClass *class)
                                                      GTK_POS_TOP,
                                                       G_PARAM_READABLE | G_PARAM_WRITABLE));
 
+  g_object_class_install_property (gobject_class,
+                                   PROP_SNAP_EDGE_SET,
+                                   g_param_spec_boolean ("snap_edge_set",
+                                                        _("Snap edge set"),
+                                                        _("Whether to use the value from the snap_edge property or a value derived from handle_position"),
+                                                        FALSE,
+                                                        G_PARAM_READABLE | G_PARAM_WRITABLE));
+
   object_class->destroy = gtk_handle_box_destroy;
 
   widget_class->map = gtk_handle_box_map;
@@ -291,6 +300,10 @@ gtk_handle_box_set_property (GObject         *object,
     case PROP_SNAP_EDGE:
       gtk_handle_box_set_snap_edge (handle_box, g_value_get_enum (value));
       break;
+    case PROP_SNAP_EDGE_SET:
+      if (!g_value_get_boolean (value))
+       gtk_handle_box_set_snap_edge (handle_box, (GtkPositionType)-1);
+      break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
       break;
@@ -315,7 +328,12 @@ gtk_handle_box_get_property (GObject         *object,
       g_value_set_enum (value, handle_box->handle_position);
       break;
     case PROP_SNAP_EDGE:
-      g_value_set_enum (value, handle_box->snap_edge);
+      g_value_set_enum (value,
+                       (handle_box->snap_edge == -1 ?
+                        GTK_POS_TOP : handle_box->snap_edge));
+      break;
+    case PROP_SNAP_EDGE_SET:
+      g_value_set_boolean (value, handle_box->snap_edge != -1);
       break;
     default:
       G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -819,7 +837,11 @@ gtk_handle_box_set_snap_edge        (GtkHandleBox    *handle_box,
   if (handle_box->snap_edge != edge)
     {
       handle_box->snap_edge = edge;
+      
+      g_object_freeze_notify (G_OBJECT (handle_box));
       g_object_notify (G_OBJECT (handle_box), "snap_edge");
+      g_object_notify (G_OBJECT (handle_box), "snap_edge_set");
+      g_object_thaw_notify (G_OBJECT (handle_box));
     }
 }