Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/xamarin/macdoc.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Laval <jeremie.laval@gmail.com>2012-02-16 15:55:08 +0400
committerJeremie Laval <jeremie.laval@gmail.com>2012-02-16 15:55:08 +0400
commitf12dca3ed5e4b14823cdfd9dca11240275a40d9c (patch)
tree75c0c3cbdea76ee0a61a969e426696f121060e29 /MyDocument.cs
parentc60d1145dd2f0b141336908c6a2ff3321a0a61d7 (diff)
[macdoc] Make code display the good bookmark item when one is used
Diffstat (limited to 'MyDocument.cs')
-rw-r--r--MyDocument.cs14
1 files changed, 12 insertions, 2 deletions
diff --git a/MyDocument.cs b/MyDocument.cs
index b1099d2..871b5ae 100644
--- a/MyDocument.cs
+++ b/MyDocument.cs
@@ -26,6 +26,7 @@ namespace macdoc
Node match;
string currentUrl;
string currentTitle;
+ int currentBookmarkIndex;
SearchableIndex searchIndex;
IndexSearcher mdocSearch;
@@ -133,6 +134,7 @@ namespace macdoc
break;
case BookmarkEventType.Added:
bookmarkSelector.AddItem (e.Entry.Name);
+ bookmarkSelector.SelectItem (e.Entry.Name);
break;
}
};
@@ -142,9 +144,10 @@ namespace macdoc
bookmarkSelector.Activated += (sender, e) => {
var bmarks = manager.GetAllBookmarks ();
var index = bookmarkSelector.IndexOfSelectedItem;
- if (index >= 0 && index < bmarks.Count)
+ if (index >= 0 && index < bmarks.Count) {
+ currentBookmarkIndex = index;
LoadUrl (bmarks[index].Url, true);
- bookmarkSelector.SelectItem (-1);
+ }
};
bookmarkSelector.SelectItem (-1);
}
@@ -206,6 +209,13 @@ namespace macdoc
tabSelector.SelectAt (0);
this.match = node;
}
+ // Bookmark spinner management
+ if (currentBookmarkIndex != -1) {
+ bookmarkSelector.SelectItem (currentBookmarkIndex);
+ currentBookmarkIndex = -1;
+ } else {
+ bookmarkSelector.SelectItem (-1);
+ }
});
}
});