diff options
author | Alexander Larsson <alexl@redhat.com> | 2009-05-25 14:30:01 +0200 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2009-05-25 14:30:01 +0200 |
commit | 7698daf97aced5c22aeeb7bfbf02567b61cebaef (patch) | |
tree | 3af0c19ca365eea39c6bee7c272b21fb3484d5eb /tests | |
parent | 1288ef1707dbb9a38d58be8c0dece6ea15a5ba00 (diff) | |
parent | d0f887ddb144a69a85371041d1ad3640ab379ee8 (diff) | |
download | gtk+-7698daf97aced5c22aeeb7bfbf02567b61cebaef.tar.gz |
Merge branch 'master' into client-side-windows
Conflicts:
gdk/x11/gdkwindow-x11.c
Diffstat (limited to 'tests')
-rw-r--r-- | tests/Makefile.am | 2 | ||||
-rw-r--r-- | tests/testgtk.c | 48 | ||||
-rw-r--r-- | tests/testgtkrc | 10 | ||||
-rw-r--r-- | tests/testmerge.c | 9 | ||||
-rwxr-xr-x | tests/teststatusicon.c | 2 | ||||
-rw-r--r-- | tests/testvolumebutton.c | 6 |
6 files changed, 69 insertions, 8 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am index 3efd3eb3ec..48e440550c 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -358,3 +358,5 @@ EXTRA_DIST += \ file-chooser-test-dir/empty \ file-chooser-test-dir/text.txt + +-include $(top_srcdir)/git.mk diff --git a/tests/testgtk.c b/tests/testgtk.c index 568bb1a54c..075bb8eb10 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -2961,6 +2961,45 @@ create_selectable_control (GtkWidget *widget) return button; } +static void +dialog_response (GtkWidget *dialog, gint response_id, GtkLabel *label) +{ + const gchar *text; + + gtk_widget_destroy (dialog); + + text = "Some <a href=\"http://en.wikipedia.org/wiki/Text\" title=\"plain text\">text</a> may be marked up\n" + "as hyperlinks, which can be clicked\n" + "or activated via <a href=\"keynav\">keynav</a>.\n" + "The links remain the same."; + gtk_label_set_markup (label, text); +} + +static gboolean +activate_link (GtkWidget *label, const gchar *uri, gpointer data) +{ + if (g_strcmp0 (uri, "keynav") == 0) + { + GtkWidget *dialog; + + dialog = gtk_message_dialog_new_with_markup (GTK_WINDOW (gtk_widget_get_toplevel (label)), + GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_MESSAGE_INFO, + GTK_BUTTONS_OK, + "The term <i>keynav</i> is a shorthand for " + "keyboard navigation and refers to the process of using a program " + "(exclusively) via keyboard input."); + + gtk_window_present (GTK_WINDOW (dialog)); + + g_signal_connect (dialog, "response", G_CALLBACK (dialog_response), label); + + return TRUE; + } + + return FALSE; +} + void create_labels (GtkWidget *widget) { static GtkWidget *window = NULL; @@ -3048,6 +3087,15 @@ void create_labels (GtkWidget *widget) gtk_container_add (GTK_CONTAINER (frame), label); gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); + frame = gtk_frame_new ("Links in a label"); + label = gtk_label_new ("Some <a href=\"http://en.wikipedia.org/wiki/Text\" title=\"plain text\">text</a> may be marked up\n" + "as hyperlinks, which can be clicked\n" + "or activated via <a href=\"keynav\">keynav</a>"); + gtk_label_set_use_markup (GTK_LABEL (label), TRUE); + gtk_container_add (GTK_CONTAINER (frame), label); + gtk_box_pack_start (GTK_BOX (vbox), frame, FALSE, FALSE, 0); + g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL); + vbox = gtk_vbox_new (FALSE, 5); gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0); frame = gtk_frame_new ("Line wrapped label"); diff --git a/tests/testgtkrc b/tests/testgtkrc index e94ab284b7..3b8f09f3df 100644 --- a/tests/testgtkrc +++ b/tests/testgtkrc @@ -32,7 +32,9 @@ style "global-style-properties" GtkButtonBox::child_min_width = 0 GtkButtonBox::child_min_height = 0 GtkArrow::arrow-scaling = 1.0 + GtkEntry::invisible-char = 10046 } + class "GtkWidget" style "global-style-properties" style "defaultfont" @@ -76,6 +78,14 @@ style "button" = "default" # bg[PRELIGHT] = { 0.75, 0, 0x00 } } +style "label" = "default" +{ + base[PRELIGHT] = "gray" + base[ACTIVE] = mix (0.9, "gray", "purple") +} + +class "GtkLabel" style "label" + style "toggle_button" = "button" { fg[NORMAL] = { 1.0, 0, 0 } diff --git a/tests/testmerge.c b/tests/testmerge.c index 125fba5257..a9b1222d25 100644 --- a/tests/testmerge.c +++ b/tests/testmerge.c @@ -641,14 +641,15 @@ main (int argc, char **argv) button = gtk_button_new (); gtk_box_pack_end (GTK_BOX (menu_box), button, FALSE, FALSE, 0); - gtk_action_connect_proxy (gtk_action_group_get_action (action_group, "AboutAction"), - button); + gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), + gtk_action_group_get_action (action_group, "AboutAction")); + gtk_widget_show (button); button = gtk_check_button_new (); gtk_box_pack_end (GTK_BOX (menu_box), button, FALSE, FALSE, 0); - gtk_action_connect_proxy (gtk_action_group_get_action (action_group, "BoldAction"), - button); + gtk_activatable_set_related_action (GTK_ACTIVATABLE (button), + gtk_action_group_get_action (action_group, "BoldAction")); gtk_widget_show (button); merge = gtk_ui_manager_new (); diff --git a/tests/teststatusicon.c b/tests/teststatusicon.c index 86473601f8..4829bf0d0a 100755 --- a/tests/teststatusicon.c +++ b/tests/teststatusicon.c @@ -89,7 +89,7 @@ update_icons (void) GtkStatusIcon *status_icon = l->data; gtk_status_icon_set_from_icon_name (status_icon, icon_name); - gtk_status_icon_set_tooltip (status_icon, tooltip); + gtk_status_icon_set_tooltip_text (status_icon, tooltip); } } diff --git a/tests/testvolumebutton.c b/tests/testvolumebutton.c index 01ff5ddbe2..ee1d2bd7e5 100644 --- a/tests/testvolumebutton.c +++ b/tests/testvolumebutton.c @@ -31,15 +31,15 @@ static void toggle_orientation (GtkWidget *button, GtkWidget *scalebutton) { - if (gtk_scale_button_get_orientation (GTK_SCALE_BUTTON (scalebutton)) == + if (gtk_orientable_get_orientation (GTK_ORIENTABLE (scalebutton)) == GTK_ORIENTATION_HORIZONTAL) { - gtk_scale_button_set_orientation (GTK_SCALE_BUTTON (scalebutton), + gtk_orientable_set_orientation (GTK_ORIENTABLE (scalebutton), GTK_ORIENTATION_VERTICAL); } else { - gtk_scale_button_set_orientation (GTK_SCALE_BUTTON (scalebutton), + gtk_orientable_set_orientation (GTK_ORIENTABLE (scalebutton), GTK_ORIENTATION_HORIZONTAL); } } |