[gimp] libgimpwidgets: entry width of gimp_prop_size_entry_new() is too small.
- From: Jehan Pagès <jehanp src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp] libgimpwidgets: entry width of gimp_prop_size_entry_new() is too small.
- Date: Thu, 23 Mar 2017 01:46:58 +0000 (UTC)
commit f861585051fdf733b60ad5237da90a514949315a
Author: Jehan <jehan girinstud io>
Date: Thu Mar 23 02:36:27 2017 +0100
libgimpwidgets: entry width of gimp_prop_size_entry_new() is too small.
One cannot just use the min/max values since the precision digits must
also be accounted for (as well as one additional character for the
decimal separator).
Current implementation is not perfect yet because GimpSizeEntry code
itself does not yet use gimp_unit_get_scaled_digits(). Moreover the
entry size could be updated when changing units (or the original size
be actually based of the bigger width considering every possible unit).
libgimpwidgets/gimppropwidgets.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libgimpwidgets/gimppropwidgets.c b/libgimpwidgets/gimppropwidgets.c
index bc3597e..d343dda 100644
--- a/libgimpwidgets/gimppropwidgets.c
+++ b/libgimpwidgets/gimppropwidgets.c
@@ -2854,7 +2854,8 @@ gimp_prop_size_entry_new (GObject *config,
entry = gimp_size_entry_new (1, unit_value, unit_format,
show_pixels, show_percent, FALSE,
- gimp_prop_size_entry_num_chars (lower, upper),
+ gimp_prop_size_entry_num_chars (lower, upper) + 1 +
+ gimp_unit_get_scaled_digits (unit_value, resolution),
update_policy);
gtk_table_set_col_spacing (GTK_TABLE (entry), 1, 2);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]