[blam/gtk3] Show the link in the statusbar on hover



commit fe422686edebd0fc7606c9a7332fa7c715598dd2
Author: Carlos Martín Nieto <cmn dwim me>
Date:   Sun Oct 13 22:17:38 2013 +0200

    Show the link in the statusbar on hover

 src/Blam.cs     |   12 ++++++++++++
 src/ItemView.cs |    1 -
 2 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/Blam.cs b/src/Blam.cs
index e20c7cc..b29ed83 100644
--- a/src/Blam.cs
+++ b/src/Blam.cs
@@ -7,6 +7,7 @@ using Mono.Unix;
 using System.Threading;
 using System.Reactive.Linq;
 using Imendio.Blam.TreeSelectionExtensions;
+using WebKit;
 
 namespace Blam
 {
@@ -23,6 +24,7 @@ namespace Blam
                ItemList ItemList;
                FeedList FeedList;
                ItemView ItemView;
+               Statusbar statusbar;
                Paned mainPaned;
                Paned itemPaned;
 
@@ -40,6 +42,7 @@ namespace Blam
                        var bld = new Builder();
                        bld.AddFromResource("blam.ui");
 
+                       statusbar = bld.GetObject<Statusbar>("statusbar");
                        MainWindow = bld.GetObject<Window>("main-window");
                        MainWindow.IconName = "blam";
                        MainWindow.DeleteEvent += toggleVisible;
@@ -89,6 +92,15 @@ namespace Blam
                        .Subscribe(_ => channels.RefreshAll());
 
                        restoreWindowState();
+
+                       Observable.FromEventPattern<HoveringOverLinkArgs>(ItemView, "HoveringOverLink")
+                               .Subscribe(x => {
+                                       uint id = statusbar.GetContextId("url");
+                                       statusbar.Pop(id);
+                                       var uri = x.EventArgs.Uri;
+                                       if (!String.IsNullOrEmpty(uri))
+                                               statusbar.Push(id, uri);
+                               });
                }
 
                void wireMenuItems(Builder bld)
diff --git a/src/ItemView.cs b/src/ItemView.cs
index eefe0f0..e13c4bb 100644
--- a/src/ItemView.cs
+++ b/src/ItemView.cs
@@ -92,7 +92,6 @@ namespace Blam
                                {"localbase", baseDir},
                        };
 
-                       Console.WriteLine(theme.Render(replaces));
                        LoadString(theme.Render(replaces), null, null, baseDir);
                }
 


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