From 69ac0bba94fd6b7de0888d35921a64e58ce7d99f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fele?= Date: Sun, 19 Nov 2023 18:35:09 +0100 Subject: [PATCH] Replace emoji:TextBlock with a default WPF textbox, so the user can select parts of the text and use it --- src/ChatPrisma/ChatPrisma.csproj | 1 - src/ChatPrisma/Themes/TextBoxStyles.xaml | 43 +++++++++++++++++++ .../Views/OpenSource/OpenSourceViewModel.cs | 1 - .../TextEnhancement/TextEnhancementView.xaml | 21 ++++----- .../TextEnhancementView.xaml.cs | 2 +- 5 files changed, 55 insertions(+), 13 deletions(-) diff --git a/src/ChatPrisma/ChatPrisma.csproj b/src/ChatPrisma/ChatPrisma.csproj index 2e49fc3..9af1aea 100644 --- a/src/ChatPrisma/ChatPrisma.csproj +++ b/src/ChatPrisma/ChatPrisma.csproj @@ -15,7 +15,6 @@ - diff --git a/src/ChatPrisma/Themes/TextBoxStyles.xaml b/src/ChatPrisma/Themes/TextBoxStyles.xaml index 7561b2d..3a490e4 100644 --- a/src/ChatPrisma/Themes/TextBoxStyles.xaml +++ b/src/ChatPrisma/Themes/TextBoxStyles.xaml @@ -56,4 +56,47 @@ + + \ No newline at end of file diff --git a/src/ChatPrisma/Views/OpenSource/OpenSourceViewModel.cs b/src/ChatPrisma/Views/OpenSource/OpenSourceViewModel.cs index e0c89d6..e1c1195 100644 --- a/src/ChatPrisma/Views/OpenSource/OpenSourceViewModel.cs +++ b/src/ChatPrisma/Views/OpenSource/OpenSourceViewModel.cs @@ -25,7 +25,6 @@ public partial class OpenSourceViewModel(IOptionsMonitor app new ThirdPartyLibrary("GlobalKeyInterceptor", new("https://github.com/arcanexhoax/GlobalKeyInterceptor"), "MIT", new Uri("https://github.com/arcanexhoax/GlobalKeyInterceptor/blob/main/LICENSE")), new ThirdPartyLibrary("NLog", new("https://nlog-project.org/"), "BSD 3-Clause", new Uri("https://github.com/NLog/NLog/blob/dev/LICENSE.txt")), new ThirdPartyLibrary("Hardcodet WPF NotifyIcon", new("https://github.com/hardcodet/wpf-notifyicon"), "CPOL", new Uri("https://github.com/hardcodet/wpf-notifyicon/blob/develop/LICENSE")), - new ThirdPartyLibrary("Emoji.Wpf", new("https://github.com/samhocevar/emoji.wpf"), "WTFPL", new Uri("https://github.com/samhocevar/emoji.wpf/blob/main/COPYING")), new ThirdPartyLibrary("DevExpress.Mvvm", new("https://github.com/DevExpress/DevExpress.Mvvm.Free"), "MIT", new Uri("https://github.com/DevExpress/DevExpress.Mvvm.Free/blob/main/LICENSE")), new ThirdPartyLibrary("Nerdbank.GitVersioning", new("https://github.com/dotnet/Nerdbank.GitVersioning"), "MIT", new Uri("https://github.com/dotnet/Nerdbank.GitVersioning/blob/main/LICENSE")), new ThirdPartyLibrary("SingleInstanceCore", new("https://github.com/soheilkd/SingleInstanceCore"), "MIT", new Uri("https://github.com/soheilkd/SingleInstanceCore/blob/master/LICENSE")), diff --git a/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml b/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml index 53ae526..c5ac985 100644 --- a/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml +++ b/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml @@ -2,7 +2,6 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:ChatPrisma.Views.TextEnhancement" - xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf" xmlns:themes="clr-namespace:ChatPrisma.Themes" xmlns:wpf="clr-namespace:FluentIcons.WPF;assembly=FluentIcons.WPF" @@ -77,15 +76,17 @@ - - - 0, 8, 0, 10 - - + + + 0, 4, 0, 6 + + diff --git a/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml.cs b/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml.cs index 030ee2c..9bc001e 100644 --- a/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml.cs +++ b/src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml.cs @@ -86,7 +86,7 @@ private void ViewModelOnApplyInstructionCancelled(object? sender, EventArgs e) this.InstructionTextBox.Select(this.InstructionTextBox.Text.Length, 0); } - private void TextTextBlock_OnSizeChanged(object sender, SizeChangedEventArgs e) + private void TextTextBox_OnSizeChanged(object sender, SizeChangedEventArgs e) { // Keep the ScrollViewer scrolled to the bottom while the text is generating this.ScrollToBottom();