diff --git a/SparkleLib/SparkleLib.csproj b/SparkleLib/SparkleLib.csproj index 1e72a6ea..8b7c4ada 100644 --- a/SparkleLib/SparkleLib.csproj +++ b/SparkleLib/SparkleLib.csproj @@ -22,7 +22,7 @@ none False - bin\Debug + ..\bin 4 diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-active.png b/SparkleShare/Mac/Resources/process-syncing-active.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-active.png rename to SparkleShare/Mac/Resources/process-syncing-active.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-active@2x.png b/SparkleShare/Mac/Resources/process-syncing-active@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-active@2x.png rename to SparkleShare/Mac/Resources/process-syncing-active@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-down-active.png b/SparkleShare/Mac/Resources/process-syncing-down-active.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-down-active.png rename to SparkleShare/Mac/Resources/process-syncing-down-active.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-down-active@2x.png b/SparkleShare/Mac/Resources/process-syncing-down-active@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-down-active@2x.png rename to SparkleShare/Mac/Resources/process-syncing-down-active@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-down.png b/SparkleShare/Mac/Resources/process-syncing-down.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-down.png rename to SparkleShare/Mac/Resources/process-syncing-down.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-down@2x.png b/SparkleShare/Mac/Resources/process-syncing-down@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-down@2x.png rename to SparkleShare/Mac/Resources/process-syncing-down@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-error-active.png b/SparkleShare/Mac/Resources/process-syncing-error-active.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-error-active.png rename to SparkleShare/Mac/Resources/process-syncing-error-active.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-error-active@2x.png b/SparkleShare/Mac/Resources/process-syncing-error-active@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-error-active@2x.png rename to SparkleShare/Mac/Resources/process-syncing-error-active@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-error.png b/SparkleShare/Mac/Resources/process-syncing-error.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-error.png rename to SparkleShare/Mac/Resources/process-syncing-error.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-error@2x.png b/SparkleShare/Mac/Resources/process-syncing-error@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-error@2x.png rename to SparkleShare/Mac/Resources/process-syncing-error@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-idle-active.png b/SparkleShare/Mac/Resources/process-syncing-idle-active.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-idle-active.png rename to SparkleShare/Mac/Resources/process-syncing-idle-active.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-idle-active@2x.png b/SparkleShare/Mac/Resources/process-syncing-idle-active@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-idle-active@2x.png rename to SparkleShare/Mac/Resources/process-syncing-idle-active@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-idle.png b/SparkleShare/Mac/Resources/process-syncing-idle.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-idle.png rename to SparkleShare/Mac/Resources/process-syncing-idle.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-idle@2x.png b/SparkleShare/Mac/Resources/process-syncing-idle@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-idle@2x.png rename to SparkleShare/Mac/Resources/process-syncing-idle@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-up-active.png b/SparkleShare/Mac/Resources/process-syncing-up-active.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-up-active.png rename to SparkleShare/Mac/Resources/process-syncing-up-active.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-up-active@2x.png b/SparkleShare/Mac/Resources/process-syncing-up-active@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-up-active@2x.png rename to SparkleShare/Mac/Resources/process-syncing-up-active@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-up.png b/SparkleShare/Mac/Resources/process-syncing-up.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-up.png rename to SparkleShare/Mac/Resources/process-syncing-up.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing-up@2x.png b/SparkleShare/Mac/Resources/process-syncing-up@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing-up@2x.png rename to SparkleShare/Mac/Resources/process-syncing-up@2x.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing.png b/SparkleShare/Mac/Resources/process-syncing.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing.png rename to SparkleShare/Mac/Resources/process-syncing.png diff --git a/SparkleShare/Mac/Pixmaps/process-syncing@2x.png b/SparkleShare/Mac/Resources/process-syncing@2x.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/process-syncing@2x.png rename to SparkleShare/Mac/Resources/process-syncing@2x.png diff --git a/SparkleShare/Mac/Pixmaps/sparkleshare-app.icns b/SparkleShare/Mac/Resources/sparkleshare-app.icns similarity index 100% rename from SparkleShare/Mac/Pixmaps/sparkleshare-app.icns rename to SparkleShare/Mac/Resources/sparkleshare-app.icns diff --git a/SparkleShare/Mac/Pixmaps/sparkleshare-folder.icns b/SparkleShare/Mac/Resources/sparkleshare-folder.icns similarity index 100% rename from SparkleShare/Mac/Pixmaps/sparkleshare-folder.icns rename to SparkleShare/Mac/Resources/sparkleshare-folder.icns diff --git a/SparkleShare/Mac/Pixmaps/tutorial-slide-3.png b/SparkleShare/Mac/Resources/tutorial-slide-3.png similarity index 100% rename from SparkleShare/Mac/Pixmaps/tutorial-slide-3.png rename to SparkleShare/Mac/Resources/tutorial-slide-3.png diff --git a/SparkleShare/Mac/Resources/tutorial-slide-3@2x.png b/SparkleShare/Mac/Resources/tutorial-slide-3@2x.png new file mode 100644 index 00000000..0174c1c1 Binary files /dev/null and b/SparkleShare/Mac/Resources/tutorial-slide-3@2x.png differ diff --git a/SparkleShare/Mac/SparkleAbout.cs b/SparkleShare/Mac/SparkleAbout.cs index 583357f2..15047b6f 100755 --- a/SparkleShare/Mac/SparkleAbout.cs +++ b/SparkleShare/Mac/SparkleAbout.cs @@ -80,8 +80,8 @@ namespace SparkleShare { private void CreateAbout () { - string about_image_path = Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "about.png"); - this.about_image = new NSImage (about_image_path) { Size = new SizeF (640, 260) }; + this.about_image = NSImage.ImageNamed ("about"); + this.about_image.Size = new SizeF (640, 260); this.about_image_view = new NSImageView () { Image = this.about_image, diff --git a/SparkleShare/Mac/SparkleSetup.cs b/SparkleShare/Mac/SparkleSetup.cs index d37f6a22..93787cf0 100755 --- a/SparkleShare/Mac/SparkleSetup.cs +++ b/SparkleShare/Mac/SparkleSetup.cs @@ -253,7 +253,7 @@ namespace SparkleShare { TableView.AddColumn (IconColumn); TableView.AddColumn (DescriptionColumn); - DataSource = new SparkleDataSource (Controller.Plugins); + DataSource = new SparkleDataSource (BackingScaleFactor, Controller.Plugins); TableView.DataSource = DataSource; TableView.ReloadData (); @@ -598,13 +598,9 @@ namespace SparkleShare { } if (type == PageType.Tutorial) { - string slide_image_path = Path.Combine (NSBundle.MainBundle.ResourcePath, - "Pixmaps", "tutorial-slide-" + Controller.TutorialPageNumber + ".png"); - - if (File.Exists (slide_image_path)) { - SlideImage = new NSImage (slide_image_path) { - Size = new SizeF (324, 200) - }; + SlideImage = NSImage.ImageNamed ("tutorial-slide-" + Controller.TutorialPageNumber); + if (SlideImage != null) { + SlideImage.Size = new SizeF (324, 200); SlideImageView = new NSImageView () { Image = SlideImage, @@ -725,13 +721,16 @@ namespace SparkleShare { public List Items; public NSAttributedString [] Cells, SelectedCells; + int backingScaleFactor; - public SparkleDataSource (List plugins) + public SparkleDataSource (float backingScaleFactor, List plugins) { Items = new List (); Cells = new NSAttributedString [plugins.Count]; SelectedCells = new NSAttributedString [plugins.Count]; + this.backingScaleFactor = (int)backingScaleFactor; + int i = 0; foreach (SparklePlugin plugin in plugins) { Items.Add (plugin); @@ -815,7 +814,22 @@ namespace SparkleShare { } } else { - return new NSImage ((Items [row_index] as SparklePlugin).ImagePath) { + var plugin = (SparklePlugin)Items [row_index]; + var path = plugin.ImagePath; + + if (backingScaleFactor >= 2) { + var hi_path = String.Format ("{0}@{1}x{2}", + Path.Combine (Path.GetDirectoryName (path), Path.GetFileNameWithoutExtension (path)), + backingScaleFactor, + Path.GetExtension (path) + ); + + if (File.Exists (hi_path)) { + path = hi_path; + } + } + + return new NSImage (path) { Size = new SizeF (24, 24) }; } diff --git a/SparkleShare/Mac/SparkleSetupWindow.cs b/SparkleShare/Mac/SparkleSetupWindow.cs index 0ea7a8ce..f04f32f8 100755 --- a/SparkleShare/Mac/SparkleSetupWindow.cs +++ b/SparkleShare/Mac/SparkleSetupWindow.cs @@ -50,8 +50,8 @@ namespace SparkleShare { Center (); - string side_splash_path = Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "side-splash.png"); - this.side_splash = new NSImage (side_splash_path) { Size = new SizeF (150, 482) }; + this.side_splash = NSImage.ImageNamed ("side-splash"); + this.side_splash.Size = new SizeF (150, 482); this.side_splash_view = new NSImageView () { Image = this.side_splash, diff --git a/SparkleShare/Mac/SparkleShare.csproj b/SparkleShare/Mac/SparkleShare.csproj index 616b08bb..09cb2b29 100644 --- a/SparkleShare/Mac/SparkleShare.csproj +++ b/SparkleShare/Mac/SparkleShare.csproj @@ -105,21 +105,6 @@ - - Plugins\bitbucket%402x.png - - - Plugins\github%402x.png - - - Plugins\gitorious%402x.png - - - Plugins\own-server%402x.png - - - Plugins\ssnet%402x.png - @@ -133,110 +118,18 @@ HTML\event-log.html - - Pixmaps\side-splash.png - - + sparkleshare-folder.icns - + sparkleshare-app.icns - - Pixmaps\document-added-12.png - - - Pixmaps\document-edited-12.png - - - Pixmaps\document-deleted-12.png - - - Pixmaps\document-moved-12.png - - - Pixmaps\about.png - HTML\jquery.js - - Pixmaps\tutorial-slide-3.png - - - Plugins\bitbucket.xml - - - Plugins\github.xml - - - Plugins\gitorious.xml - - - Plugins\own-server.xml - - - Plugins\bitbucket.png - - - Plugins\github.png - - - Plugins\gitorious.png - - - Plugins\own-server.png - - - Plugins\ssnet.png - - - Plugins\ssnet.xml - - - - - - - - - - - - - Pixmaps\user-icon-default.png - - - Pixmaps\side-splash%402x.png - - - - - - - - - - - - - Pixmaps\about%402x.png - - - Pixmaps\tutorial-slide-1.png - - - Pixmaps\tutorial-slide-1%402x.png - - - Pixmaps\tutorial-slide-2.png - - - Pixmaps\tutorial-slide-2%402x.png - - + @@ -250,4 +143,114 @@ SparkleLib.Git + + + Resources\side-splash.png + + + Resources\document-added-12.png + + + Resources\document-edited-12.png + + + Resources\document-deleted-12.png + + + Resources\document-moved-12.png + + + Resources\about.png + + + Resources\tutorial-slide-3.png + + + + + + + + + + + + + Resources\user-icon-default.png + + + Resources\side-splash%402x.png + + + + + + + + + + + + + Resources\about%402x.png + + + Resources\tutorial-slide-1.png + + + Resources\tutorial-slide-1%402x.png + + + Resources\tutorial-slide-2.png + + + Resources\tutorial-slide-2%402x.png + + + Plugins\bitbucket%402x.png + + + Plugins\github%402x.png + + + Plugins\gitorious%402x.png + + + Plugins\own-server%402x.png + + + Plugins\ssnet%402x.png + + + Plugins\bitbucket.xml + + + Plugins\github.xml + + + Plugins\gitorious.xml + + + Plugins\own-server.xml + + + Plugins\bitbucket.png + + + Plugins\github.png + + + Plugins\gitorious.png + + + Plugins\own-server.png + + + Plugins\ssnet.png + + + Plugins\ssnet.xml + + + diff --git a/SparkleShare/Mac/SparkleStatusIcon.cs b/SparkleShare/Mac/SparkleStatusIcon.cs index 71034a29..1f2ec1d1 100755 --- a/SparkleShare/Mac/SparkleStatusIcon.cs +++ b/SparkleShare/Mac/SparkleStatusIcon.cs @@ -34,17 +34,17 @@ namespace SparkleShare { private NSMenuItem state_item, folder_item, add_item, about_item, recent_events_item, quit_item; private NSMenuItem [] folder_menu_items, error_menu_items, try_again_menu_items; - private NSImage syncing_idle_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-idle.png")); - private NSImage syncing_up_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-up.png")); - private NSImage syncing_down_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-down.png")); - private NSImage syncing_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing.png")); - private NSImage syncing_error_image = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-error.png")); + private NSImage syncing_idle_image = NSImage.ImageNamed ("process-syncing-idle"); + private NSImage syncing_up_image = NSImage.ImageNamed ("process-syncing-up"); + private NSImage syncing_down_image = NSImage.ImageNamed ("process-syncing-down"); + private NSImage syncing_image = NSImage.ImageNamed ("process-syncing"); + private NSImage syncing_error_image = NSImage.ImageNamed ("process-syncing-error"); - private NSImage syncing_idle_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-idle-active.png")); - private NSImage syncing_up_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-up-active.png")); - private NSImage syncing_down_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-down-active.png")); - private NSImage syncing_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-active.png")); - private NSImage syncing_error_image_active = new NSImage (Path.Combine (NSBundle.MainBundle.ResourcePath, "Pixmaps", "process-syncing-error-active.png")); + private NSImage syncing_idle_image_active = NSImage.ImageNamed ("process-syncing-idle-active"); + private NSImage syncing_up_image_active = NSImage.ImageNamed ("process-syncing-up-active"); + private NSImage syncing_down_image_active = NSImage.ImageNamed ("process-syncing-down-active"); + private NSImage syncing_image_active = NSImage.ImageNamed ("process-syncing-active"); + private NSImage syncing_error_image_active = NSImage.ImageNamed ("process-syncing-error-active"); private NSImage folder_image = NSImage.ImageNamed ("NSFolder"); private NSImage caution_image = NSImage.ImageNamed ("NSCaution");