diff options
author | Jeremie Laval <jeremie.laval@gmail.com> | 2012-03-06 15:38:31 +0400 |
---|---|---|
committer | Jeremie Laval <jeremie.laval@gmail.com> | 2012-03-06 15:38:31 +0400 |
commit | 46ac66f0038074be45406f7cdc8c29a3da8ad02f (patch) | |
tree | 2872c67830b97734336a8c0d11c284cd8e624e9f /MyDocument.cs | |
parent | e2b32ec0a84a33211c5e301297f9c70e94d638de (diff) |
Update bookmark spinner showing as we navigate
Diffstat (limited to 'MyDocument.cs')
-rw-r--r-- | MyDocument.cs | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/MyDocument.cs b/MyDocument.cs index 0ddf4f4..1bc1ec2 100644 --- a/MyDocument.cs +++ b/MyDocument.cs @@ -26,7 +26,6 @@ namespace macdoc Node match; string currentUrl; string currentTitle; - int currentBookmarkIndex; SearchableIndex searchIndex; IndexSearcher mdocSearch; @@ -151,10 +150,8 @@ namespace macdoc bookmarkSelector.Activated += (sender, e) => { var bmarks = manager.GetAllBookmarks (); var index = bookmarkSelector.IndexOfSelectedItem; - if (index >= 0 && index < bmarks.Count) { - currentBookmarkIndex = index; + if (index >= 0 && index < bmarks.Count) LoadUrl (bmarks[index].Url, true); - } }; bookmarkSelector.SelectItem (-1); } @@ -218,12 +215,9 @@ namespace macdoc tabSelector.SelectAt (0); } // Bookmark spinner management - if (currentBookmarkIndex != -1) { - bookmarkSelector.SelectItem (currentBookmarkIndex); - currentBookmarkIndex = -1; - } else { - bookmarkSelector.SelectItem (-1); - } + var bookmarkIndex = AppDelegate.BookmarkManager.FindIndexOfBookmarkFromUrl (url); + if (bookmarkIndex == -1 || bookmarkIndex < bookmarkSelector.ItemCount) + bookmarkSelector.SelectItem (bookmarkIndex); }); } }); |