diff options
author | Matthias Clasen <mclasen@redhat.com> | 2020-08-04 22:23:43 -0400 |
---|---|---|
committer | Matthias Clasen <mclasen@redhat.com> | 2020-08-04 23:05:18 -0400 |
commit | 8562c623d317023290ac092dea886a2f1f47810d (patch) | |
tree | 7932fd17b007c9cec6b31c1104b7da818b5f18bb /tests/testgtk.c | |
parent | 2b8aeed4d8bac16ba42521a2a92fb711600ecb9e (diff) | |
download | gtk+-8562c623d317023290ac092dea886a2f1f47810d.tar.gz |
Drop GtkAccelLabel
We no longer use this widget anywhere.
Diffstat (limited to 'tests/testgtk.c')
-rw-r--r-- | tests/testgtk.c | 100 |
1 files changed, 0 insertions, 100 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c index ad06542a8f..49d20714f1 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -1576,105 +1576,6 @@ create_listbox (GtkWidget *widget) gtk_window_destroy (GTK_WINDOW (window)); } - -static GtkWidget * -accel_button_new (const char *text, - const char *accel) -{ - guint keyval; - GdkModifierType modifiers; - GtkWidget *button; - GtkWidget *label; - GtkEventController *controller; - GtkShortcut *shortcut; - - if (!gtk_accelerator_parse (accel, &keyval, &modifiers)) - { - g_assert_not_reached (); - } - - button = gtk_button_new (); - controller = gtk_shortcut_controller_new (); - gtk_shortcut_controller_set_scope (GTK_SHORTCUT_CONTROLLER (controller), GTK_SHORTCUT_SCOPE_GLOBAL); - gtk_event_controller_set_propagation_phase (controller, GTK_PHASE_CAPTURE); - shortcut = gtk_shortcut_new (gtk_keyval_trigger_new (keyval, modifiers), - g_object_ref (gtk_activate_action_get ())); - gtk_shortcut_controller_add_shortcut (GTK_SHORTCUT_CONTROLLER (controller), shortcut); - gtk_widget_add_controller (button, controller); - - label = gtk_accel_label_new (text); - gtk_accel_label_set_accel (GTK_ACCEL_LABEL (label), keyval, modifiers); - gtk_button_set_child (GTK_BUTTON (button), label); - - return button; -} - -static void -create_key_lookup (GtkWidget *widget) -{ - static GtkWidget *window = NULL; - - if (!window) - { - GtkWidget *box; - GtkWidget *button; - GtkWidget *content_area; - - window = gtk_dialog_new_with_buttons ("Key Lookup", NULL, 0, - "_Close", GTK_RESPONSE_CLOSE, - NULL); - - gtk_window_set_display (GTK_WINDOW (window), - gtk_widget_get_display (widget)); - - /* We have to expand it so the accel labels will draw their labels - */ - gtk_window_set_default_size (GTK_WINDOW (window), 300, -1); - - content_area = gtk_dialog_get_content_area (GTK_DIALOG (window)); - - box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); - gtk_widget_set_hexpand (box, TRUE); - gtk_widget_set_vexpand (box, TRUE); - gtk_box_append (GTK_BOX (content_area), box); - - button = gtk_button_new_with_mnemonic ("Button 1 (_a)"); - gtk_box_append (GTK_BOX (box), button); - button = gtk_button_new_with_mnemonic ("Button 2 (_A)"); - gtk_box_append (GTK_BOX (box), button); - button = gtk_button_new_with_mnemonic ("Button 3 (_\321\204)"); - gtk_box_append (GTK_BOX (box), button); - button = gtk_button_new_with_mnemonic ("Button 4 (_\320\244)"); - gtk_box_append (GTK_BOX (box), button); - button = gtk_button_new_with_mnemonic ("Button 6 (_b)"); - gtk_box_append (GTK_BOX (box), button); - button = accel_button_new ("Button 7", "<Alt><Shift>b"); - gtk_box_append (GTK_BOX (box), button); - button = accel_button_new ("Button 8", "<Alt>d"); - gtk_box_append (GTK_BOX (box), button); - button = accel_button_new ("Button 9", "<Alt>Cyrillic_ve"); - gtk_box_append (GTK_BOX (box), button); - button = gtk_button_new_with_mnemonic ("Button 10 (_1)"); - gtk_box_append (GTK_BOX (box), button); - button = gtk_button_new_with_mnemonic ("Button 11 (_!)"); - gtk_box_append (GTK_BOX (box), button); - button = accel_button_new ("Button 12", "<Super>a"); - gtk_box_append (GTK_BOX (box), button); - button = accel_button_new ("Button 13", "<Hyper>a"); - gtk_box_append (GTK_BOX (box), button); - button = accel_button_new ("Button 14", "<Meta>a"); - gtk_box_append (GTK_BOX (box), button); - - g_object_add_weak_pointer (G_OBJECT (window), (gpointer *)&window); - g_signal_connect (window, "response", G_CALLBACK (gtk_window_destroy), NULL); - - gtk_widget_show (window); - } - else - gtk_window_destroy (GTK_WINDOW (window)); -} - - /* create_modal_window */ @@ -5872,7 +5773,6 @@ struct { { "flipping", create_flipping }, { "font selection", create_font_selection }, { "image", create_image }, - { "key lookup", create_key_lookup }, { "labels", create_labels }, { "listbox", create_listbox }, { "message dialog", create_message_dialog }, |