Skip to content

Commit

Permalink
Improve TextEnhancementView.xaml to have a button to accept the text
Browse files Browse the repository at this point in the history
  • Loading branch information
haefele committed Nov 16, 2023
1 parent 5913e75 commit 09220d3
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/ChatPrisma/Themes/CheckBoxStyles.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

<!-- This is the content presenter for additional content like text -->
<ContentPresenter Grid.Column="0"
Margin="0, 0, 3, 0"
VerticalAlignment="Center"
Content="{TemplateBinding Content}"/>

Expand Down
37 changes: 31 additions & 6 deletions src/ChatPrisma/Views/TextEnhancement/TextEnhancementView.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
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"

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
Expand All @@ -24,12 +25,13 @@
<GroupBox.HeaderTemplate>
<DataTemplate>
<Grid>
<TextBlock Text="Text" />
<StackPanel HorizontalAlignment="Left"
Orientation="Horizontal">
<TextBlock Text="Text" />

<Grid IsEnabled="{DXBinding '!ApplyInstructionCommand.IsRunning'}"
HorizontalAlignment="Right">
<themes:Stepper Height="24"
Margin="0, -2"
Margin="7, -2, 0, -2"
IsEnabled="{DXBinding '!ApplyInstructionCommand.IsRunning'}"
PreviousCommand="{Binding PreviousVersionCommand}"
Value="{Binding CurrentVersion}"
NextCommand="{Binding NextVersionCommand}">
Expand All @@ -45,10 +47,33 @@
</TextBlock>
</themes:Stepper.ToolTip>
</themes:Stepper>
</Grid>
</StackPanel>

<StackPanel HorizontalAlignment="Right"
Orientation="Horizontal"
TextBlock.FontSize="12"
TextBlock.FontWeight="Normal">
<CheckBox IsChecked="{Binding AutoPaste, UpdateSourceTrigger=PropertyChanged}"
Content="auto. einfügen"
ToolTip="Wenn angehakt, wird der Text automatisch in der vorherigen Anwendung eingefügt."/>

<Button Margin="5, -5, 0, -5" Command="{Binding AcceptTextCommand}"
Width="24"
Height="24">
<Button.ToolTip>
<TextBlock>
<Run Text="Den Text akzeptieren und in die Zwischenablage kopieren." /> <LineBreak />
<Run Text="STRG+Enter" />
</TextBlock>
</Button.ToolTip>
<wpf:SymbolIcon Symbol="ArrowRight"
Margin="-5"/>
</Button>
</StackPanel>
</Grid>
</DataTemplate>
</GroupBox.HeaderTemplate>

<ScrollViewer x:Name="TextScrollViewer"
VerticalScrollBarVisibility="Auto"
Padding="0, -8, 0, -10"> <!-- Make the content stretch fully vertically inside the GroupBox (same values as GroupBox inner margin) -->
Expand All @@ -67,7 +92,7 @@
<GroupBox Grid.Row="1" Header="Änderungen" themes:Attached.Icon="InkingTool">
<Grid>
<TextBox x:Name="InstructionTextBox"
themes:Attached.Placeholder="Anweisung"
themes:Attached.Placeholder="Anweisung wie der Text geändert werden soll"
IsReadOnly="{Binding ApplyInstructionCommand.IsRunning}"
Text="{Binding Instruction, UpdateSourceTrigger=PropertyChanged}">
<TextBox.InputBindings>
Expand Down

0 comments on commit 09220d3

Please sign in to comment.