Merge branch 'yosemite'

This commit is contained in:
Hylke Bons 2014-11-06 21:19:52 +00:00
commit 1f476dcaed
7 changed files with 50 additions and 75 deletions

View file

@ -1,6 +1,7 @@
1.5.0 for Linux, Mac and Windows (???):
Hylke
- Mac UI updates to integrate well with Yosemite
- Per folder sync status in icon menu
- Add ability to pause sync and add a commit message on resume
- Remove dock icon on Mac and force windows on top

View file

@ -92,31 +92,24 @@ namespace SparkleShare {
this.version_text_field = new SparkleLabel ("version " + Controller.RunningVersion, NSTextAlignment.Left) {
DrawsBackground = false,
Frame = new RectangleF (295, 140, 318, 22),
TextColor = NSColor.White,
Font = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11)
TextColor = NSColor.White
};
this.updates_text_field = new SparkleLabel ("Checking for updates...", NSTextAlignment.Left) {
DrawsBackground = false,
Frame = new RectangleF (295, Frame.Height - 232, 318, 98),
TextColor = NSColor.FromCalibratedRgba (1.0f, 1.0f, 1.0f, 0.5f),
Font = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11)
TextColor = NSColor.FromCalibratedRgba (1.0f, 1.0f, 1.0f, 0.5f)
};
this.credits_text_field = new SparkleLabel (
@"Copyright © 2010" + DateTime.Now.Year + " Hylke Bons and others." +
"\n" +
"\n" +
"SparkleShare is Open Source software. You are free to use, modify, and redistribute it " +
"under the GNU General Public License version 3 or later.", NSTextAlignment.Left) {
"\n\n" +
"SparkleShare is Open Source. You are free to use, modify, and redistribute it " +
"under the GNU GPLv3.", NSTextAlignment.Left) {
DrawsBackground = false,
Frame = new RectangleF (295, Frame.Height - 260, 318, 98),
TextColor = NSColor.White,
Font = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Unbold, 0, 11),
TextColor = NSColor.White
};
this.website_link = new SparkleLink ("Website", Controller.WebsiteLinkAddress);
@ -198,7 +191,7 @@ namespace SparkleShare {
Selectable = false;
NSData name_data = NSData.FromString ("<a href='" + this.url +
"' style='font-size: 8pt; font-family: \"Lucida Grande\"; color: #739ECF'>" + text + "</a></font>");
"' style='font-size: 9pt; font-family: \"Helvetica Neue\"; color: #739ECF'>" + text + "</a></font>");
NSDictionary name_dictionary = new NSDictionary();
NSAttributedString name_attributes = new NSAttributedString (name_data, new NSUrl ("file://"), out name_dictionary);

View file

