[Launcher] ReportWindow redesign and theming support (#5790)

* Updated adaptive trigger behavior

* Fixed wrapping for KBM subtitle textblock

* Fix

* Theme support for ReportWindow

* Fix

* Fix

* Spacing issue fix

* Revert "Fix"

This reverts commit 8b2812e2de.

* Revert "Fixed wrapping for KBM subtitle textblock"

This reverts commit aa9ec54121.

* Revert "Updated adaptive trigger behavior"

This reverts commit e6f4ed27a1.

* Update ReportWindow.xaml.cs

* Update ReportWindow.xaml.cs

* Update ReportWindow.xaml.cs

* Removed redundant code, fixed trailing issue

Co-authored-by: Niels Laute <niels9001@hotmail.com>
This commit is contained in:
Niels Laute
2020-08-17 22:48:54 +02:00
committed by GitHub
parent 8f8b200f24
commit dad8cbecc1
3 changed files with 64 additions and 34 deletions

View File

@@ -40,17 +40,14 @@ namespace PowerLauncher
var directory = new DirectoryInfo(path);
var log = directory.GetFiles().OrderByDescending(f => f.LastWriteTime).First();
var paragraph = Hyperlink("Please open new issue in: ", Constant.Issue);
paragraph.Inlines.Add($"1. upload log file: {log.FullName}\n");
paragraph.Inlines.Add($"2. copy below exception message");
ErrorTextbox.Document.Blocks.Add(paragraph);
LogFilePathBox.Text = log.FullName;
StringBuilder content = new StringBuilder();
content.AppendLine(ErrorReporting.RuntimeInfo());
content.AppendLine($"Date: {DateTime.Now.ToString(CultureInfo.InvariantCulture)}");
content.AppendLine("Exception:");
content.AppendLine(exception.ToString());
paragraph = new Paragraph();
var paragraph = new Paragraph();
paragraph.Inlines.Add(content.ToString());
ErrorTextbox.Document.Blocks.Add(paragraph);
}
@@ -78,31 +75,14 @@ namespace PowerLauncher
}
}
private static void LinkOnRequestNavigate(object sender, RequestNavigateEventArgs e)
private void RepositoryHyperlink_Click(object sender, RoutedEventArgs e)
{
var ps = new ProcessStartInfo(e.Uri.ToString())
var ps = new ProcessStartInfo((sender as Hyperlink).NavigateUri.ToString())
{
UseShellExecute = true,
Verb = "open",
};
Process.Start(ps);
}
private static Paragraph Hyperlink(string textBeforeUrl, string url)
{
var paragraph = new Paragraph();
paragraph.Margin = new Thickness(0);
var link = new Hyperlink { IsEnabled = true };
link.Inlines.Add(url);
link.NavigateUri = new Uri(url);
link.RequestNavigate += LinkOnRequestNavigate;
paragraph.Inlines.Add(textBeforeUrl);
paragraph.Inlines.Add(link);
paragraph.Inlines.Add("\n");
return paragraph;
}
}
}