]> git.sur5r.net Git - glabels/commitdiff
2004-02-04 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Thu, 5 Feb 2004 02:56:48 +0000 (02:56 +0000)
committerJim Evins <evins@snaught.com>
Thu, 5 Feb 2004 02:56:48 +0000 (02:56 +0000)
* src/object-editor-image-page.c:
(gl_object_editor_prepare_image_page):
Track "changed" signal of pixmap entry's GtkEntry rather than its
"activate" signal -- this catches all changes to the entry rather than
just changes resulting from a browse, so one can easily pull previous
entries from the history. (This change is marked below on 2004-02-03,
but somehow never got checked in.)

* src/view-highlight.c: (sl_resize_event_handler),
(sr_resize_event_handler), (st_resize_event_handler),
(sb_resize_event_handler):
Side resize handles will now confirm the actual resize that the object
accepted before adjusting position parameters.  Previously some interesting
things happened when resizing a barcode to its minimum size.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@412 f5e0f49d-192f-0410-a22d-a8d8700d0965

glabels2/ChangeLog
glabels2/src/object-editor-image-page.c
glabels2/src/view-highlight.c

index c28bbbac6d2103f17114aa8d34b017821ca0c422..5d84a9a156226321f65787aebfbd0a0e72265b45 100644 (file)
@@ -1,3 +1,20 @@
+2004-02-04  Jim Evins  <evins@snaught.com>
+
+       * src/object-editor-image-page.c:
+       (gl_object_editor_prepare_image_page):
+               Track "changed" signal of pixmap entry's GtkEntry rather than its
+               "activate" signal -- this catches all changes to the entry rather than
+               just changes resulting from a browse, so one can easily pull previous
+               entries from the history. (This change is marked below on 2004-02-03,
+               but somehow never got checked in.)
+
+       * src/view-highlight.c: (sl_resize_event_handler),
+       (sr_resize_event_handler), (st_resize_event_handler),
+       (sb_resize_event_handler):
+               Side resize handles will now confirm the actual resize that the object
+               accepted before adjusting position parameters.  Previously some interesting
+               things happened when resizing a barcode to its minimum size.
+
 2004-02-03  Jim Evins  <evins@snaught.com>
 
        * src/object-editor-image-page.c:
