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:
authorJérémie Laval <jeremie.laval@gmail.com>2012-06-26 21:41:16 +0400
committerJérémie Laval <jeremie.laval@gmail.com>2012-06-26 21:41:16 +0400
commit5e440a0b7ed75c23d604f424f9ba256eaf042b2f (patch)
tree3e1baa05f84b89092cbe2993a3e2f30bb2e15313
parent876bbdaa03e2207b5e4f3cd31e07005028cc7358 (diff)
[macdoc] More Lion special casing
-rw-r--r--MyDocument.cs6
-rw-r--r--WebViewExtraordinaire.cs10
2 files changed, 12 insertions, 4 deletions
diff --git a/MyDocument.cs b/MyDocument.cs
index fb99a35..9374664 100644
--- a/MyDocument.cs
+++ b/MyDocument.cs
@@ -116,7 +116,8 @@ namespace macdoc
{
outlineView.DataSource = new DocTreeDataSource (this);
outlineView.Delegate = new OutlineDelegate (this);
- outlineView.EnclosingScrollView.HorizontalScrollElasticity = outlineView.EnclosingScrollView.VerticalScrollElasticity = NSScrollElasticity.None;
+ if (AppDelegate.IsOnLion)
+ outlineView.EnclosingScrollView.HorizontalScrollElasticity = outlineView.EnclosingScrollView.VerticalScrollElasticity = NSScrollElasticity.None;
}
void SetupSearch ()
@@ -257,7 +258,8 @@ namespace macdoc
if (ts < loadUrlTimestamp)
return;
currentUrl = node == null ? url : node.PublicUrl;
- InvalidateRestorableState ();
+ if (AppDelegate.IsOnLion)
+ InvalidateRestorableState ();
if (addToHistory)
history.AppendHistory (new LinkPageVisit (this, currentUrl));
LoadHtml (res);
diff --git a/WebViewExtraordinaire.cs b/WebViewExtraordinaire.cs
index ea97906..8e9d5ef 100644
--- a/WebViewExtraordinaire.cs
+++ b/WebViewExtraordinaire.cs
@@ -42,8 +42,11 @@ namespace macdoc
void Initialize ()
{
+ // The initializations we do here are Lion-specific
+ if (!AppDelegate.IsOnLion)
+ return;
findBarController = new FindBarExtraordinaireController ();
- IsSwipeEnabled = AppDelegate.IsOnLion && NSEvent.IsSwipeTrackingFromScrollEventsEnabled;
+ IsSwipeEnabled = NSEvent.IsSwipeTrackingFromScrollEventsEnabled;
FinishedLoad += (sender, e) => SetupFindBar (MainFrame.FrameView.DocumentView.EnclosingScrollView);
findBarController.View.FindTextChanged += (sender, e) => InternalPerformFinderAction (NSTextFinderAction.SetSearchString);
findBarController.View.CloseFindPanel += (sender, e) => InternalPerformFinderAction (NSTextFinderAction.HideFindInterface);
@@ -107,7 +110,7 @@ namespace macdoc
public override bool AcceptsFirstResponder ()
{
- return true;
+ return AppDelegate.IsOnLion;
}
void FireSwipeEvent (SwipeSide side)
@@ -126,6 +129,9 @@ namespace macdoc
public override void PerformFindPanelAction (NSObject sender)
{
+ if (!AppDelegate.IsOnLion)
+ return;
+
var ctrl = sender as NSMenuItem;
if (ctrl == null)
return;