tweaked spacing and alignments to make it look more like our other
2005-07-18 Sven Neumann <sven@gimp.org> * libgimpwidgets/gimpresolutionentry.c: tweaked spacing and alignments to make it look more like our other widgets. * plug-ins/common/poppler.c: put the resolution entry into a hbox so that it doesn't expand horizontally; removed unused table.
This commit is contained in:

committed by
Sven Neumann

parent
5713d3048b
commit
dca11f2ef4
@ -1,3 +1,11 @@
|
||||
2005-07-18 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* libgimpwidgets/gimpresolutionentry.c: tweaked spacing and
|
||||
alignments to make it look more like our other widgets.
|
||||
|
||||
* plug-ins/common/poppler.c: put the resolution entry into a hbox
|
||||
so that it doesn't expand horizontally; removed unused table.
|
||||
|
||||
2005-07-17 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/common/nlfilt.c
|
||||
|
@ -79,11 +79,13 @@ static void gimp_resolution_entry_field_set_boundaries
|
||||
gdouble lower,
|
||||
gdouble upper);
|
||||
|
||||
static void
|
||||
gimp_resolution_entry_field_set_value (GimpResolutionEntryField *gref,
|
||||
static void gimp_resolution_entry_field_set_value
|
||||
(GimpResolutionEntryField *gref,
|
||||
gdouble value);
|
||||
|
||||
|
||||
static void gimp_resolution_entry_format_label (GimpResolutionEntry *gre,
|
||||
GtkWidget *label,
|
||||
gdouble size);
|
||||
static guint gimp_resolution_entry_signals[LAST_SIGNAL] = { 0 };
|
||||
|
||||
static GtkTableClass *parent_class = NULL;
|
||||
@ -184,6 +186,9 @@ gimp_resolution_entry_init (GimpResolutionEntry *gre)
|
||||
gre->unitmenu = NULL;
|
||||
gre->unit = GIMP_UNIT_INCH;
|
||||
gre->independent = FALSE;
|
||||
|
||||
gtk_table_set_col_spacings (GTK_TABLE (gre), 4);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (gre), 2);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -239,16 +244,15 @@ gimp_resolution_entry_field_init (GimpResolutionEntry *gre,
|
||||
|
||||
if (size)
|
||||
{
|
||||
/*
|
||||
* warning: not correctly localizable in many gimp supported languages
|
||||
* */
|
||||
gchar *text = g_strdup_printf (_("%f %s"), gref->phy_size *
|
||||
gimp_unit_get_factor (gre->unit),
|
||||
gimp_unit_get_plural (gre->unit));
|
||||
gref->label = g_object_new (GTK_TYPE_LABEL,
|
||||
"xalign", 0.0,
|
||||
"yalign", 0.5,
|
||||
NULL);
|
||||
gimp_label_set_attributes (GTK_LABEL (gref->label),
|
||||
PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
|
||||
-1);
|
||||
|
||||
gref->label = gtk_label_new (text);
|
||||
|
||||
g_free (text);
|
||||
gimp_resolution_entry_format_label (gre, gref->label, gref->phy_size);
|
||||
}
|
||||
|
||||
digits = size ? 0 : GIMP_RESOLUTION_ENTRY_DIGITS (initial_unit);
|
||||
@ -282,7 +286,7 @@ gimp_resolution_entry_field_init (GimpResolutionEntry *gre,
|
||||
* @size_unit: Unit used to specify the width and height.
|
||||
* @x_label: Optional label for the X resolution entry.
|
||||
* @initial_x: The initial X resolution.
|
||||
* @x_label: Optional label for the Y resolution entry. Ignored if
|
||||
* @y_label: Optional label for the Y resolution entry. Ignored if
|
||||
* @independent is %FALSE.
|
||||
* @initial_y: The initial Y resolution. Ignored if @independent is
|
||||
* %FALSE.
|
||||
@ -431,16 +435,16 @@ gimp_resolution_entry_new (const gchar *width_label,
|
||||
gtk_widget_show (gre->height.label);
|
||||
|
||||
if (width_label)
|
||||
gimp_resolution_entry_attach_label (gre, width_label, 1, 0, 1.0);
|
||||
gimp_resolution_entry_attach_label (gre, width_label, 1, 0, 0.0);
|
||||
|
||||
if (height_label)
|
||||
gimp_resolution_entry_attach_label (gre, height_label, 2, 0, 1.0);
|
||||
gimp_resolution_entry_attach_label (gre, height_label, 2, 0, 0.0);
|
||||
|
||||
if (x_label)
|
||||
gimp_resolution_entry_attach_label (gre, x_label, 3, 0, 1.0);
|
||||
gimp_resolution_entry_attach_label (gre, x_label, 3, 0, 0.0);
|
||||
|
||||
if (independent && y_label)
|
||||
gimp_resolution_entry_attach_label (gre, y_label, 4, 0, 1.0);
|
||||
gimp_resolution_entry_attach_label (gre, y_label, 4, 0, 0.0);
|
||||
|
||||
return GTK_WIDGET (gre);
|
||||
}
|
||||
@ -480,7 +484,7 @@ gimp_resolution_entry_attach_label (GimpResolutionEntry *gre,
|
||||
|
||||
for (list = GTK_TABLE (gre)->children; list; list = g_list_next (list))
|
||||
{
|
||||
child = (GtkTableChild *) list->data;
|
||||
child = list->data;
|
||||
|
||||
if (child->left_attach == 1 && child->top_attach == row)
|
||||
{
|
||||
@ -917,8 +921,6 @@ gimp_resolution_entry_update_unit (GimpResolutionEntry *gre,
|
||||
{
|
||||
GimpUnit old_unit;
|
||||
gint digits;
|
||||
|
||||
gchar *label_text;
|
||||
gdouble factor;
|
||||
|
||||
old_unit = gre->unit;
|
||||
@ -931,8 +933,7 @@ gimp_resolution_entry_update_unit (GimpResolutionEntry *gre,
|
||||
MAX (3 + digits, 3));
|
||||
|
||||
|
||||
factor = gimp_unit_get_factor (old_unit) /
|
||||
gimp_unit_get_factor (unit);
|
||||
factor = gimp_unit_get_factor (old_unit) / gimp_unit_get_factor (unit);
|
||||
|
||||
gre->x.min_value *= factor;
|
||||
gre->x.max_value *= factor;
|
||||
@ -956,21 +957,10 @@ gimp_resolution_entry_update_unit (GimpResolutionEntry *gre,
|
||||
}
|
||||
|
||||
|
||||
factor = gimp_unit_get_factor (unit);
|
||||
|
||||
/*
|
||||
* warning: not correctly localizable in many gimp supported languages
|
||||
*/
|
||||
label_text = g_strdup_printf (_("%f %s"), gre->width.phy_size * factor,
|
||||
gimp_unit_get_plural (unit));
|
||||
gtk_label_set_text (GTK_LABEL (gre->width.label), label_text);
|
||||
g_free (label_text);
|
||||
|
||||
label_text = g_strdup_printf (_("%f %s"), gre->height.phy_size * factor,
|
||||
gimp_unit_get_plural (unit));
|
||||
gtk_label_set_text (GTK_LABEL (gre->height.label), label_text);
|
||||
g_free (label_text);
|
||||
|
||||
gimp_resolution_entry_format_label (gre,
|
||||
gre->width.label, gre->width.phy_size);
|
||||
gimp_resolution_entry_format_label (gre,
|
||||
gre->height.label, gre->height.phy_size);
|
||||
|
||||
g_signal_emit (gre, gimp_resolution_entry_signals[UNIT_CHANGED], 0);
|
||||
}
|
||||
@ -1334,3 +1324,19 @@ gimp_resolution_entry_update_y_in_dpi (GimpResolutionEntry *gre,
|
||||
|
||||
*val = gimp_resolution_entry_get_y_in_dpi (gre);
|
||||
}
|
||||
|
||||
static void
|
||||
gimp_resolution_entry_format_label (GimpResolutionEntry *gre,
|
||||
GtkWidget *label,
|
||||
gdouble size)
|
||||
{
|
||||
gchar *format = g_strdup_printf ("%%.%df %%s",
|
||||
gimp_unit_get_digits (gre->unit));
|
||||
gchar *text = g_strdup_printf (format,
|
||||
size * gimp_unit_get_factor (gre->unit),
|
||||
gimp_unit_get_plural (gre->unit));
|
||||
g_free (format);
|
||||
|
||||
gtk_label_set_text (GTK_LABEL (label), text);
|
||||
g_free (text);
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
/* The GIMP -- an image manipulation program
|
||||
*
|
||||
* pdf.c - PDF file loader
|
||||
* poppler.c - PDF file loader
|
||||
*
|
||||
* Copyright (C) 2005 Nathan Summers
|
||||
*
|
||||
@ -175,9 +175,8 @@ run (const gchar *name,
|
||||
static GimpParam values[2];
|
||||
GimpRunMode run_mode;
|
||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||
gint32 image_ID;
|
||||
|
||||
PopplerDocument *doc;
|
||||
gint32 image_ID = -1;
|
||||
PopplerDocument *doc = NULL;
|
||||
|
||||
run_mode = param[0].data.d_int32;
|
||||
|
||||
@ -613,15 +612,15 @@ load_dialog (PopplerDocument *doc,
|
||||
GtkWidget *vbox;
|
||||
GtkWidget *title;
|
||||
GtkWidget *selector;
|
||||
GtkWidget *table;
|
||||
GtkWidget *resolution;
|
||||
GtkWidget *toggle;
|
||||
GtkWidget *hbox;
|
||||
|
||||
ThreadData thread_data;
|
||||
GThread *thread;
|
||||
|
||||
int i;
|
||||
int n_pages;
|
||||
gint i;
|
||||
gint n_pages;
|
||||
|
||||
gdouble width;
|
||||
gdouble height;
|
||||
@ -686,15 +685,12 @@ load_dialog (PopplerDocument *doc,
|
||||
|
||||
thread = g_thread_create (thumbnail_thread, &thread_data, TRUE, NULL);
|
||||
|
||||
/* table */
|
||||
table = gtk_table_new (1, 2, FALSE);
|
||||
gtk_table_set_row_spacings (GTK_TABLE (table), 6);
|
||||
gtk_table_set_col_spacings (GTK_TABLE (table), 6);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), table, FALSE, FALSE, 0);
|
||||
gtk_widget_show (table);
|
||||
|
||||
/* Resolution */
|
||||
|
||||
hbox = gtk_hbox_new (FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
|
||||
gtk_widget_show (hbox);
|
||||
|
||||
resolution = gimp_resolution_entry_new ("_Width (pixels):", width,
|
||||
"_Height (pixels):", height,
|
||||
GIMP_UNIT_POINT,
|
||||
@ -706,7 +702,7 @@ load_dialog (PopplerDocument *doc,
|
||||
FALSE,
|
||||
0);
|
||||
|
||||
gtk_box_pack_start (GTK_BOX (vbox), resolution, FALSE, FALSE, 0);
|
||||
gtk_box_pack_start (GTK_BOX (hbox), resolution, FALSE, FALSE, 0);
|
||||
gtk_widget_show (resolution);
|
||||
|
||||
g_signal_connect (resolution, "x-changed",
|
||||
|
Reference in New Issue
Block a user