don't abuse the SPLASHSCREEN window type hint, instead make the about

2004-03-14  Sven Neumann  <sven@gimp.org>

	* app/gui/about-dialog.c: don't abuse the SPLASHSCREEN window type
	hint, instead make the about dialog a popup window and center it
	explicitely.
This commit is contained in:
Sven Neumann 2004-03-14 20:55:13 +00:00 committed by Sven Neumann
parent 9e0af0e249
commit 7ed142c77e
3 changed files with 82 additions and 78 deletions

View File

@ -1,3 +1,9 @@
2004-03-14 Sven Neumann <sven@gimp.org>
* app/gui/about-dialog.c: don't abuse the SPLASHSCREEN window type
hint, instead make the about dialog a popup window and center it
explicitely.
2004-03-14 Sven Neumann <sven@gimp.org>
* app/widgets/gimptooldialog.c (gimp_tool_dialog_new): allow to

View File

@ -129,8 +129,6 @@ static void reshuffle_array (void);
static gboolean about_dialog_timer (gpointer data);
static gboolean double_speed = FALSE;
static PangoFontDescription *font_desc = NULL;
static gchar **scroll_text = authors;
static gint nscroll_texts = G_N_ELEMENTS (authors);
@ -143,27 +141,23 @@ about_dialog_create (void)
if (! about_info.about_dialog)
{
GtkWidget *widget;
GdkScreen *screen;
GdkGCValues shape_gcv;
about_info.visible = FALSE;
about_info.state = 0;
about_info.animstep = -1;
widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
widget = g_object_new (GTK_TYPE_WINDOW,
"type", GTK_WINDOW_POPUP,
"title", _("About The GIMP"),
"window_position", GTK_WIN_POS_CENTER,
"resizable", FALSE,
NULL);
about_info.about_dialog = widget;
gtk_window_set_type_hint (GTK_WINDOW (widget),
GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
gtk_window_set_wmclass (GTK_WINDOW (widget), "about_dialog", "Gimp");
gtk_window_set_title (GTK_WINDOW (widget), _("About The GIMP"));
gtk_window_set_position (GTK_WINDOW (widget), GTK_WIN_POS_CENTER);
/* The window must not be resizeable, since otherwise
* the copying of nonexisting parts of the image pixmap
* would result in an endless loop due to the X-Server
* generating expose events on the pixmap. */
gtk_window_set_resizable (GTK_WINDOW (widget), FALSE);
gtk_window_set_role (GTK_WINDOW (widget), "about-dialog");
g_signal_connect (widget, "destroy",
G_CALLBACK (about_dialog_destroy),
@ -187,6 +181,14 @@ about_dialog_create (void)
return NULL;
}
/* move the window to the middle of the screen */
screen = gtk_widget_get_screen (widget);
gtk_window_move (GTK_WINDOW (widget),
(gdk_screen_get_width (screen) -
about_info.pixmaparea.width) / 2,
(gdk_screen_get_height (screen) -
about_info.pixmaparea.height) / 2);
/* place the scrolltext at the bottom of the image */
about_info.textarea.width = about_info.pixmaparea.width;
about_info.textarea.height = 50;
@ -253,8 +255,6 @@ about_dialog_create (void)
}
if (! GTK_WIDGET_VISIBLE (about_info.about_dialog))
{
if (! double_speed)
{
about_info.state = 0;
about_info.index = 0;
@ -262,7 +262,6 @@ about_dialog_create (void)
reshuffle_array ();
pango_layout_set_text (about_info.layout, "", -1);
}
}
gtk_window_present (GTK_WINDOW (about_info.about_dialog));

View File

@ -129,8 +129,6 @@ static void reshuffle_array (void);
static gboolean about_dialog_timer (gpointer data);
static gboolean double_speed = FALSE;
static PangoFontDescription *font_desc = NULL;
static gchar **scroll_text = authors;
static gint nscroll_texts = G_N_ELEMENTS (authors);
@ -143,27 +141,23 @@ about_dialog_create (void)
if (! about_info.about_dialog)
{
GtkWidget *widget;
GdkScreen *screen;
GdkGCValues shape_gcv;
about_info.visible = FALSE;
about_info.state = 0;
about_info.animstep = -1;
widget = gtk_window_new (GTK_WINDOW_TOPLEVEL);
widget = g_object_new (GTK_TYPE_WINDOW,
"type", GTK_WINDOW_POPUP,
"title", _("About The GIMP"),
"window_position", GTK_WIN_POS_CENTER,
"resizable", FALSE,
NULL);
about_info.about_dialog = widget;
gtk_window_set_type_hint (GTK_WINDOW (widget),
GDK_WINDOW_TYPE_HINT_SPLASHSCREEN);
gtk_window_set_wmclass (GTK_WINDOW (widget), "about_dialog", "Gimp");
gtk_window_set_title (GTK_WINDOW (widget), _("About The GIMP"));
gtk_window_set_position (GTK_WINDOW (widget), GTK_WIN_POS_CENTER);
/* The window must not be resizeable, since otherwise
* the copying of nonexisting parts of the image pixmap
* would result in an endless loop due to the X-Server
* generating expose events on the pixmap. */
gtk_window_set_resizable (GTK_WINDOW (widget), FALSE);
gtk_window_set_role (GTK_WINDOW (widget), "about-dialog");
g_signal_connect (widget, "destroy",
G_CALLBACK (about_dialog_destroy),
@ -187,6 +181,14 @@ about_dialog_create (void)
return NULL;
}
/* move the window to the middle of the screen */
screen = gtk_widget_get_screen (widget);
gtk_window_move (GTK_WINDOW (widget),
(gdk_screen_get_width (screen) -
about_info.pixmaparea.width) / 2,
(gdk_screen_get_height (screen) -
about_info.pixmaparea.height) / 2);
/* place the scrolltext at the bottom of the image */
about_info.textarea.width = about_info.pixmaparea.width;
about_info.textarea.height = 50;
@ -253,8 +255,6 @@ about_dialog_create (void)
}
if (! GTK_WIDGET_VISIBLE (about_info.about_dialog))
{
if (! double_speed)
{
about_info.state = 0;
about_info.index = 0;
@ -262,7 +262,6 @@ about_dialog_create (void)
reshuffle_array ();
pango_layout_set_text (about_info.layout, "", -1);
}
}
gtk_window_present (GTK_WINDOW (about_info.about_dialog));