index 550f6f0caef92b9b701c70d22a14c5ec762d11af..83cd355657a0123e7528585d5e8a09643753f98b 100644 (file)
@@ -59,6 +59,7 @@ gl_object_editor_prepare_image_page (glObjectEditor *editor)
 {
        GdkColor     *gdk_color;
        GtkSizeGroup *label_size_group;
+       GtkWidget    *ge;
 
        gl_debug (DEBUG_EDITOR, "START");
 
@@ -85,8 +86,9 @@ gl_object_editor_prepare_image_page (glObjectEditor *editor)
        gtk_widget_show_all (editor->priv->img_page_vbox);
 
        /* Connect signals */
-       g_signal_connect_swapped (G_OBJECT (editor->priv->img_pixmap_entry),
-                                 "activate",
+       ge = gnome_file_entry_gtk_entry(GNOME_FILE_ENTRY(editor->priv->img_pixmap_entry));
+       g_signal_connect_swapped (G_OBJECT (ge),
+                                 "changed",
                                  G_CALLBACK (gl_object_editor_changed_cb),
                                  G_OBJECT (editor));
        g_signal_connect_swapped (G_OBJECT (editor->priv->img_key_entry),
index 019715f5658f01e9bc0244b43949361d4aac0aa8..1cfdc95c6a7ea34099d17527cb995bd96746c72c 100644 (file)
@@ -1486,15 +1486,16 @@ sl_resize_event_handler (GnomeCanvasItem *handle_item,
                                                  event->button.time);
                        gnome_canvas_item_w2i (view_highlight->private->group,
                                               &event->button.x, &event->button.y);
-                       x1 = MIN (event->button.x, x2 - MIN_ITEM_SIZE);
-                       /* y1 unchanged */
                        w = MAX (x2 - event->button.x, MIN_ITEM_SIZE);
                        h = y2 - y1;
+                       gl_label_object_set_size (object, w, h);
+                       gl_label_object_get_size (object, &w, &h);
+                       x1 = x2 - w;
+                       /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
                        gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
-                       gl_label_object_set_size (object, w, h);
                        return TRUE;
 
                default:
@@ -1507,15 +1508,16 @@ sl_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_w2i (view_highlight->private->group,
                                               &event->button.x, &event->button.y);
-                       x1 = MIN (event->button.x, x2 - MIN_ITEM_SIZE);
-                       /* y1 unchanged */
                        w = MAX (x2 - event->button.x, MIN_ITEM_SIZE);
                        h = y2 - y1;
+                       gl_label_object_set_size (object, w, h);
+                       gl_label_object_get_size (object, &w, &h);
+                       x1 = x2 - w;
+                       /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
                        gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
-                       gl_label_object_set_size (object, w, h);
                        return TRUE;
                } else {
                        return FALSE;
@@ -1589,15 +1591,16 @@ sr_resize_event_handler (GnomeCanvasItem *handle_item,
                                                  event->button.time);
                        gnome_canvas_item_w2i (view_highlight->private->group,
                                               &event->button.x, &event->button.y);
-                       /* x1 unchanged */
-                       /* y1 unchanged */
                        w = MAX (event->button.x - x1, MIN_ITEM_SIZE);
                        h = y2 - y1;
+                       gl_label_object_set_size (object, w, h);
+                       gl_label_object_get_size (object, &w, &h);
+                       /* x1 unchanged */
+                       /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
                        gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
-                       gl_label_object_set_size (object, w, h);
                        return TRUE;
 
                default:
@@ -1610,15 +1613,16 @@ sr_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_w2i (view_highlight->private->group,
                                               &event->button.x, &event->button.y);
-                       /* x1 unchanged */
-                       /* y1 unchanged */
                        w = MAX (event->button.x - x1, MIN_ITEM_SIZE);
                        h = y2 - y1;
+                       gl_label_object_set_size (object, w, h);
+                       gl_label_object_get_size (object, &w, &h);
+                       /* x1 unchanged */
+                       /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
                        gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
-                       gl_label_object_set_size (object, w, h);
                        return TRUE;
                } else {
                        return FALSE;
@@ -1692,15 +1696,16 @@ st_resize_event_handler (GnomeCanvasItem *handle_item,
                                                  event->button.time);
                        gnome_canvas_item_w2i (view_highlight->private->group,
                                               &event->button.x, &event->button.y);
-                       /* x1 unchanged */
-                       y1 = MIN (event->button.y, y2 - MIN_ITEM_SIZE);
                        w = x2 - x1;
                        h = MAX (y2 - event->button.y, MIN_ITEM_SIZE);
+                       gl_label_object_set_size (object, w, h);
+                       gl_label_object_get_size (object, &w, &h);
+                       /* x1 unchanged */
+                       y1 = y2 - h;
                        x0 = x0 + x1;
                        y0 = y0 + y1;
                        gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
-                       gl_label_object_set_size (object, w, h);
                        return TRUE;
 
                default:
@@ -1713,15 +1718,16 @@ st_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_w2i (view_highlight->private->group,
                                               &event->button.x, &event->button.y);
-                       /* x1 unchanged */
-                       y1 = MIN (event->button.y, y2 - MIN_ITEM_SIZE);
                        w = x2 - x1;
                        h = MAX (y2 - event->button.y, MIN_ITEM_SIZE);
+                       gl_label_object_set_size (object, w, h);
+                       gl_label_object_get_size (object, &w, &h);
+                       /* x1 unchanged */
+                       y1 = y2 - h;
                        x0 = x0 + x1;
                        y0 = y0 + y1;
                        gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
-                       gl_label_object_set_size (object, w, h);
                        return TRUE;
                } else {
                        return FALSE;
@@ -1795,15 +1801,16 @@ sb_resize_event_handler (GnomeCanvasItem *handle_item,
                                                  event->button.time);
                        gnome_canvas_item_w2i (view_highlight->private->group,
                                               &event->button.x, &event->button.y);
-                       /* x1 unchanged */
-                       /* y1 unchanged */
                        w = x2 - x1;
                        h = MAX (event->button.y - x1, MIN_ITEM_SIZE);
+                       gl_label_object_set_size (object, w, h);
+                       gl_label_object_get_size (object, &w, &h);
+                       /* x1 unchanged */
+                       /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
                        gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
-                       gl_label_object_set_size (object, w, h);
                        return TRUE;
 
                default:
@@ -1816,15 +1823,16 @@ sb_resize_event_handler (GnomeCanvasItem *handle_item,
                                                &x0, &y0, &x1, &y1, &x2, &y2);
                        gnome_canvas_item_w2i (view_highlight->private->group,
                                               &event->button.x, &event->button.y);
-                       /* x1 unchanged */
-                       /* y1 unchanged */
                        w = x2 - x1;
                        h = MAX (event->button.y - x1, MIN_ITEM_SIZE);
+                       gl_label_object_set_size (object, w, h);
+                       gl_label_object_get_size (object, &w, &h);
+                       /* x1 unchanged */
+                       /* y1 unchanged */
                        x0 = x0 + x1;
                        y0 = y0 + y1;
                        gnome_canvas_item_i2w (view_highlight->private->group, &x0, &y0);
                        gl_label_object_set_position (object, x0, y0);
-                       gl_label_object_set_size (object, w, h);
                        return TRUE;
                } else {
                        return FALSE;