Merge pull request #1095 from abock/master

Add Retina Support
This commit is contained in:
Hylke Bons 2012-12-10 11:03:05 -08:00
commit 887f854458
30 changed files with 152 additions and 135 deletions

View file

@ -22,7 +22,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug</OutputPath>
<OutputPath>..\bin</OutputPath>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>

View file

Before

Width:  |  Height:  |  Size: 221 B

After

Width:  |  Height:  |  Size: 221 B

View file

Before

Width:  |  Height:  |  Size: 291 B

After

Width:  |  Height:  |  Size: 291 B

View file

Before

Width:  |  Height:  |  Size: 218 B

After

Width:  |  Height:  |  Size: 218 B

View file

Before

Width:  |  Height:  |  Size: 312 B

After

Width:  |  Height:  |  Size: 312 B

View file

Before

Width:  |  Height:  |  Size: 270 B

After

Width:  |  Height:  |  Size: 270 B

View file

Before

Width:  |  Height:  |  Size: 396 B

After

Width:  |  Height:  |  Size: 396 B

View file

Before

Width:  |  Height:  |  Size: 214 B

After

Width:  |  Height:  |  Size: 214 B

View file

Before

Width:  |  Height:  |  Size: 306 B

After

Width:  |  Height:  |  Size: 306 B

View file

Before

Width:  |  Height:  |  Size: 267 B

After

Width:  |  Height:  |  Size: 267 B

View file

Before

Width:  |  Height:  |  Size: 388 B

After

Width:  |  Height:  |  Size: 388 B

View file

Before

Width:  |  Height:  |  Size: 264 B

After

Width:  |  Height:  |  Size: 264 B

View file

Before

Width:  |  Height:  |  Size: 541 B

After

Width:  |  Height:  |  Size: 541 B

View file

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 271 B

View file

Before

Width:  |  Height:  |  Size: 726 B

After

Width:  |  Height:  |  Size: 726 B

View file

Before

Width:  |  Height:  |  Size: 220 B

After

Width:  |  Height:  |  Size: 220 B

View file

Before

Width:  |  Height:  |  Size: 316 B

After

Width:  |  Height:  |  Size: 316 B

View file

Before

Width:  |  Height:  |  Size: 273 B

After

Width:  |  Height:  |  Size: 273 B

View file

Before

Width:  |  Height:  |  Size: 415 B

After

Width:  |  Height:  |  Size: 415 B

View file

Before

Width:  |  Height:  |  Size: 271 B

After

Width:  |  Height:  |  Size: 271 B

View file

Before

Width:  |  Height:  |  Size: 329 B

After

Width:  |  Height:  |  Size: 329 B

View file

Before

Width:  |  Height:  |  Size: 90 KiB

After

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 335 KiB

View file

@ -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,

View file

@ -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<object> Items;
public NSAttributedString [] Cells, SelectedCells;
int backingScaleFactor;
public SparkleDataSource (List<SparklePlugin> plugins)
public SparkleDataSource (float backingScaleFactor, List<SparklePlugin> plugins)
{
Items = new List <object> ();
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)
};
}

View file

@ -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,

View file

