libgimpwidgets: fix setting GimpMemSizeEntry value with unit change.

This bug doesn't happen when setting value through the GUI as in such
case, the unit never changed. It happened when setting a value which
could not be properly displayed by current unit (typically smaller than
1 in this unit, or with remainder).
In such a case, we should not manually set private->shift before
gimp_int_combo_box_set_active(), or the callback was failing to
reconfigure the GtkAdjustement, in particular min and max values.

As a consequence, hitting a Preferences reset, with a GimpMemSizeEntry
in Gigabytes, it got reset to Kilobytes with the max values capped at
4096. So I realized a Reset ended me with a Tile cache size of 4096 KB
in particular, which is of course ridiculously small and would be a
problem if one doesn't notice the issue immediately.
This commit is contained in:
Jehan 2020-08-05 12:30:21 +02:00
parent b8d96c49f3
commit 0be4e5c1dc
1 changed files with 1 additions and 6 deletions

View File

@ -258,12 +258,7 @@ gimp_memsize_entry_set_value (GimpMemsizeEntry *entry,
}
if (shift != private->shift)
{
private->shift = shift;
private->value = value;
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (private->menu), shift);
}
gimp_int_combo_box_set_active (GIMP_INT_COMBO_BOX (private->menu), shift);
#if _MSC_VER < 1300
# define CAST (gint64)