windows about: add website links. #832
This commit is contained in:
parent
7e3140c1ad
commit
b4aee6e93e
|
@ -17,7 +17,9 @@
|
|||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Media;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
@ -41,12 +43,10 @@ namespace SparkleShare {
|
|||
Icon = SparkleUIHelpers.GetImageSource("sparkleshare-app", "ico");
|
||||
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen;
|
||||
|
||||
Closing += Close;
|
||||
|
||||
CreateAbout ();
|
||||
|
||||
|
||||
Controller.ShowWindowEvent += delegate {
|
||||
Dispatcher.BeginInvoke ((Action) delegate {
|
||||
Show ();
|
||||
|
@ -117,6 +117,9 @@ namespace SparkleShare {
|
|||
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 ();
|
||||
|
||||
|
@ -136,6 +139,18 @@ namespace SparkleShare {
|
|||
Canvas.SetLeft (credits, 294);
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -146,4 +161,34 @@ namespace SparkleShare {
|
|||
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