mirror of https://github.com/GNOME/gimp.git
added a label that shows the pixel size (as in the initial mockup done by
2004-09-24 Sven Neumann <sven@gimp.org> * app/widgets/gimptemplateeditor.[ch]: added a label that shows the pixel size (as in the initial mockup done by Jimmac).
This commit is contained in:
parent
fd8931f2ea
commit
f4b3d0918e
|
@ -4,6 +4,11 @@
|
||||||
(gimp_image_map_tool_settings_dialog): set the folder using
|
(gimp_image_map_tool_settings_dialog): set the folder using
|
||||||
gtk_file_chooser_set_current_folder(), not set_filename().
|
gtk_file_chooser_set_current_folder(), not set_filename().
|
||||||
|
|
||||||
|
2004-09-24 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/widgets/gimptemplateeditor.[ch]: added a label that shows
|
||||||
|
the pixel size (as in the initial mockup done by Jimmac).
|
||||||
|
|
||||||
2004-09-24 Sven Neumann <sven@gimp.org>
|
2004-09-24 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/base/curves.[ch]
|
* app/base/curves.[ch]
|
||||||
|
|
|
@ -186,6 +186,7 @@ gimp_template_editor_constructor (GType type,
|
||||||
GtkWidget *aspect_box;
|
GtkWidget *aspect_box;
|
||||||
GtkWidget *frame;
|
GtkWidget *frame;
|
||||||
GtkWidget *hbox;
|
GtkWidget *hbox;
|
||||||
|
GtkWidget *vbox;
|
||||||
GtkWidget *table;
|
GtkWidget *table;
|
||||||
GtkWidget *label;
|
GtkWidget *label;
|
||||||
GtkObject *adjustment;
|
GtkObject *adjustment;
|
||||||
|
@ -277,7 +278,7 @@ gimp_template_editor_constructor (GType type,
|
||||||
editor->template->xresolution,
|
editor->template->xresolution,
|
||||||
editor->template->yresolution);
|
editor->template->yresolution);
|
||||||
|
|
||||||
hbox = gtk_hbox_new (FALSE, 6);
|
hbox = gtk_hbox_new (FALSE, 12);
|
||||||
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 3, 2, 3);
|
gtk_table_attach_defaults (GTK_TABLE (table), hbox, 1, 3, 2, 3);
|
||||||
gtk_widget_show (hbox);
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
|
@ -291,9 +292,25 @@ gimp_template_editor_constructor (GType type,
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), aspect_box, FALSE, FALSE, 0);
|
gtk_box_pack_start (GTK_BOX (hbox), aspect_box, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (aspect_box);
|
gtk_widget_show (aspect_box);
|
||||||
|
|
||||||
|
vbox = gtk_vbox_new (2, FALSE);
|
||||||
|
gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
|
||||||
|
gtk_widget_show (vbox);
|
||||||
|
|
||||||
|
editor->pixel_label = gtk_label_new (NULL);
|
||||||
|
gimp_label_set_attributes (GTK_LABEL (editor->pixel_label),
|
||||||
|
PANGO_ATTR_SCALE, PANGO_SCALE_SMALL,
|
||||||
|
-1);
|
||||||
|
gtk_misc_set_alignment (GTK_MISC (editor->pixel_label), 0.0, 0.0);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), editor->pixel_label, FALSE, FALSE, 0);
|
||||||
|
gtk_widget_show (editor->pixel_label);
|
||||||
|
|
||||||
editor->memsize_label = gtk_label_new (NULL);
|
editor->memsize_label = gtk_label_new (NULL);
|
||||||
gtk_misc_set_alignment (GTK_MISC (editor->memsize_label), 1.0, 1.0);
|
gimp_label_set_attributes (GTK_LABEL (editor->memsize_label),
|
||||||
gtk_box_pack_start (GTK_BOX (hbox), editor->memsize_label, TRUE, TRUE, 0);
|
PANGO_ATTR_SCALE, PANGO_SCALE_SMALL,
|
||||||
|
PANGO_ATTR_WEIGHT, PANGO_WEIGHT_BOLD,
|
||||||
|
-1);
|
||||||
|
gtk_misc_set_alignment (GTK_MISC (editor->memsize_label), 0.0, 0.0);
|
||||||
|
gtk_box_pack_start (GTK_BOX (vbox), editor->memsize_label, FALSE, FALSE, 0);
|
||||||
gtk_widget_show (editor->memsize_label);
|
gtk_widget_show (editor->memsize_label);
|
||||||
|
|
||||||
text = g_strdup_printf ("<b>%s</b>", _("_Advanced Options"));
|
text = g_strdup_printf ("<b>%s</b>", _("_Advanced Options"));
|
||||||
|
@ -436,6 +453,9 @@ gimp_template_editor_constructor (GType type,
|
||||||
G_CALLBACK (gimp_template_editor_template_notify),
|
G_CALLBACK (gimp_template_editor_template_notify),
|
||||||
editor, 0);
|
editor, 0);
|
||||||
|
|
||||||
|
/* call the notify callback once to get the labels set initially */
|
||||||
|
gimp_template_editor_template_notify (editor->template, NULL, editor);
|
||||||
|
|
||||||
return object;
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -629,6 +649,11 @@ gimp_template_editor_template_notify (GimpTemplate *template,
|
||||||
gtk_label_set_text (GTK_LABEL (editor->memsize_label), text);
|
gtk_label_set_text (GTK_LABEL (editor->memsize_label), text);
|
||||||
g_free (text);
|
g_free (text);
|
||||||
|
|
||||||
|
text = g_strdup_printf (_("%d x %d pixels"),
|
||||||
|
editor->template->width, editor->template->height);
|
||||||
|
gtk_label_set_text (GTK_LABEL (editor->pixel_label), text);
|
||||||
|
g_free (text);
|
||||||
|
|
||||||
if (editor->template->width > editor->template->height)
|
if (editor->template->width > editor->template->height)
|
||||||
aspect = GIMP_ASPECT_LANDSCAPE;
|
aspect = GIMP_ASPECT_LANDSCAPE;
|
||||||
else if (editor->template->height > editor->template->width)
|
else if (editor->template->height > editor->template->width)
|
||||||
|
|
|
@ -51,6 +51,7 @@ struct _GimpTemplateEditor
|
||||||
GtkWidget *expander;
|
GtkWidget *expander;
|
||||||
GtkWidget *size_se;
|
GtkWidget *size_se;
|
||||||
GtkWidget *memsize_label;
|
GtkWidget *memsize_label;
|
||||||
|
GtkWidget *pixel_label;
|
||||||
GtkWidget *resolution_se;
|
GtkWidget *resolution_se;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue