Fix Linux and Mac icon paths in html

This commit is contained in:
Hylke Bons 2012-03-11 03:06:13 +00:00
parent 5c683189f4
commit ff63f75557
2 changed files with 30 additions and 27 deletions

View file

@ -229,6 +229,10 @@ namespace SparkleShare {
if (html == null)
return;
string pixmaps_path = Path.Combine (SparkleUI.AssetsPath, "pixmaps");
string icons_path = new string [] {SparkleUI.AssetsPath, "icons",
"hicolor", "12x12", "status"}.Combine ()
html = html.Replace ("<!-- $body-font-size -->", (double) (Style.FontDescription.Size / 1024 + 3) + "px");
html = html.Replace ("<!-- $day-entry-header-font-size -->", (Style.FontDescription.Size / 1024 + 3) + "px");
@ -240,21 +244,21 @@ namespace SparkleShare {
html = html.Replace ("<!-- $day-entry-header-background-color -->", SparkleUIHelpers.GdkColorToHex (Style.Background (StateType.Normal)));
html = html.Replace ("<!-- $secondary-font-color -->", SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive)));
html = html.Replace ("<!-- $small-color -->", SparkleUIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive)));
html = html.Replace ("<!-- $pixmaps-path -->", "file://" +
new string [] {SparkleUI.AssetsPath, "pixmaps"}.Combine ());
html = html.Replace ("<!-- $document-added-background-image -->", "file://" +
new string [] {SparkleUI.AssetsPath, "icons",
"hicolor", "12x12", "status", "document-added.png"}.Combine ());
html = html.Replace ("<!-- $document-edited-background-image -->", "file://" +
new string [] {SparkleUI.AssetsPath, "icons",
"hicolor", "12x12", "status", "document-edited.png"}.Combine ());
html = html.Replace ("<!-- $document-deleted-background-image -->", "file://" +
new string [] {SparkleUI.AssetsPath, "icons",
"hicolor", "12x12", "status", "document-deleted.png"}.Combine ());
html = html.Replace ("<!-- $document-moved-background-image -->", "file://" +
new string [] {SparkleUI.AssetsPath, "icons",
"hicolor", "12x12", "status", "document-moved.png"}.Combine ());
html = html.Replace ("<!-- $pixmaps-path -->", pixmaps_path);
html = html.Replace ("<!-- $document-added-background-image -->",
"file://" + Path.Combine (icons_path + "document-added.png"));
html = html.Replace ("<!-- $document-edited-background-image -->",
"file://" + Path.Combine (icons_path + "document-edited.png"));
html = html.Replace ("<!-- $document-deleted-background-image -->",
"file://" + Path.Combine (icons_path + "document-deleted.png"));
html = html.Replace ("<!-- $document-moved-background-image -->",
"file://" + Path.Combine (icons_path + "document-moved.png"));
Application.Invoke (delegate {
this.spinner.Stop ();

View file

@ -280,6 +280,9 @@ namespace SparkleShare {
if (html == null)
html = Controller.HTML;
string pixmaps_path = Path.Combine (
NSBundle.MainBundle.ResourcePath, "Pixmaps");
html = html.Replace ("<!-- $body-font-family -->", "Lucida Grande");
html = html.Replace ("<!-- $day-entry-header-font-size -->", "13.6px");
html = html.Replace ("<!-- $body-font-size -->", "13.4px");
@ -288,26 +291,22 @@ namespace SparkleShare {
html = html.Replace ("<!-- $day-entry-header-background-color -->", "#f5f5f5");
html = html.Replace ("<!-- $a-color -->", "#0085cf");
html = html.Replace ("<!-- $a-hover-color -->", "#009ff8");
html = html.Replace ("<!-- $pixmaps-path -->",
"file://" + Path.Combine (NSBundle.MainBundle.ResourcePath,
"Pixmaps"));
html = html.Replace ("<!-- $pixmaps-path -->", pixmaps_path);
html = html.Replace ("<!-- $document-added-background-image -->",
"file://" + Path.Combine (NSBundle.MainBundle.ResourcePath,
"Pixmaps", "document-added-12.png"));
pixmaps_path + "/document-added-12.png"));
html = html.Replace ("<!-- $document-deleted-background-image -->",
"file://" + Path.Combine (NSBundle.MainBundle.ResourcePath,
"Pixmaps", "document-deleted-12.png"));
pixmaps_path + "/document-deleted-12.png"));
html = html.Replace ("<!-- $document-edited-background-image -->",
"file://" + Path.Combine (NSBundle.MainBundle.ResourcePath,
"Pixmaps", "document-edited-12.png"));
pixmaps_path + "/document-edited-12.png"));
html = html.Replace ("<!-- $document-moved-background-image -->",
"file://" + Path.Combine (NSBundle.MainBundle.ResourcePath,
"Pixmaps", "document-moved-12.png"));
pixmaps_path + "/document-moved-12.png"));
InvokeOnMainThread (delegate {
if (this.progress_indicator.Superview == ContentView)
this.progress_indicator.RemoveFromSuperview ();