From 6741229b9ea99c9bc6fd384b43c4483b13b69d2c Mon Sep 17 00:00:00 2001 From: Hylke Bons Date: Wed, 26 Jun 2013 09:56:19 +0100 Subject: [PATCH] mac setup: determine hi-res display only in Lion or later --- SparkleShare/Mac/SparkleSetup.cs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/SparkleShare/Mac/SparkleSetup.cs b/SparkleShare/Mac/SparkleSetup.cs index d669ffd6..f6f8c797 100755 --- a/SparkleShare/Mac/SparkleSetup.cs +++ b/SparkleShare/Mac/SparkleSetup.cs @@ -253,7 +253,11 @@ namespace SparkleShare { TableView.AddColumn (IconColumn); TableView.AddColumn (DescriptionColumn); - DataSource = new SparkleDataSource (BackingScaleFactor, Controller.Plugins); + // The notification center was introduced in Mountain Lion + if (Environment.OSVersion.Version.Major < 11) + DataSource = new SparkleDataSource (1, Controller.Plugins); + else + DataSource = new SparkleDataSource (BackingScaleFactor, Controller.Plugins); TableView.DataSource = DataSource; TableView.ReloadData (); @@ -715,15 +719,15 @@ namespace SparkleShare { public List Items; public NSAttributedString [] Cells, SelectedCells; - int backingScaleFactor; + int backing_scale_factor; - public SparkleDataSource (float backingScaleFactor, List plugins) + public SparkleDataSource (float backing_scale_factor, List plugins) { Items = new List (); Cells = new NSAttributedString [plugins.Count]; SelectedCells = new NSAttributedString [plugins.Count]; - this.backingScaleFactor = (int)backingScaleFactor; + this.backing_scale_factor = (int) backing_scale_factor; int i = 0; foreach (SparklePlugin plugin in plugins) { @@ -811,10 +815,10 @@ namespace SparkleShare { var plugin = (SparklePlugin)Items [row_index]; var path = plugin.ImagePath; - if (backingScaleFactor >= 2) { + if (backing_scale_factor >= 2) { var hi_path = String.Format ("{0}@{1}x{2}", Path.Combine (Path.GetDirectoryName (path), Path.GetFileNameWithoutExtension (path)), - backingScaleFactor, + backing_scale_factor, Path.GetExtension (path) );