From: Jim Evins Date: Thu, 5 Feb 2004 02:56:48 +0000 (+0000) Subject: 2004-02-04 Jim Evins X-Git-Tag: glabels-2_3_0~484 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=d7a5fdb634b821ba3ed2c99f90fab88b5c0aba80;p=glabels 2004-02-04 Jim Evins * 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 --- diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index c28bbbac..5d84a9a1 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,20 @@ +2004-02-04 Jim Evins + + * 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 * src/object-editor-image-page.c: diff --git a/glabels2/src/object-editor-image-page.c b/glabels2/src/object-editor-image-page.c index 550f6f0c..83cd3556 100644 --- a/glabels2/src/object-editor-image-page.c +++ b/glabels2/src/object-editor-image-page.c @@ -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), diff --git a/glabels2/src/view-highlight.c b/glabels2/src/view-highlight.c index 019715f5..1cfdc95c 100644 --- a/glabels2/src/view-highlight.c +++ b/glabels2/src/view-highlight.c @@ -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;