[epiphany] web-view: Add close button to new info bar



commit e53e2a7bdd5bd82c7354b70d302b0951f6e3e0b5
Author: Michael Catanzaro <mcatanzaro gnome org>
Date:   Sun Nov 27 15:09:03 2016 -0600

    web-view: Add close button to new info bar
    
    It disappears on the next navigation, but users might want to hide it
    sooner. Note that we do not stop tracking it on close, so that it
    doesn't appear again until the next navigation.

 embed/ephy-web-view.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index 350cd31..713be07 100644
--- a/embed/ephy-web-view.c
+++ b/embed/ephy-web-view.c
@@ -763,12 +763,15 @@ sensitive_form_focused_cb (EphyEmbedShell *shell,
   /* Translators: Message appears when insecure password form is focused. */
   label = gtk_label_new (_("Heads-up: this form is not secure. If you type your password, it will be visible 
to cybercriminals!"));
   gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+  gtk_widget_show (label);
 
   info_bar = gtk_info_bar_new ();
   gtk_info_bar_set_message_type (GTK_INFO_BAR (info_bar), GTK_MESSAGE_WARNING);
+  gtk_info_bar_set_show_close_button (GTK_INFO_BAR (info_bar), TRUE);
   content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (info_bar));
   gtk_container_add (GTK_CONTAINER (content_area), label);
-  gtk_widget_show (label);
+
+  g_signal_connect (info_bar, "response", G_CALLBACK (gtk_widget_hide), NULL);
 
   track_info_bar (info_bar, &web_view->sensitive_form_info_bar);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]