mirror of
https://gitlab.gnome.org/GNOME/gimp
synced 2024-10-19 14:23:33 +00:00
block the sizeentry's signals while updating is's fields after a unit
2000-01-26 Michael Natterer <mitch@gimp.org> * libgimp/gimpsizeentry.[ch]: block the sizeentry's signals while updating is's fields after a unit change and emit the "value_changed" signal manually afterwards. This avoids multiple "value_changed" signals which may cause callbacks to change the sizeentry in the middle of a unit update. * plug-ins/commion/spread.c: no need to connect to the sizeentry's "unit_changed" signal.
This commit is contained in:
parent
3ca4f07f51
commit
8098581577
11
ChangeLog
11
ChangeLog
|
@ -1,3 +1,14 @@
|
|||
2000-01-26 Michael Natterer <mitch@gimp.org>
|
||||
|
||||
* libgimp/gimpsizeentry.[ch]: block the sizeentry's signals while
|
||||
updating is's fields after a unit change and emit the
|
||||
"value_changed" signal manually afterwards. This avoids multiple
|
||||
"value_changed" signals which may cause callbacks to change the
|
||||
sizeentry in the middle of a unit update.
|
||||
|
||||
* plug-ins/commion/spread.c: no need to connect to the sizeentry's
|
||||
"unit_changed" signal.
|
||||
|
||||
Wed Jan 26 00:10:34 CET 2000 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/common/colorify.c: use a gimp_color_button
|
||||
|
|
|
@ -879,7 +879,7 @@ gimp_size_entry_get_unit (GimpSizeEntry *gse)
|
|||
return gse->unit;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gimp_size_entry_update_unit (GimpSizeEntry *gse,
|
||||
GUnit unit)
|
||||
{
|
||||
|
@ -914,9 +914,19 @@ gimp_size_entry_update_unit (GimpSizeEntry *gse,
|
|||
}
|
||||
|
||||
gsef->stop_recursion = 0; /* hack !!! */
|
||||
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (gsef->value_adjustment),
|
||||
gsef);
|
||||
|
||||
gimp_size_entry_set_refval_boundaries (gse, i,
|
||||
gsef->min_refval, gsef->max_refval);
|
||||
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (gsef->value_adjustment),
|
||||
gsef);
|
||||
}
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gse),
|
||||
gimp_size_entry_signals[VALUE_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -879,7 +879,7 @@ gimp_size_entry_get_unit (GimpSizeEntry *gse)
|
|||
return gse->unit;
|
||||
}
|
||||
|
||||
void
|
||||
static void
|
||||
gimp_size_entry_update_unit (GimpSizeEntry *gse,
|
||||
GUnit unit)
|
||||
{
|
||||
|
@ -914,9 +914,19 @@ gimp_size_entry_update_unit (GimpSizeEntry *gse,
|
|||
}
|
||||
|
||||
gsef->stop_recursion = 0; /* hack !!! */
|
||||
|
||||
gtk_signal_handler_block_by_data (GTK_OBJECT (gsef->value_adjustment),
|
||||
gsef);
|
||||
|
||||
gimp_size_entry_set_refval_boundaries (gse, i,
|
||||
gsef->min_refval, gsef->max_refval);
|
||||
|
||||
gtk_signal_handler_unblock_by_data (GTK_OBJECT (gsef->value_adjustment),
|
||||
gsef);
|
||||
}
|
||||
|
||||
gtk_signal_emit (GTK_OBJECT (gse),
|
||||
gimp_size_entry_signals[VALUE_CHANGED]);
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -401,17 +401,12 @@ spread_dialog (gint32 image_ID)
|
|||
unit = gimp_image_get_unit (image_ID);
|
||||
|
||||
/* two sizeentries */
|
||||
adj = gtk_adjustment_new (1, 0, 1, 1, 10, 1);
|
||||
spinbutton = gtk_spin_button_new (GTK_ADJUSTMENT (adj), 1, 2);
|
||||
gtk_spin_button_set_shadow_type (GTK_SPIN_BUTTON (spinbutton),
|
||||
GTK_SHADOW_NONE);
|
||||
gtk_spin_button_set_numeric (GTK_SPIN_BUTTON (spinbutton), TRUE);
|
||||
gtk_widget_set_usize (spinbutton, 75, 0);
|
||||
|
||||
spinbutton = gimp_spin_button_new (&adj, 1, 0, 1, 1, 10, 1, 1, 2);
|
||||
size = gimp_size_entry_new (1, unit, "%a", TRUE, FALSE, FALSE, 75,
|
||||
GIMP_SIZE_ENTRY_UPDATE_SIZE);
|
||||
gtk_table_set_col_spacing (GTK_TABLE (size), 0, 4);
|
||||
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (size), GTK_SPIN_BUTTON (spinbutton), NULL);
|
||||
gimp_size_entry_add_field (GIMP_SIZE_ENTRY (size),
|
||||
GTK_SPIN_BUTTON (spinbutton), NULL);
|
||||
gtk_table_attach_defaults (GTK_TABLE (size), spinbutton, 1, 2, 0, 1);
|
||||
|
||||
gimp_size_entry_set_unit (GIMP_SIZE_ENTRY (size), UNIT_PIXEL);
|
||||
|
@ -429,15 +424,14 @@ spread_dialog (gint32 image_ID)
|
|||
|
||||
/* put a chain_button to the right */
|
||||
chain = gimp_chain_button_new (GIMP_CHAIN_RIGHT);
|
||||
if ( spvals.spread_amount_x == spvals.spread_amount_y)
|
||||
if ( spvals.spread_amount_x == spvals.spread_amount_y)
|
||||
gimp_chain_button_set_active (GIMP_CHAIN_BUTTON (chain), TRUE);
|
||||
gtk_table_attach_defaults (GTK_TABLE (size), chain, 2, 3, 0, 2);
|
||||
gtk_widget_show (chain);
|
||||
|
||||
gtk_signal_connect (GTK_OBJECT (size), "value_changed",
|
||||
(GtkSignalFunc) spread_entry_callback, chain);
|
||||
gtk_signal_connect (GTK_OBJECT (size), "unit_changed",
|
||||
(GtkSignalFunc) spread_entry_callback, chain);
|
||||
GTK_SIGNAL_FUNC (spread_entry_callback),
|
||||
chain);
|
||||
|
||||
gtk_container_set_border_width (GTK_CONTAINER (size), 4);
|
||||
gtk_container_add (GTK_CONTAINER (frame), size);
|
||||
|
@ -535,7 +529,7 @@ spread_entry_callback (GtkWidget *widget,
|
|||
y = new_y = x = new_x;
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 1, y);
|
||||
}
|
||||
if (new_y != y)
|
||||
else if (new_y != y)
|
||||
{
|
||||
x = new_x = y = new_y;
|
||||
gimp_size_entry_set_refval (GIMP_SIZE_ENTRY (widget), 0, x);
|
||||
|
|
Loading…
Reference in a new issue