@ -101,10 +101,9 @@ namespace SparkleShare {
Bordered = false,
Editable = false,
Frame = new RectangleF (
new PointF (0, ContentView.Frame.Height - 30),
new PointF (0, ContentView.Frame.Height - 31),
new SizeF (60, 20)),
StringValue = "Size:",
Font = SparkleUI.BoldFont
StringValue = "Size:"
};
this.size_label_value = new NSTextField () {
@ -113,10 +112,10 @@ namespace SparkleShare {
Bordered = false,
Editable = false,
Frame = new RectangleF (
new PointF (60, ContentView.Frame.Height - 30),
new PointF (60, ContentView.Frame.Height - 27),
new SizeF (60, 20)),
StringValue = "…",
Font = SparkleUI.Font
Font = NSFont.FromFontName (SparkleUI.FontName + " Bold", NSFont.SystemFontSize)
};
@ -126,10 +125,9 @@ namespace SparkleShare {
Bordered = false,
Editable = false,
Frame = new RectangleF (
new PointF (130, ContentView.Frame.Height - 30),
new PointF (130, ContentView.Frame.Height - 31),
new SizeF (60, 20)),
StringValue = "History:",
Font = SparkleUI.BoldFont
StringValue = "History:"
};
this.history_label_value = new NSTextField () {
@ -138,11 +136,11 @@ namespace SparkleShare {
Bordered = false,
Editable = false,
Frame = new RectangleF (
new PointF (190, ContentView.Frame.Height - 30),
new PointF (190, ContentView.Frame.Height - 27),
new SizeF (60, 20)
),
StringValue = "…",
Font = SparkleUI.Font
Font = NSFont.FromFontName (SparkleUI.FontName + " Bold", NSFont.SystemFontSize)
};
this.popup_button = new NSPopUpButton () {
@ -267,7 +265,7 @@ namespace SparkleShare {
this.size_label.Frame.Size);
this.size_label_value.Frame = new RectangleF (
new PointF (this.size_label_value.Frame.X, new_window_size.Height - TitlebarHeight - 30),
new PointF (this.size_label_value.Frame.X, new_window_size.Height - TitlebarHeight - 27),
this.size_label_value.Frame.Size);
this.history_label.Frame = new RectangleF (
@ -275,7 +273,7 @@ namespace SparkleShare {
this.history_label.Frame.Size);
this.history_label_value.Frame = new RectangleF (
new PointF (this.history_label_value.Frame.X, new_window_size.Height - TitlebarHeight - 30),
new PointF (this.history_label_value.Frame.X, new_window_size.Height - TitlebarHeight - 27),
this.history_label_value.Frame.Size);
this.progress_indicator.Frame = new RectangleF (
@ -297,10 +295,6 @@ namespace SparkleShare {
if (folders == null)
folders = Controller.Folders;
this.popup_button.Cell.ControlSize = NSControlSize.Small;
this.popup_button.Font = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Condensed, 0, NSFont.SmallSystemFontSize);
this.popup_button.RemoveAllItems ();
this.popup_button.AddItem ("Summary");
@ -333,14 +327,14 @@ namespace SparkleShare {
{
string pixmaps_path = "file://" + NSBundle.MainBundle.ResourcePath;
html = html.Replace ("<!-- $body-font-family -->", "Lucida Grande");
html = html.Replace ("<!-- $body-font-family -->", "Helvetica Neue");
html = html.Replace ("<!-- $day-entry-header-font-size -->", "13.6px");
html = html.Replace ("<!-- $body-font-size -->", "13.4px");
html = html.Replace ("<!-- $secondary-font-color -->", "#bbb");
html = html.Replace ("<!-- $small-color -->", "#ddd");
html = html.Replace ("<!-- $small-font-size -->", "10px");
html = html.Replace ("<!-- $day-entry-header-background-color -->", "#f5f5f5");
html = html.Replace ("<!-- $a-color -->", "#0085cf");
html = html.Replace ("<!-- $a-color -->", "#009ff8");
html = html.Replace ("<!-- $a-hover-color -->", "#009ff8");
html = html.Replace ("<!-- $pixmaps-path -->", pixmaps_path);
html = html.Replace ("<!-- $document-added-background-image -->", pixmaps_path + "/document-added-12.png");

View file

@ -97,10 +97,10 @@ namespace SparkleShare {
Bordered = false,
Editable = false,
Frame = new RectangleF (
new PointF (85, ContentView.Frame.Height - 42),
new SizeF (320, 20)),
new PointF (85, ContentView.Frame.Height - 41),
new SizeF (320, 22)),
StringValue = Program.Controller.CurrentUser.Name,
Font = SparkleUI.BoldFont
Font = NSFont.FromFontName (SparkleUI.FontName + " Bold", NSFont.SystemFontSize)
};
this.user_email_text_field = new NSTextField () {
@ -113,7 +113,6 @@ namespace SparkleShare {
new PointF (85, ContentView.Frame.Height - 60),
new SizeF (320, 20)),
StringValue = Program.Controller.CurrentUser.Email,
Font = SparkleUI.Font
};
@ -138,14 +137,12 @@ namespace SparkleShare {
Title = "Cancel",
BezelStyle = NSBezelStyle.Rounded,
Frame = new RectangleF (Frame.Width - 15 - 105 * 2, 12, 105, 32),
Font = SparkleUI.Font
};
this.sync_button = new NSButton () {
Title = "Sync",
BezelStyle = NSBezelStyle.Rounded,
Frame = new RectangleF (Frame.Width - 15 - 105, 12, 105, 32),
Font = SparkleUI.Font
};
this.cancel_button.Activated += delegate { Controller.CancelClicked (); };

View file

@ -145,19 +145,20 @@ namespace SparkleShare {
Description = "Do you want to add this project to SparkleShare?";
AddressLabel = new SparkleLabel ("Address:", NSTextAlignment.Right);
AddressLabel.Frame = new RectangleF (165, Frame.Height - 240, 160, 17);
AddressLabel.Frame = new RectangleF (165, Frame.Height - 238, 160, 17);
AddressLabel.Font = NSFont.FromFontName (SparkleUI.FontName + " Bold", NSFont.SystemFontSize);
AddressTextField = new SparkleLabel (Controller.PendingInvite.Address, NSTextAlignment.Left) {
Frame = new RectangleF (330, Frame.Height - 240, 260, 17),
Font = SparkleUI.BoldFont
Frame = new RectangleF (330, Frame.Height - 240, 260, 17)
};
PathLabel = new SparkleLabel ("Remote Path:", NSTextAlignment.Right);
PathLabel.Frame = new RectangleF (165, Frame.Height - 264, 160, 17);
PathLabel.Frame = new RectangleF (165, Frame.Height - 262, 160, 17);
PathLabel.Font = NSFont.FromFontName (SparkleUI.FontName + " Bold", NSFont.SystemFontSize);
PathTextField = new SparkleLabel (Controller.PendingInvite.RemotePath, NSTextAlignment.Left) {
Frame = new RectangleF (330, Frame.Height - 264, 260, 17),
Font = SparkleUI.BoldFont
Frame = new RectangleF (330, Frame.Height - 264, 260, 17)
};
CancelButton = new NSButton () { Title = "Cancel" };
@ -183,12 +184,11 @@ namespace SparkleShare {
AddressLabel = new SparkleLabel ("Address:", NSTextAlignment.Left) {
Frame = new RectangleF (190, Frame.Height - 308, 160, 17),
Font = SparkleUI.BoldFont
Font = NSFont.FromFontName (SparkleUI.FontName + " Bold", NSFont.SystemFontSize)
};
AddressTextField = new NSTextField () {
Frame = new RectangleF (190, Frame.Height - 336, 196, 22),
Font = SparkleUI.Font,
Enabled = (Controller.SelectedPlugin.Address == null),
Delegate = new SparkleTextFieldDelegate (),
StringValue = "" + Controller.PreviousAddress
@ -198,7 +198,7 @@ namespace SparkleShare {
PathLabel = new SparkleLabel ("Remote Path:", NSTextAlignment.Left) {
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 308, 160, 17),
Font = SparkleUI.BoldFont
Font = NSFont.FromFontName (SparkleUI.FontName + " Bold", NSFont.SystemFontSize)
};
PathTextField = new NSTextField () {
@ -212,22 +212,18 @@ namespace SparkleShare {
PathHelpLabel = new SparkleLabel (Controller.SelectedPlugin.PathExample, NSTextAlignment.Left) {
TextColor = NSColor.DisabledControlText,
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 355, 204, 17),
Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
NSFontTraitMask.Condensed, 0, 11),
Frame = new RectangleF (190 + 196 + 16, Frame.Height - 358, 204, 19)
};
AddressHelpLabel = new SparkleLabel (Controller.SelectedPlugin.AddressExample, NSTextAlignment.Left) {
TextColor = NSColor.DisabledControlText,
Frame = new RectangleF (190, Frame.Height - 355, 204, 17),
Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
NSFontTraitMask.Condensed, 0, 11),
Frame = new RectangleF (190, Frame.Height - 358, 204, 19)
};
if (TableView == null || TableView.RowCount != Controller.Plugins.Count) {
TableView = new NSTableView () {
Frame = new RectangleF (0, 0, 0, 0),
RowHeight = 34,
RowHeight = 38,
IntercellSpacing = new SizeF (8, 12),
HeaderView = null,
Delegate = new SparkleTableViewDelegate ()
@ -252,8 +248,8 @@ namespace SparkleShare {
Editable = false
};
DescriptionColumn.DataCell.Font = NSFontManager.SharedFontManager.FontWithFamily ("Lucida Grande",
NSFontTraitMask.Condensed, 0, 11);
DescriptionColumn.DataCell.Font = NSFontManager.SharedFontManager.FontWithFamily (
SparkleUI.FontName, NSFontTraitMask.Condensed, 0, 11);
TableView.AddColumn (IconColumn);
TableView.AddColumn (DescriptionColumn);
@ -407,7 +403,7 @@ namespace SparkleShare {
string html = "<style>" +
"* {" +
" font-family: 'Lucida Grande';" +
" font-family: '" + SparkleUI.FontName + " Bold" + "';" +
" font-size: 12px; cursor: default;" +
"}" +
"body {" +
@ -473,8 +469,8 @@ namespace SparkleShare {
extra_pos_y = 20;
PasswordLabel = new SparkleLabel ("Password:", NSTextAlignment.Right) {
Frame = new RectangleF (155, Frame.Height - 204 - extra_pos_y, 160, 17),
Font = SparkleUI.BoldFont
Frame = new RectangleF (155, Frame.Height - 202 - extra_pos_y, 160, 17),
Font = NSFont.FromFontName (SparkleUI.FontName + " Bold", NSFont.SystemFontSize)
};
PasswordTextField = new NSSecureTextField () {
@ -748,14 +744,14 @@ namespace SparkleShare {
NSTextFieldCell cell = new NSTextFieldCell ();
NSData name_data = NSData.FromString ("<font face='Lucida Grande'><b>" + plugin.Name + "</b></font>");
NSData name_data = NSData.FromString ("<font face='" + SparkleUI.FontName + "'><b>" + plugin.Name + "</b></font>");
NSDictionary name_dictionary = new NSDictionary();
NSAttributedString name_attributes = new NSAttributedString (
name_data, new NSUrl ("file://"), out name_dictionary);
NSData description_data = NSData.FromString (
"<small><font style='line-height: 150%' color='#aaa' face='Lucida Grande'>" + plugin.Description + "</font></small>");
"<small><font style='line-height: 150%' color='#aaa' face='" + SparkleUI.FontName + "'>" + plugin.Description + "</font></small>");
NSDictionary description_dictionary = new NSDictionary();
NSAttributedString description_attributes = new NSAttributedString (
@ -771,14 +767,14 @@ namespace SparkleShare {
NSTextFieldCell selected_cell = new NSTextFieldCell ();
NSData selected_name_data = NSData.FromString (
"<font color='white' face='Lucida Grande'><b>" + plugin.Name + "</b></font>");
"<font color='white' face='" + SparkleUI.FontName +"'><b>" + plugin.Name + "</b></font>");
NSDictionary selected_name_dictionary = new NSDictionary ();
NSAttributedString selected_name_attributes = new NSAttributedString (
selected_name_data, new NSUrl ("file://"), out selected_name_dictionary);
NSData selected_description_data = NSData.FromString (
"<small><font style='line-height: 150%' color='#9bbaeb' face='Lucida Grande'>" +
"<small><font style='line-height: 150%' color='#9bbaeb' face='" + SparkleUI.FontName + "'>" +
plugin.Description + "</font></small>");
NSDictionary selected_description_dictionary = new NSDictionary ();
@ -877,7 +873,6 @@ namespace SparkleShare {
BackgroundColor = NSColor.WindowBackground;
Bordered = false;
Editable = false;
Font = SparkleUI.Font;
}
}
}

View file

@ -62,13 +62,11 @@ namespace SparkleShare {
this.header_text_field = new SparkleLabel ("", NSTextAlignment.Left) {
Frame = new RectangleF (190, Frame.Height - 80, Frame.Width, 24),
Font = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Bold, 0, 15),
SparkleUI.FontName, NSFontTraitMask.Bold, 0, 16)
};
this.description_text_field = new SparkleLabel ("", NSTextAlignment.Left) {
Frame = new RectangleF (190, Frame.Height - 130, 640 - 240, 44),
Font = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Condensed, 0, 13)
Frame = new RectangleF (190, Frame.Height - 130, 640 - 240, 44)
};
this.header_text_field.Cell.LineBreakMode = NSLineBreakMode.TruncatingTail;
@ -106,7 +104,6 @@ namespace SparkleShare {
foreach (NSButton button in Buttons) {
button.BezelStyle = NSBezelStyle.Rounded;
button.Frame = new RectangleF (Frame.Width - 15 - x - (105 * i), 12, 105, 32);
button.Font = SparkleUI.Font;
// Make the button a bit wider if the text is likely to be longer
if (button.Title.Contains (" ")) {

View file

@ -30,16 +30,14 @@ namespace SparkleShare {
public SparkleBubbles Bubbles;
public SparkleAbout About;
public SparkleNote Note;
public static NSFont Font = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Condensed, 0, 13);
public static NSFont BoldFont = NSFontManager.SharedFontManager.FontWithFamily (
"Lucida Grande", NSFontTraitMask.Bold, 0, 13);
public static string FontName = "Helvetica Neue";
public SparkleUI ()
{
if (Environment.OSVersion.Version.Major < 14)
FontName = "Lucida Grande";
Program.Controller.Invoke (() => {
NSWorkspace.SharedWorkspace.SetIconforFile (
NSImage.ImageNamed ("sparkleshare-folder.icns"), Program.Controller.FoldersPath, 0);