From 2ac4804bf705578fd2c6653db7230a6c82e01ed7 Mon Sep 17 00:00:00 2001 From: Artem Anufrij Date: Fri, 11 Aug 2017 13:10:30 +0200 Subject: [PATCH] notfication if external request; removed spinner while navigation within a website --- src/Widgets/WebApp.vala | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/Widgets/WebApp.vala b/src/Widgets/WebApp.vala index ae735b5..c301c4a 100644 --- a/src/Widgets/WebApp.vala +++ b/src/Widgets/WebApp.vala @@ -36,6 +36,7 @@ namespace Webpin { private DesktopFile file; private WebKit.CookieManager cookie_manager; private Gtk.Box container; //the spinner container + Granite.Widgets.Toast app_notification; public signal void external_request (WebKit.NavigationAction action); public signal void theme_color_changed(string color); @@ -78,15 +79,21 @@ namespace Webpin { container.valign = Gtk.Align.FILL; container.pack_start(spinner, true, true, 0); + app_notification = new Granite.Widgets.Toast (""); + //overlay trick to make snapshot work even with the spinner var overlay = new Gtk.Overlay (); - overlay.add(app_view); - overlay.add_overlay(container); + overlay.add (app_view); + overlay.add_overlay (container); + overlay.add_overlay (app_notification); - add(overlay); + add (overlay); app_view.create.connect ((action) => { print("external request"); + app_notification.title = _("Open request in an external application…"); + app_notification.send_notification (); + external_request (action); return new WebKit.WebView (); }); @@ -114,8 +121,6 @@ namespace Webpin { if (load_event == WebKit.LoadEvent.FINISHED) { debug ("determine color"); determine_theme_color.begin(); - } else { - container.set_visible(true); } }); }