windows about: add website links. #832
This commit is contained in:
parent
7e3140c1ad
commit
b4aee6e93e
|
@ -16,8 +16,10 @@
|
||||||
|
|
||||||
|
|
||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
|
using System.Windows.Input;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
|
@ -41,12 +43,10 @@ namespace SparkleShare {
|
||||||
Icon = SparkleUIHelpers.GetImageSource("sparkleshare-app", "ico");
|
Icon = SparkleUIHelpers.GetImageSource("sparkleshare-app", "ico");
|
||||||
|
|
||||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||||
|
|
||||||
Closing += Close;
|
Closing += Close;
|
||||||
|
|
||||||
CreateAbout ();
|
CreateAbout ();
|
||||||
|
|
||||||
|
|
||||||
Controller.ShowWindowEvent += delegate {
|
Controller.ShowWindowEvent += delegate {
|
||||||
Dispatcher.BeginInvoke ((Action) delegate {
|
Dispatcher.BeginInvoke ((Action) delegate {
|
||||||
Show ();
|
Show ();
|
||||||
|
@ -117,7 +117,10 @@ namespace SparkleShare {
|
||||||
Width = 318
|
Width = 318
|
||||||
};
|
};
|
||||||
|
|
||||||
|
SparkleLink website_link = new SparkleLink ("Website", Controller.WebsiteLinkAddress);
|
||||||
|
SparkleLink credits_link = new SparkleLink ("Credits", Controller.CreditsLinkAddress);
|
||||||
|
SparkleLink report_problem_link = new SparkleLink ("Report a problem", Controller.ReportProblemLinkAddress);
|
||||||
|
|
||||||
Canvas canvas = new Canvas ();
|
Canvas canvas = new Canvas ();
|
||||||
|
|
||||||
canvas.Children.Add (image);
|
canvas.Children.Add (image);
|
||||||
|
@ -134,7 +137,19 @@ namespace SparkleShare {
|
||||||
|
|
||||||
canvas.Children.Add (credits);
|
canvas.Children.Add (credits);
|
||||||
Canvas.SetLeft (credits, 294);
|
Canvas.SetLeft (credits, 294);
|
||||||
Canvas.SetTop (credits, 142);
|
Canvas.SetTop (credits, 142);
|
||||||
|
|
||||||
|
canvas.Children.Add (website_link);
|
||||||
|
Canvas.SetLeft (website_link, 289);
|
||||||
|
Canvas.SetTop (website_link, 222);
|
||||||
|
|
||||||
|
canvas.Children.Add (credits_link);
|
||||||
|
Canvas.SetLeft (credits_link, 289 + website_link.ActualWidth + 60);
|
||||||
|
Canvas.SetTop (credits_link, 222);
|
||||||
|
|
||||||
|
canvas.Children.Add (report_problem_link);
|
||||||
|
Canvas.SetLeft (report_problem_link, 289 + website_link.ActualWidth + credits_link.ActualWidth + 115);
|
||||||
|
Canvas.SetTop (report_problem_link, 222);
|
||||||
|
|
||||||
Content = canvas;
|
Content = canvas;
|
||||||
}
|
}
|
||||||
|
@ -146,4 +161,34 @@ namespace SparkleShare {
|
||||||
args.Cancel = true;
|
args.Cancel = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public class SparkleLink : Label {
|
||||||
|
|
||||||
|
public SparkleLink (string title, string address)
|
||||||
|
{
|
||||||
|
FontSize = 11;
|
||||||
|
Cursor = Cursors.Hand;
|
||||||
|
Foreground = new SolidColorBrush (Color.FromRgb (135, 178, 227));
|
||||||
|
|
||||||
|
TextDecoration underline = new TextDecoration () {
|
||||||
|
Pen = new Pen (new SolidColorBrush (Color.FromRgb (135, 178, 227)), 1),
|
||||||
|
PenThicknessUnit = TextDecorationUnit.FontRecommended
|
||||||
|
};
|
||||||
|
|
||||||
|
TextDecorationCollection collection = new TextDecorationCollection ();
|
||||||
|
collection.Add (underline);
|
||||||
|
|
||||||
|
TextBlock text_block = new TextBlock () {
|
||||||
|
Text = title,
|
||||||
|
TextDecorations = collection
|
||||||
|
};
|
||||||
|
|
||||||
|
Content = text_block;
|
||||||
|
|
||||||
|
MouseUp += delegate {
|
||||||
|
Process.Start (new ProcessStartInfo (address));
|
||||||
|
};
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue