renamed struct member combo to unit_combo. Place the combobox into the
2004-05-08 Sven Neumann <sven@gimp.org> * app/display/gimpstatusbar.[ch]: renamed struct member combo to unit_combo. Place the combobox into the cursor frame.
This commit is contained in:

committed by
Sven Neumann

parent
ebdd4fb738
commit
4722267d30
@ -1,3 +1,8 @@
|
|||||||
|
2004-05-08 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* app/display/gimpstatusbar.[ch]: renamed struct member combo to
|
||||||
|
unit_combo. Place the combobox into the cursor frame.
|
||||||
|
|
||||||
2004-05-08 Sven Neumann <sven@gimp.org>
|
2004-05-08 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
* app/widgets/Makefile.am
|
* app/widgets/Makefile.am
|
||||||
|
@ -103,6 +103,7 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
|
|||||||
{
|
{
|
||||||
GtkStatusbar *gtk_statusbar;
|
GtkStatusbar *gtk_statusbar;
|
||||||
GtkBox *box;
|
GtkBox *box;
|
||||||
|
GtkWidget *hbox;
|
||||||
GimpUnitStore *store;
|
GimpUnitStore *store;
|
||||||
GtkShadowType shadow_type;
|
GtkShadowType shadow_type;
|
||||||
|
|
||||||
@ -125,20 +126,23 @@ gimp_statusbar_init (GimpStatusbar *statusbar)
|
|||||||
gtk_box_reorder_child (box, statusbar->cursor_frame, 0);
|
gtk_box_reorder_child (box, statusbar->cursor_frame, 0);
|
||||||
gtk_widget_show (statusbar->cursor_frame);
|
gtk_widget_show (statusbar->cursor_frame);
|
||||||
|
|
||||||
|
hbox = gtk_hbox_new (FALSE, 1);
|
||||||
|
gtk_container_add (GTK_CONTAINER (statusbar->cursor_frame), hbox);
|
||||||
|
gtk_widget_show (hbox);
|
||||||
|
|
||||||
statusbar->cursor_label = gtk_label_new ("0, 0");
|
statusbar->cursor_label = gtk_label_new ("0, 0");
|
||||||
gtk_misc_set_alignment (GTK_MISC (statusbar->cursor_label), 0.5, 0.5);
|
gtk_misc_set_alignment (GTK_MISC (statusbar->cursor_label), 0.5, 0.5);
|
||||||
gtk_container_add (GTK_CONTAINER (statusbar->cursor_frame),
|
gtk_container_add (GTK_CONTAINER (hbox), statusbar->cursor_label);
|
||||||
statusbar->cursor_label);
|
|
||||||
gtk_widget_show (statusbar->cursor_label);
|
gtk_widget_show (statusbar->cursor_label);
|
||||||
|
|
||||||
store = gimp_unit_store_new (2);
|
store = gimp_unit_store_new (2);
|
||||||
statusbar->combo = gimp_unit_combo_box_new_with_model (store);
|
statusbar->unit_combo = gimp_unit_combo_box_new_with_model (store);
|
||||||
g_object_unref (store);
|
g_object_unref (store);
|
||||||
|
|
||||||
gtk_box_pack_start (box, statusbar->combo, FALSE, FALSE, 0);
|
gtk_container_add (GTK_CONTAINER (hbox), statusbar->unit_combo);
|
||||||
gtk_widget_show (statusbar->combo);
|
gtk_widget_show (statusbar->unit_combo);
|
||||||
|
|
||||||
g_signal_connect (statusbar->combo, "changed",
|
g_signal_connect (statusbar->unit_combo, "changed",
|
||||||
G_CALLBACK (gimp_statusbar_unit_changed),
|
G_CALLBACK (gimp_statusbar_unit_changed),
|
||||||
statusbar);
|
statusbar);
|
||||||
|
|
||||||
@ -305,14 +309,15 @@ gimp_statusbar_resize_cursor (GimpStatusbar *statusbar)
|
|||||||
shell = statusbar->shell;
|
shell = statusbar->shell;
|
||||||
gimage = shell->gdisp->gimage;
|
gimage = shell->gdisp->gimage;
|
||||||
|
|
||||||
model = gtk_combo_box_get_model (GTK_COMBO_BOX (statusbar->combo));
|
model = gtk_combo_box_get_model (GTK_COMBO_BOX (statusbar->unit_combo));
|
||||||
gimp_unit_store_set_resolutions (GIMP_UNIT_STORE (model),
|
gimp_unit_store_set_resolutions (GIMP_UNIT_STORE (model),
|
||||||
gimage->xresolution, gimage->yresolution);
|
gimage->xresolution, gimage->yresolution);
|
||||||
|
|
||||||
g_signal_handlers_block_by_func (statusbar->combo,
|
g_signal_handlers_block_by_func (statusbar->unit_combo,
|
||||||
gimp_statusbar_unit_changed, statusbar);
|
gimp_statusbar_unit_changed, statusbar);
|
||||||
gtk_combo_box_set_active (GTK_COMBO_BOX (statusbar->combo), gimage->unit);
|
gtk_combo_box_set_active (GTK_COMBO_BOX (statusbar->unit_combo),
|
||||||
g_signal_handlers_unblock_by_func (statusbar->combo,
|
gimage->unit);
|
||||||
|
g_signal_handlers_unblock_by_func (statusbar->unit_combo,
|
||||||
gimp_statusbar_unit_changed, statusbar);
|
gimp_statusbar_unit_changed, statusbar);
|
||||||
|
|
||||||
if (gimage->unit == GIMP_UNIT_PIXEL)
|
if (gimage->unit == GIMP_UNIT_PIXEL)
|
||||||
@ -368,7 +373,7 @@ gimp_statusbar_set_cursor (GimpStatusbar *statusbar,
|
|||||||
GimpUnitStore *store;
|
GimpUnitStore *store;
|
||||||
gchar buffer[CURSOR_STR_LENGTH];
|
gchar buffer[CURSOR_STR_LENGTH];
|
||||||
|
|
||||||
model = gtk_combo_box_get_model (GTK_COMBO_BOX (statusbar->combo));
|
model = gtk_combo_box_get_model (GTK_COMBO_BOX (statusbar->unit_combo));
|
||||||
store = GIMP_UNIT_STORE (model);
|
store = GIMP_UNIT_STORE (model);
|
||||||
|
|
||||||
gimp_unit_store_set_pixel_values (store, x, y);
|
gimp_unit_store_set_pixel_values (store, x, y);
|
||||||
|
@ -47,7 +47,7 @@ struct _GimpStatusbar
|
|||||||
GtkWidget *cursor_frame;
|
GtkWidget *cursor_frame;
|
||||||
GtkWidget *cursor_label;
|
GtkWidget *cursor_label;
|
||||||
gchar cursor_format_str[CURSOR_FORMAT_LENGTH];
|
gchar cursor_format_str[CURSOR_FORMAT_LENGTH];
|
||||||
GtkWidget *combo;
|
GtkWidget *unit_combo;
|
||||||
|
|
||||||
GtkWidget *progressbar;
|
GtkWidget *progressbar;
|
||||||
guint progressid;
|
guint progressid;
|
||||||
|
Reference in New Issue
Block a user