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>
|
2005-07-17 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* plug-ins/common/nlfilt.c
|
* plug-ins/common/nlfilt.c
|
||||||
|
@ -79,11 +79,13 @@ static void gimp_resolution_entry_field_set_boundaries
|
|||||||
gdouble lower,
|
gdouble lower,
|
||||||
gdouble upper);
|
gdouble upper);
|
||||||
|
|
||||||
static void
|
static void gimp_resolution_entry_field_set_value
|
||||||
gimp_resolution_entry_field_set_value (GimpResolutionEntryField *gref,
|
(GimpResolutionEntryField *gref,
|
||||||
gdouble value);
|
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 guint gimp_resolution_entry_signals[LAST_SIGNAL] = { 0 };
|
||||||
|
|
||||||
static GtkTableClass *parent_class = NULL;
|
static GtkTableClass *parent_class = NULL;
|
||||||
@ -184,6 +186,9 @@ gimp_resolution_entry_init (GimpResolutionEntry *gre)
|
|||||||
gre->unitmenu = NULL;
|
gre->unitmenu = NULL;
|
||||||
gre->unit = GIMP_UNIT_INCH;
|
gre->unit = GIMP_UNIT_INCH;
|
||||||
gre->independent = FALSE;
|
gre->independent = FALSE;
|
||||||
|
|
||||||
|
gtk_table_set_col_spacings (GTK_TABLE (gre), 4);
|
||||||
|
gtk_table_set_row_spacings (GTK_TABLE (gre), 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@ -239,16 +244,15 @@ gimp_resolution_entry_field_init (GimpResolutionEntry *gre,
|
|||||||
|
|
||||||
if (size)
|
if (size)
|
||||||
{
|
{
|
||||||
/*
|
gref->label = g_object_new (GTK_TYPE_LABEL,
|
||||||
* warning: not correctly localizable in many gimp supported languages
|
"xalign", 0.0,
|
||||||
* */
|
"yalign", 0.5,
|
||||||
gchar *text = g_strdup_printf (_("%f %s"), gref->phy_size *
|
NULL);
|
||||||
gimp_unit_get_factor (gre->unit),
|
gimp_label_set_attributes (GTK_LABEL (gref->label),
|
||||||
gimp_unit_get_plural (gre->unit));
|
PANGO_ATTR_STYLE, PANGO_STYLE_ITALIC,
|
||||||
|
-1);
|
||||||
|
|
||||||
gref->label = gtk_label_new (text);
|
gimp_resolution_entry_format_label (gre, gref->label, gref->phy_size);
|
||||||
|
|
||||||
g_free (text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
digits = size ? 0 : GIMP_RESOLUTION_ENTRY_DIGITS (initial_unit);
|
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.
|
* @size_unit: Unit used to specify the width and height.
|
||||||
* @x_label: Optional label for the X resolution entry.
|
* @x_label: Optional label for the X resolution entry.
|
||||||
* @initial_x: The initial X resolution.
|
* @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.
|
* @independent is %FALSE.
|
||||||
* @initial_y: The initial Y resolution. Ignored if @independent is
|
* @initial_y: The initial Y resolution. Ignored if @independent is
|
||||||
* %FALSE.
|
* %FALSE.
|
||||||
@ -431,16 +435,16 @@ gimp_resolution_entry_new (const gchar *width_label,
|
|||||||
gtk_widget_show (gre->height.label);
|
gtk_widget_show (gre->height.label);
|
||||||
|
|
||||||
if (width_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)
|
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)
|
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)
|
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);
|
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))
|
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)
|
if (child->left_attach == 1 && child->top_attach == row)
|
||||||
{
|
{
|
||||||
@ -917,8 +921,6 @@ gimp_resolution_entry_update_unit (GimpResolutionEntry *gre,
|
|||||||
{
|
{
|
||||||
GimpUnit old_unit;
|
GimpUnit old_unit;
|
||||||
gint digits;
|
gint digits;
|
||||||
|
|
||||||
gchar *label_text;
|
|
||||||
gdouble factor;
|
gdouble factor;
|
||||||
|
|
||||||
old_unit = gre->unit;
|
old_unit = gre->unit;
|
||||||
@ -931,8 +933,7 @@ gimp_resolution_entry_update_unit (GimpResolutionEntry *gre,
|
|||||||
MAX (3 + digits, 3));
|
MAX (3 + digits, 3));
|
||||||
|
|
||||||
|
|
||||||
factor = gimp_unit_get_factor (old_unit) /
|
factor = gimp_unit_get_factor (old_unit) / gimp_unit_get_factor (unit);
|
||||||
gimp_unit_get_factor (unit);
|
|
||||||
|
|
||||||
gre->x.min_value *= factor;
|
gre->x.min_value *= factor;
|
||||||
gre->x.max_value *= factor;
|
gre->x.max_value *= factor;
|
||||||
@ -956,21 +957,10 @@ gimp_resolution_entry_update_unit (GimpResolutionEntry *gre,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
factor = gimp_unit_get_factor (unit);
|
gimp_resolution_entry_format_label (gre,
|
||||||
|
gre->width.label, gre->width.phy_size);
|
||||||
/*
|
gimp_resolution_entry_format_label (gre,
|
||||||
* warning: not correctly localizable in many gimp supported languages
|
gre->height.label, gre->height.phy_size);
|
||||||
*/
|
|
||||||
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);
|
|
||||||
|
|
||||||
|
|
||||||
g_signal_emit (gre, gimp_resolution_entry_signals[UNIT_CHANGED], 0);
|
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);
|
*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
|
/* The GIMP -- an image manipulation program
|
||||||
*
|
*
|
||||||
* pdf.c - PDF file loader
|
* poppler.c - PDF file loader
|
||||||
*
|
*
|
||||||
* Copyright (C) 2005 Nathan Summers
|
* Copyright (C) 2005 Nathan Summers
|
||||||
*
|
*
|
||||||
@ -175,9 +175,8 @@ run (const gchar *name,
|
|||||||
static GimpParam values[2];
|
static GimpParam values[2];
|
||||||
GimpRunMode run_mode;
|
GimpRunMode run_mode;
|
||||||
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
GimpPDBStatusType status = GIMP_PDB_SUCCESS;
|
||||||
gint32 image_ID;
|
gint32 image_ID = -1;
|
||||||
|
PopplerDocument *doc = NULL;
|
||||||
PopplerDocument *doc;
|
|
||||||
|
|
||||||
run_mode = param[0].data.d_int32;
|
run_mode = param[0].data.d_int32;
|
||||||
|
|
||||||
@ -613,15 +612,15 @@ load_dialog (PopplerDocument *doc,
|
|||||||
GtkWidget *vbox;
|
GtkWidget *vbox;
|
||||||
GtkWidget *title;
|
GtkWidget *title;
|
||||||
GtkWidget *selector;
|
GtkWidget *selector;
|
||||||
GtkWidget *table;
|
|
||||||
GtkWidget *resolution;
|
GtkWidget *resolution;
|
||||||
GtkWidget *toggle;
|
GtkWidget *toggle;
|
||||||
|
GtkWidget *hbox;
|
||||||
|
|
||||||
ThreadData thread_data;
|
ThreadData thread_data;
|
||||||
GThread *thread;
|
GThread *thread;
|
||||||
|
|
||||||
int i;
|
gint i;
|
||||||
int n_pages;
|
gint n_pages;
|
||||||
|
|
||||||
gdouble width;
|
gdouble width;
|
||||||
gdouble height;
|
gdouble height;
|
||||||
@ -686,15 +685,12 @@ load_dialog (PopplerDocument *doc,
|
|||||||
|
|
||||||
thread = g_thread_create (thumbnail_thread, &thread_data, TRUE, NULL);
|
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 */
|
/* 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,
|
resolution = gimp_resolution_entry_new ("_Width (pixels):", width,
|
||||||
"_Height (pixels):", height,
|
"_Height (pixels):", height,
|
||||||
GIMP_UNIT_POINT,
|
GIMP_UNIT_POINT,
|
||||||
@ -706,7 +702,7 @@ load_dialog (PopplerDocument *doc,
|
|||||||
FALSE,
|
FALSE,
|
||||||
0);
|
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);
|
gtk_widget_show (resolution);
|
||||||
|
|
||||||
g_signal_connect (resolution, "x-changed",
|
g_signal_connect (resolution, "x-changed",
|
||||||
|
Reference in New Issue
Block a user