Commit a2fa5953 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Some visual tweaks to the about dialog, obey HIG spacing a bit more, add a

2005-01-27  Matthias Clasen  <mclasen@redhat.com>

	* gtk/gtkaboutdialog.c: Some visual tweaks to the about dialog,
	obey HIG spacing a bit more, add a hand cursor when over the
	link button.  (#163979, Jorn Baayen)
parent d5102464
2005-01-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaboutdialog.c: Some visual tweaks to the about dialog,
obey HIG spacing a bit more, add a hand cursor when over the
link button. (#163979, Jorn Baayen)
2005-01-26 Matthias Clasen <mclasen@redhat.com> 2005-01-26 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init):
......
2005-01-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaboutdialog.c: Some visual tweaks to the about dialog,
obey HIG spacing a bit more, add a hand cursor when over the
link button. (#163979, Jorn Baayen)
2005-01-26 Matthias Clasen <mclasen@redhat.com> 2005-01-26 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init):
......
2005-01-27 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkaboutdialog.c: Some visual tweaks to the about dialog,
obey HIG spacing a bit more, add a hand cursor when over the
link button. (#163979, Jorn Baayen)
2005-01-26 Matthias Clasen <mclasen@redhat.com> 2005-01-26 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init):
......
...@@ -115,6 +115,11 @@ static void gtk_about_dialog_set_property (GObject ...@@ -115,6 +115,11 @@ static void gtk_about_dialog_set_property (GObject
guint prop_id, guint prop_id,
const GValue *value, const GValue *value,
GParamSpec *pspec); GParamSpec *pspec);
static void gtk_about_dialog_style_set (GtkWidget *widget,
GtkStyle *previous_style);
static void dialog_style_set (GtkWidget *widget,
GtkStyle *previous_style,
gpointer data);
static void update_name_version (GtkAboutDialog *about); static void update_name_version (GtkAboutDialog *about);
static GtkIconSet * icon_set_new_from_pixbufs (GList *pixbufs); static GtkIconSet * icon_set_new_from_pixbufs (GList *pixbufs);
static void activate_url (GtkWidget *widget, static void activate_url (GtkWidget *widget,
...@@ -181,6 +186,8 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass) ...@@ -181,6 +186,8 @@ gtk_about_dialog_class_init (GtkAboutDialogClass *klass)
object_class->finalize = gtk_about_dialog_finalize; object_class->finalize = gtk_about_dialog_finalize;
widget_class->style_set = gtk_about_dialog_style_set;
/** /**
* GtkAboutDialog:name: * GtkAboutDialog:name:
* *
...@@ -439,7 +446,6 @@ gtk_about_dialog_init (GtkAboutDialog *about) ...@@ -439,7 +446,6 @@ gtk_about_dialog_init (GtkAboutDialog *about)
/* Widgets */ /* Widgets */
gtk_widget_push_composite_child (); gtk_widget_push_composite_child ();
vbox = gtk_vbox_new (FALSE, 8); vbox = gtk_vbox_new (FALSE, 8);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 8);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about)->vbox), vbox, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (about)->vbox), vbox, TRUE, TRUE, 0);
...@@ -649,6 +655,37 @@ gtk_about_dialog_get_property (GObject *object, ...@@ -649,6 +655,37 @@ gtk_about_dialog_get_property (GObject *object,
} }
} }
static void
dialog_style_set (GtkWidget *widget,
GtkStyle *previous_style,
gpointer data)
{
GtkDialog *dialog;
dialog = GTK_DIALOG (widget);
/* Override the style properties with HIG-compliant spacings. Ugh.
* http://developer.gnome.org/projects/gup/hig/1.0/layout.html#layout-dialogs
* http://developer.gnome.org/projects/gup/hig/1.0/windows.html#alert-spacing
*/
gtk_container_set_border_width (GTK_CONTAINER (dialog->vbox), 12);
gtk_box_set_spacing (GTK_BOX (dialog->vbox), 12);
gtk_container_set_border_width (GTK_CONTAINER (dialog->action_area), 0);
gtk_box_set_spacing (GTK_BOX (dialog->action_area), 6);
}
static void
gtk_about_dialog_style_set (GtkWidget *widget,
GtkStyle *previous_style)
{
if (GTK_WIDGET_CLASS (gtk_about_dialog_parent_class)->style_set)
GTK_WIDGET_CLASS (gtk_about_dialog_parent_class)->style_set (widget, previous_style);
dialog_style_set (widget, previous_style, NULL);
}
/** /**
* gtk_about_dialog_get_name: * gtk_about_dialog_get_name:
* @about: a #GtkAboutDialog * @about: a #GtkAboutDialog
...@@ -1533,6 +1570,27 @@ set_link_button_text (GtkWidget *about, ...@@ -1533,6 +1570,27 @@ set_link_button_text (GtkWidget *about,
g_free (link); g_free (link);
} }
static gboolean
link_button_enter (GtkWidget *widget,
GdkEventCrossing *event,
GtkAboutDialog *about)
{
GtkAboutDialogPrivate *priv = (GtkAboutDialogPrivate *)about->private_data;
gdk_window_set_cursor (widget->window, priv->hand_cursor);
return FALSE;
}
static gboolean
link_button_leave (GtkWidget *widget,
GdkEventCrossing *event,
GtkAboutDialog *about)
{
gdk_window_set_cursor (widget->window, NULL);
return FALSE;
}
static GtkWidget * static GtkWidget *
create_link_button (GtkWidget *about, create_link_button (GtkWidget *about,
gchar *text, gchar *text,
...@@ -1550,6 +1608,10 @@ create_link_button (GtkWidget *about, ...@@ -1550,6 +1608,10 @@ create_link_button (GtkWidget *about,
set_link_button_text (about, button, text); set_link_button_text (about, button, text);
g_signal_connect (button, "clicked", callback, data); g_signal_connect (button, "clicked", callback, data);
g_signal_connect (button, "enter_notify_event",
G_CALLBACK (link_button_enter), data);
g_signal_connect (button, "leave_notify_event",
G_CALLBACK (link_button_leave), data);
return button; return button;
} }
...@@ -1765,6 +1827,7 @@ add_credits_page (GtkAboutDialog *about, ...@@ -1765,6 +1827,7 @@ add_credits_page (GtkAboutDialog *about,
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view)); buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE); gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE); gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 8); gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 8);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 8); gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 8);
...@@ -1778,6 +1841,8 @@ add_credits_page (GtkAboutDialog *about, ...@@ -1778,6 +1841,8 @@ add_credits_page (GtkAboutDialog *about,
G_CALLBACK (credits_visibility_notify_event), about); G_CALLBACK (credits_visibility_notify_event), about);
sw = gtk_scrolled_window_new (NULL, NULL); sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
GTK_SHADOW_IN);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC,
GTK_POLICY_AUTOMATIC); GTK_POLICY_AUTOMATIC);
...@@ -1893,9 +1958,10 @@ display_credits_dialog (GtkWidget *button, ...@@ -1893,9 +1958,10 @@ display_credits_dialog (GtkWidget *button,
g_signal_connect (dialog, "destroy", g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed), G_CALLBACK (gtk_widget_destroyed),
&(priv->credits_dialog)); &(priv->credits_dialog));
g_signal_connect (dialog, "style_set",
G_CALLBACK (dialog_style_set), NULL);
notebook = gtk_notebook_new (); notebook = gtk_notebook_new ();
gtk_container_set_border_width (GTK_CONTAINER (notebook), 8);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), notebook, TRUE, TRUE, 0);
if (priv->authors != NULL) if (priv->authors != NULL)
...@@ -1963,6 +2029,8 @@ display_license_dialog (GtkWidget *button, ...@@ -1963,6 +2029,8 @@ display_license_dialog (GtkWidget *button,
g_signal_connect (dialog, "destroy", g_signal_connect (dialog, "destroy",
G_CALLBACK (gtk_widget_destroyed), G_CALLBACK (gtk_widget_destroyed),
&(priv->license_dialog)); &(priv->license_dialog));
g_signal_connect (dialog, "style_set",
G_CALLBACK (dialog_style_set), NULL);
sw = gtk_scrolled_window_new (NULL, NULL); sw = gtk_scrolled_window_new (NULL, NULL);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw),
...@@ -1971,7 +2039,6 @@ display_license_dialog (GtkWidget *button, ...@@ -1971,7 +2039,6 @@ display_license_dialog (GtkWidget *button,
GTK_POLICY_NEVER, GTK_POLICY_NEVER,
GTK_POLICY_AUTOMATIC); GTK_POLICY_AUTOMATIC);
g_signal_connect (sw, "map", G_CALLBACK (set_policy), NULL); g_signal_connect (sw, "map", G_CALLBACK (set_policy), NULL);
gtk_container_set_border_width (GTK_CONTAINER (sw), 8);
gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), sw, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), sw, TRUE, TRUE, 0);
view = gtk_text_view_new (); view = gtk_text_view_new ();
...@@ -1980,6 +2047,7 @@ display_license_dialog (GtkWidget *button, ...@@ -1980,6 +2047,7 @@ display_license_dialog (GtkWidget *button,
gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE); gtk_text_view_set_cursor_visible (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE); gtk_text_view_set_editable (GTK_TEXT_VIEW (view), FALSE);
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 8); gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 8);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 8); gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 8);
......
Markdown is supported
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