Commit e260d064 authored by Sven Neumann's avatar Sven Neumann
Browse files

I guess finally we have the coordinates display working with all font sizes

and even after scaling the image.


--Sven
parent 0db6dcf1
Sun Dec 13 19:48:50 MET 1998 Sven Neumann <sven@gimp.org>
* app/gdisplay.[ch]
* app/gimage.c
* app/interface.c: I guess finally we have the coordinates
display working with all font sizes and even after scaling the
image
Sat Dec 12 17:36:51 GMT 1998 Austin Donnelly <austin@greenend.org.uk>
* app/interface.c
......
......@@ -132,7 +132,7 @@ gdisplay_new (GimpImage *gimage,
/* create the shell for the image */
create_display_shell (gdisp, gimage->width, gimage->height,
title, gimage_base_type (gimage));
/* set the gdisplay colormap type and install the appropriate colormap */
gdisp->color_type = (gimage_base_type (gimage) == GRAY) ? GRAY : RGB;
......@@ -932,7 +932,7 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
char buffer[CURSOR_STR_LENGTH];
int cursor_label_width;
g_snprintf (buffer, sizeof(buffer), " %d,%d ", gdisp->gimage->width, gdisp->gimage->height);
g_snprintf (buffer, sizeof(buffer),"%d, %d", gdisp->gimage->width, gdisp->gimage->height);
cursor_label_width =
gdk_string_width ( gtk_widget_get_style(gdisp->cursor_label)->font, buffer );
gtk_widget_set_usize (gdisp->cursor_label, cursor_label_width, -1);
......@@ -1531,6 +1531,24 @@ gdisplays_update_title (GimpImage *gimage)
}
}
void
gdisplays_resize_cursor_label (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
/* traverse the linked list of displays, handling each one */
while (list)
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
gdisplay_resize_cursor_label(gdisp);
}
list = g_slist_next (list);
}
}
void
gdisplays_update_area (GimpImage* gimage,
......
......@@ -174,6 +174,7 @@ void gdisplay_resize_cursor_label (GDisplay *);
GDisplay * gdisplay_active (void);
GDisplay * gdisplay_get_ID (int);
void gdisplays_update_title (GimpImage*);
void gdisplays_resize_cursor_label (GimpImage*);
void gdisplays_update_area (GimpImage*, int, int, int, int);
void gdisplays_expose_guides (GimpImage*);
void gdisplays_expose_guide (GimpImage*, Guide *);
......
......@@ -132,7 +132,7 @@ gdisplay_new (GimpImage *gimage,
/* create the shell for the image */
create_display_shell (gdisp, gimage->width, gimage->height,
title, gimage_base_type (gimage));
/* set the gdisplay colormap type and install the appropriate colormap */
gdisp->color_type = (gimage_base_type (gimage) == GRAY) ? GRAY : RGB;
......@@ -932,7 +932,7 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
char buffer[CURSOR_STR_LENGTH];
int cursor_label_width;
g_snprintf (buffer, sizeof(buffer), " %d,%d ", gdisp->gimage->width, gdisp->gimage->height);
g_snprintf (buffer, sizeof(buffer),"%d, %d", gdisp->gimage->width, gdisp->gimage->height);
cursor_label_width =
gdk_string_width ( gtk_widget_get_style(gdisp->cursor_label)->font, buffer );
gtk_widget_set_usize (gdisp->cursor_label, cursor_label_width, -1);
......@@ -1531,6 +1531,24 @@ gdisplays_update_title (GimpImage *gimage)
}
}
void
gdisplays_resize_cursor_label (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
/* traverse the linked list of displays, handling each one */
while (list)
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
gdisplay_resize_cursor_label(gdisp);
}
list = g_slist_next (list);
}
}
void
gdisplays_update_area (GimpImage* gimage,
......
......@@ -174,6 +174,7 @@ void gdisplay_resize_cursor_label (GDisplay *);
GDisplay * gdisplay_active (void);
GDisplay * gdisplay_get_ID (int);
void gdisplays_update_title (GimpImage*);
void gdisplays_resize_cursor_label (GimpImage*);
void gdisplays_update_area (GimpImage*, int, int, int, int);
void gdisplays_expose_guides (GimpImage*);
void gdisplays_expose_guide (GimpImage*, Guide *);
......
......@@ -714,6 +714,9 @@ create_display_shell (GDisplay* gdisp,
gdisp->cursor_label = gtk_label_new (" ");
gtk_container_add (GTK_CONTAINER (frame), gdisp->cursor_label);
/* we need to realize the cursor_label widget here, so the size gets
computed correctly */
gtk_widget_realize (gdisp->cursor_label);
gdisplay_resize_cursor_label (gdisp);
gdisp->statusbar = gtk_statusbar_new ();
......
......@@ -714,6 +714,9 @@ create_display_shell (GDisplay* gdisp,
gdisp->cursor_label = gtk_label_new (" ");
gtk_container_add (GTK_CONTAINER (frame), gdisp->cursor_label);
/* we need to realize the cursor_label widget here, so the size gets
computed correctly */
gtk_widget_realize (gdisp->cursor_label);
gdisplay_resize_cursor_label (gdisp);
gdisp->statusbar = gtk_statusbar_new ();
......
......@@ -132,7 +132,7 @@ gdisplay_new (GimpImage *gimage,
/* create the shell for the image */
create_display_shell (gdisp, gimage->width, gimage->height,
title, gimage_base_type (gimage));
/* set the gdisplay colormap type and install the appropriate colormap */
gdisp->color_type = (gimage_base_type (gimage) == GRAY) ? GRAY : RGB;
......@@ -932,7 +932,7 @@ gdisplay_resize_cursor_label (GDisplay *gdisp)
char buffer[CURSOR_STR_LENGTH];
int cursor_label_width;
g_snprintf (buffer, sizeof(buffer), " %d,%d ", gdisp->gimage->width, gdisp->gimage->height);
g_snprintf (buffer, sizeof(buffer),"%d, %d", gdisp->gimage->width, gdisp->gimage->height);
cursor_label_width =
gdk_string_width ( gtk_widget_get_style(gdisp->cursor_label)->font, buffer );
gtk_widget_set_usize (gdisp->cursor_label, cursor_label_width, -1);
......@@ -1531,6 +1531,24 @@ gdisplays_update_title (GimpImage *gimage)
}
}
void
gdisplays_resize_cursor_label (GimpImage *gimage)
{
GDisplay *gdisp;
GSList *list = display_list;
/* traverse the linked list of displays, handling each one */
while (list)
{
gdisp = (GDisplay *) list->data;
if (gdisp->gimage == gimage)
{
gdisplay_resize_cursor_label(gdisp);
}
list = g_slist_next (list);
}
}
void
gdisplays_update_area (GimpImage* gimage,
......
......@@ -174,6 +174,7 @@ void gdisplay_resize_cursor_label (GDisplay *);
GDisplay * gdisplay_active (void);
GDisplay * gdisplay_get_ID (int);
void gdisplays_update_title (GimpImage*);
void gdisplays_resize_cursor_label (GimpImage*);
void gdisplays_update_area (GimpImage*, int, int, int, int);
void gdisplays_expose_guides (GimpImage*);
void gdisplays_expose_guide (GimpImage*, Guide *);
......
......@@ -126,6 +126,7 @@ gimage_resize_handler (GimpImage* gimage)
channel_invalidate_previews (gimage);
layer_invalidate_previews (gimage);
gimp_image_invalidate_preview (gimage);
gdisplays_resize_cursor_label (gimage);
gdisplays_update_full (gimage);
gdisplays_shrink_wrap (gimage);
}
......
......@@ -714,6 +714,9 @@ create_display_shell (GDisplay* gdisp,
gdisp->cursor_label = gtk_label_new (" ");
gtk_container_add (GTK_CONTAINER (frame), gdisp->cursor_label);
/* we need to realize the cursor_label widget here, so the size gets
computed correctly */
gtk_widget_realize (gdisp->cursor_label);
gdisplay_resize_cursor_label (gdisp);
gdisp->statusbar = gtk_statusbar_new ();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment