setup: add more helpful help label to address field

This commit is contained in:
Hylke Bons 2012-02-14 20:39:09 +01:00
parent 41ea97c927
commit 9dee454773
3 changed files with 17 additions and 5 deletions

View file

@ -48,6 +48,7 @@ namespace SparkleShare {
private NSTextField FullNameLabel;
private NSTextField AddressTextField;
private NSTextField AddressLabel;
private NSTextField AddressHelpLabel;
private NSTextField PathTextField;
private NSTextField PathLabel;
private NSTextField PathHelpLabel;
@ -215,6 +216,17 @@ namespace SparkleShare {
("Lucida Grande", NSFontTraitMask.Condensed, 0, 11)
};
AddressHelpLabel = new NSTextField () {
BackgroundColor = NSColor.WindowBackground,
Bordered = false,
TextColor = NSColor.DisabledControlText,
Editable = false,
Frame = new RectangleF (190, Frame.Height - 355, 204, 17),
StringValue = "e.g. rupert/website-design",
Font = NSFontManager.SharedFontManager.FontWithFamily
("Lucida Grande", NSFontTraitMask.Condensed, 0, 11)
};
TableView = new NSTableView () {
Frame = new RectangleF (0, 0, 0, 0),
@ -265,6 +277,7 @@ namespace SparkleShare {
InvokeOnMainThread (delegate {
AddressTextField.StringValue = text;
AddressTextField.Enabled = (state == FieldState.Enabled);
AddressHelpLabel.StringValue = example_text;
});
};
@ -275,9 +288,7 @@ namespace SparkleShare {
InvokeOnMainThread (delegate {
PathTextField.StringValue = text;
PathTextField.Enabled = (state == FieldState.Enabled);
if (!string.IsNullOrEmpty (example_text))
PathHelpLabel.StringValue = "e.g. " + example_text;
PathHelpLabel.StringValue = example_text;
});
};
@ -322,6 +333,7 @@ namespace SparkleShare {
ContentView.AddSubview (ScrollView);
ContentView.AddSubview (AddressLabel);
ContentView.AddSubview (AddressTextField);
ContentView.AddSubview (AddressHelpLabel);
ContentView.AddSubview (PathLabel);
ContentView.AddSubview (PathTextField);
ContentView.AddSubview (PathHelpLabel);

View file

@ -208,6 +208,7 @@ namespace SparkleShare {
path_entry.Text = text;
path_entry.Sensitive = (state == FieldState.Enabled);
// TODO: Use small labels like the mac UI
if (string.IsNullOrEmpty (example_text))
path_entry.ExampleText = null;
else

View file

@ -9,7 +9,7 @@
</info>
<address>
<value></value>
<example>domain name or IP address</example>
<example>[user@]hostname[:port]</example>
</address>
<path>
<value></value>
@ -17,4 +17,3 @@
</path>
</plugin>
</sparkleshare>