@ -105,21 +105,6 @@
</ItemGroup>
<ItemGroup>
<None Include="Info.plist" />
<None Include="..\Common\Plugins\bitbucket%402x.png">
<Link>Plugins\bitbucket%402x.png</Link>
</None>
<None Include="..\Common\Plugins\github%402x.png">
<Link>Plugins\github%402x.png</Link>
</None>
<None Include="..\Common\Plugins\gitorious%402x.png">
<Link>Plugins\gitorious%402x.png</Link>
</None>
<None Include="..\Common\Plugins\own-server%402x.png">
<Link>Plugins\own-server%402x.png</Link>
</None>
<None Include="..\Common\Plugins\ssnet%402x.png">
<Link>Plugins\ssnet%402x.png</Link>
</None>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath)\Mono\MonoMac\v0.0\Mono.MonoMac.targets" />
@ -133,110 +118,18 @@
<Content Include="..\Common\HTML\event-log.html">
<Link>HTML\event-log.html</Link>
</Content>
<Content Include="..\Common\Pixmaps\side-splash.png">
<Link>Pixmaps\side-splash.png</Link>
</Content>
<Content Include="Pixmaps\sparkleshare-folder.icns">
<Content Include="Resources\sparkleshare-folder.icns">
<Link>sparkleshare-folder.icns</Link>
</Content>
<Content Include="Pixmaps\sparkleshare-app.icns">
<Content Include="Resources\sparkleshare-app.icns">
<Link>sparkleshare-app.icns</Link>
</Content>
<Content Include="..\Linux\Pixmaps\icons\document-added-12.png">
<Link>Pixmaps\document-added-12.png</Link>
</Content>
<Content Include="..\Linux\Pixmaps\icons\document-edited-12.png">
<Link>Pixmaps\document-edited-12.png</Link>
</Content>
<Content Include="..\Linux\Pixmaps\icons\document-deleted-12.png">
<Link>Pixmaps\document-deleted-12.png</Link>
</Content>
<Content Include="..\Linux\Pixmaps\icons\document-moved-12.png">
<Link>Pixmaps\document-moved-12.png</Link>
</Content>
<Content Include="..\Common\Pixmaps\about.png">
<Link>Pixmaps\about.png</Link>
</Content>
<Content Include="..\Common\HTML\jquery.js">
<Link>HTML\jquery.js</Link>
</Content>
<Content Include="Pixmaps\tutorial-slide-3.png">
<Link>Pixmaps\tutorial-slide-3.png</Link>
</Content>
<Content Include="..\Common\Plugins\bitbucket.xml">
<Link>Plugins\bitbucket.xml</Link>
</Content>
<Content Include="..\Common\Plugins\github.xml">
<Link>Plugins\github.xml</Link>
</Content>
<Content Include="..\Common\Plugins\gitorious.xml">
<Link>Plugins\gitorious.xml</Link>
</Content>
<Content Include="..\Common\Plugins\own-server.xml">
<Link>Plugins\own-server.xml</Link>
</Content>
<Content Include="..\Common\Plugins\bitbucket.png">
<Link>Plugins\bitbucket.png</Link>
</Content>
<Content Include="..\Common\Plugins\github.png">
<Link>Plugins\github.png</Link>
</Content>
<Content Include="..\Common\Plugins\gitorious.png">
<Link>Plugins\gitorious.png</Link>
</Content>
<Content Include="..\Common\Plugins\own-server.png">
<Link>Plugins\own-server.png</Link>
</Content>
<Content Include="..\Common\Plugins\ssnet.png">
<Link>Plugins\ssnet.png</Link>
</Content>
<Content Include="..\Common\Plugins\ssnet.xml">
<Link>Plugins\ssnet.xml</Link>
</Content>
<Content Include="Pixmaps\process-syncing-active.png" />
<Content Include="Pixmaps\process-syncing-down-active.png" />
<Content Include="Pixmaps\process-syncing-down.png" />
<Content Include="Pixmaps\process-syncing-error-active.png" />
<Content Include="Pixmaps\process-syncing-error.png" />
<Content Include="Pixmaps\process-syncing-idle-active.png" />
<Content Include="Pixmaps\process-syncing-idle.png" />
<Content Include="Pixmaps\process-syncing-up-active.png" />
<Content Include="Pixmaps\process-syncing-up.png" />
<Content Include="Pixmaps\process-syncing.png" />
<Content Include="..\Common\Pixmaps\user-icon-default.png">
<Link>Pixmaps\user-icon-default.png</Link>
</Content>
<Content Include="..\Common\Pixmaps\side-splash%402x.png">
<Link>Pixmaps\side-splash%402x.png</Link>
</Content>
<Content Include="Pixmaps\process-syncing-active%402x.png" />
<Content Include="Pixmaps\process-syncing-down-active%402x.png" />
<Content Include="Pixmaps\process-syncing-down%402x.png" />
<Content Include="Pixmaps\process-syncing-error-active%402x.png" />
<Content Include="Pixmaps\process-syncing-error%402x.png" />
<Content Include="Pixmaps\process-syncing-idle-active%402x.png" />
<Content Include="Pixmaps\process-syncing-idle%402x.png" />
<Content Include="Pixmaps\process-syncing-up-active%402x.png" />
<Content Include="Pixmaps\process-syncing-up%402x.png" />
<Content Include="Pixmaps\process-syncing%402x.png" />
<Content Include="..\Common\Pixmaps\about%402x.png">
<Link>Pixmaps\about%402x.png</Link>
</Content>
<Content Include="..\Common\Pixmaps\tutorial-slide-1.png">
<Link>Pixmaps\tutorial-slide-1.png</Link>
</Content>
<Content Include="..\Common\Pixmaps\tutorial-slide-1%402x.png">
<Link>Pixmaps\tutorial-slide-1%402x.png</Link>
</Content>
<Content Include="..\Common\Pixmaps\tutorial-slide-2.png">
<Link>Pixmaps\tutorial-slide-2.png</Link>
</Content>
<Content Include="..\Common\Pixmaps\tutorial-slide-2%402x.png">
<Link>Pixmaps\tutorial-slide-2%402x.png</Link>
</Content>
</ItemGroup>
<ItemGroup>
<Folder Include="Pixmaps\" />
<Folder Include="Resources\" />
<Folder Include="HTML\" />
<Folder Include="Plugins\" />
</ItemGroup>
@ -250,4 +143,114 @@
<Name>SparkleLib.Git</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<BundleResource Include="..\Common\Pixmaps\side-splash.png">
<Link>Resources\side-splash.png</Link>
</BundleResource>
<BundleResource Include="..\Linux\Pixmaps\icons\document-added-12.png">
<Link>Resources\document-added-12.png</Link>
</BundleResource>
<BundleResource Include="..\Linux\Pixmaps\icons\document-edited-12.png">
<Link>Resources\document-edited-12.png</Link>
</BundleResource>
<BundleResource Include="..\Linux\Pixmaps\icons\document-deleted-12.png">
<Link>Resources\document-deleted-12.png</Link>
</BundleResource>
<BundleResource Include="..\Linux\Pixmaps\icons\document-moved-12.png">
<Link>Resources\document-moved-12.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Pixmaps\about.png">
<Link>Resources\about.png</Link>
</BundleResource>
<BundleResource Include="Resources\tutorial-slide-3.png">
<Link>Resources\tutorial-slide-3.png</Link>
</BundleResource>
<BundleResource Include="Resources\process-syncing-active.png" />
<BundleResource Include="Resources\process-syncing-down-active.png" />
<BundleResource Include="Resources\process-syncing-down.png" />
<BundleResource Include="Resources\process-syncing-error-active.png" />
<BundleResource Include="Resources\process-syncing-error.png" />
<BundleResource Include="Resources\process-syncing-idle-active.png" />
<BundleResource Include="Resources\process-syncing-idle.png" />
<BundleResource Include="Resources\process-syncing-up-active.png" />
<BundleResource Include="Resources\process-syncing-up.png" />
<BundleResource Include="Resources\process-syncing.png" />
<BundleResource Include="..\Common\Pixmaps\user-icon-default.png">
<Link>Resources\user-icon-default.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Pixmaps\side-splash%402x.png">
<Link>Resources\side-splash%402x.png</Link>
</BundleResource>
<BundleResource Include="Resources\process-syncing-active%402x.png" />
<BundleResource Include="Resources\process-syncing-down-active%402x.png" />
<BundleResource Include="Resources\process-syncing-down%402x.png" />
<BundleResource Include="Resources\process-syncing-error-active%402x.png" />
<BundleResource Include="Resources\process-syncing-error%402x.png" />
<BundleResource Include="Resources\process-syncing-idle-active%402x.png" />
<BundleResource Include="Resources\process-syncing-idle%402x.png" />
<BundleResource Include="Resources\process-syncing-up-active%402x.png" />
<BundleResource Include="Resources\process-syncing-up%402x.png" />
<BundleResource Include="Resources\process-syncing%402x.png" />
<BundleResource Include="..\Common\Pixmaps\about%402x.png">
<Link>Resources\about%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Pixmaps\tutorial-slide-1.png">
<Link>Resources\tutorial-slide-1.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Pixmaps\tutorial-slide-1%402x.png">
<Link>Resources\tutorial-slide-1%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Pixmaps\tutorial-slide-2.png">
<Link>Resources\tutorial-slide-2.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Pixmaps\tutorial-slide-2%402x.png">
<Link>Resources\tutorial-slide-2%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket%402x.png">
<Link>Plugins\bitbucket%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github%402x.png">
<Link>Plugins\github%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious%402x.png">
<Link>Plugins\gitorious%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server%402x.png">
<Link>Plugins\own-server%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet%402x.png">
<Link>Plugins\ssnet%402x.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket.xml">
<Link>Plugins\bitbucket.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github.xml">
<Link>Plugins\github.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious.xml">
<Link>Plugins\gitorious.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server.xml">
<Link>Plugins\own-server.xml</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\bitbucket.png">
<Link>Plugins\bitbucket.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\github.png">
<Link>Plugins\github.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\gitorious.png">
<Link>Plugins\gitorious.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\own-server.png">
<Link>Plugins\own-server.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet.png">
<Link>Plugins\ssnet.png</Link>
</BundleResource>
<BundleResource Include="..\Common\Plugins\ssnet.xml">
<Link>Plugins\ssnet.xml</Link>
</BundleResource>
<BundleResource Include="Resources\tutorial-slide-3%402x.png" />
</ItemGroup>
</Project>

View file

@ -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");