mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-08 04:07:40 +02:00
[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 commit8b2812e2de. * Revert "Fixed wrapping for KBM subtitle textblock" This reverts commitaa9ec54121. * Revert "Updated adaptive trigger behavior" This reverts commite6f4ed27a1. * 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:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user