Переглянути джерело

纠错重写翻译-结果框与错误提示框问题修复,进度条遮挡区域修复

liyijie 1 рік тому
батько
коміт
f01dd56b65

+ 3 - 0
PDF Office/ViewModels/Dialog/ChatGPTAIDialogs/SelectedTranslationDialogViewModel.cs

@@ -195,8 +195,11 @@ namespace PDF_Master.ViewModels.Dialog.ChatGPTAIDialogs
         private void textBoxEnterCharactersTextChanged(object e)
         {
             var ConverterPreview = e as TextBoxEx;
+
             if (ConverterPreview != null)
             {
+                //结果置空
+                TranslateText = "";
                 if (ConverterPreview.Text.Length > 150)
                 {
 

+ 2 - 1
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIErrorCorrectionContentViewModel.cs

@@ -108,9 +108,10 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
             var ConverterPreview = e as TextBoxEx;
             if (ConverterPreview != null)
             {
+                //结果置空
+                ErrorCorrectionText = "";
                 if (ConverterPreview.Text.Length > 150)
                 {
-
                     ErrorTipText = "Limit 150 characters at a time";
                     ErrorVisible = Visibility.Visible;
                 }

+ 2 - 1
PDF Office/ViewModels/HomePanel/ChatGPTAI/ChatGPTAIRewritingContentViewModel.cs

@@ -109,9 +109,10 @@ namespace PDF_Master.ViewModels.HomePanel.ChatGPTAI
             var ConverterPreview = e as TextBoxEx;
             if (ConverterPreview != null)
             {
+                //结果置空
+                RewriteText = "";
                 if (ConverterPreview.Text.Length > 150)
                 {
-
                     ErrorTipText = "Limit 150 characters at a time";
                     ErrorVisible = Visibility.Visible;
                 }

+ 23 - 15
PDF Office/Views/Dialog/ChatGPTAIDialogs/DocumentaryTranslationDialog.xaml

@@ -1,5 +1,6 @@
 <UserControl x:Class="PDF_Master.Views.Dialog.ChatGPTAIDialogs.DocumentaryTranslationDialog"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+             xmlns:convert="clr-namespace:PDF_Master.DataConvert"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     xmlns:cus="clr-namespace:PDF_Master.CustomControl"
     xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
@@ -13,6 +14,11 @@
     prism:Dialog.WindowStyle="{StaticResource DialogWindowStyle}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     mc:Ignorable="d">
+    <UserControl.Resources>
+        <ResourceDictionary>
+            <convert:UnVisibleToBoolConvert x:Key="UnVisibleToBoolConvert" />
+        </ResourceDictionary>
+    </UserControl.Resources>
     <cus:DialogContent Header="AI Translation">
         <cus:DialogContent.Content>
             <Grid Grid.Row="1" >
@@ -20,24 +26,25 @@
                     <ColumnDefinition Width="*"></ColumnDefinition>
                     <ColumnDefinition Width="468"></ColumnDefinition>
                 </Grid.ColumnDefinitions>
-                <Border Grid.ColumnSpan="2"
-                Panel.ZIndex="1"
+                <Border x:Name="ProgressBorder" Grid.RowSpan="2" Grid.ColumnSpan="2"
+                Panel.ZIndex="1" Background="Transparent" Visibility="{Binding ProgressVisible}">
+                    <Border 
                 Width="226"
                 Height="58"
                 Background="{StaticResource color.sys.layout.dark.bg}"
                 BorderThickness="0"
                 CornerRadius="{StaticResource border-radius.8}"
                 Effect="{StaticResource shadow.neutral.m}"
-                Visibility="{Binding ProgressVisible}">
-                    <Grid Margin="16,13" Background="Transparent">
-                        <StackPanel Orientation="Horizontal">
-                            <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="Translating..." />
-                            <TextBlock
+                >
+                        <Grid Margin="16,13" Background="Transparent">
+                            <StackPanel Orientation="Horizontal">
+                                <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="Translating..." />
+                                <TextBlock
                             Foreground="{StaticResource color.sys.text.anti.norm}"
                             Text="{Binding Value, StringFormat={}({0})}"
                             Visibility="Collapsed" />
-                        </StackPanel>
-                        <Button
+                            </StackPanel>
+                            <Button
                         Width="12"
                         Height="12"
                         Padding="0,0,1,1"
@@ -46,9 +53,9 @@
                         Background="{StaticResource color.sys.layout.dark.bg}"
                         BorderThickness="0"
                         Visibility="Collapsed">
-                            <Path Data="M6.00006 7.06072L9.46973 10.5304L10.5304 9.46973L7.06072 6.00006L10.5304 2.53039L9.46973 1.46973L6.00006 4.9394L2.53039 1.46973L1.46973 2.53039L4.9394 6.00006L1.46973 9.46973L2.53039 10.5304L6.00006 7.06072Z" Fill="#CED0D4" />
-                        </Button>
-                        <ProgressBar
+                                <Path Data="M6.00006 7.06072L9.46973 10.5304L10.5304 9.46973L7.06072 6.00006L10.5304 2.53039L9.46973 1.46973L6.00006 4.9394L2.53039 1.46973L1.46973 2.53039L4.9394 6.00006L1.46973 9.46973L2.53039 10.5304L6.00006 7.06072Z" Fill="#CED0D4" />
+                            </Button>
+                            <ProgressBar
                         Height="4"
                         Margin="0,0,0,4"
                         VerticalAlignment="Bottom"
@@ -56,7 +63,8 @@
                         Foreground="{StaticResource color.slider.track-filled.norm}"
                         Maximum="{Binding MaxValue}"
                         Value="{Binding Value}" />
-                    </Grid>
+                        </Grid>
+                    </Border>
                 </Border>
                 <Grid>
                     <ContentControl
@@ -65,7 +73,7 @@
                 HorizontalAlignment="Stretch"
                 prism:RegionManager.RegionName="{Binding ViewerRegionName}"/>
                 </Grid>
-                    <StackPanel Grid.Column="1" Margin="16,0,0,0">
+                <StackPanel Grid.Column="1" Margin="16,0,0,0">
                     <TextBlock Text="Translation Language:" Style="{StaticResource PropertyHeaderLv2}" Height="20"></TextBlock>
                     <StackPanel Orientation="Horizontal" Margin="0,8,0,0" HorizontalAlignment="Left">
                         <ComboBox Width="200" Height="40" Margin="0,0,0,0" ItemsSource="{Binding FromlanguageFamily}" SelectedIndex="{Binding FromlanguageIndex}"></ComboBox>
@@ -107,7 +115,7 @@
             </Grid>
         </cus:DialogContent.Content>
         <cus:DialogContent.BottmBar>
-            <Grid>
+            <Grid IsEnabled="{Binding ElementName=ProgressBorder,Path=Visibility,Converter={StaticResource UnVisibleToBoolConvert}}">
                 <Button
                     Width="98"
                     Height="32"

+ 4 - 2
PDF Office/Views/Dialog/ChatGPTAIDialogs/SelectedTranslationDialog.xaml

@@ -27,14 +27,15 @@
             <RowDefinition Height="*"></RowDefinition>
         </Grid.RowDefinitions>
         <Border Grid.RowSpan="2"
-                Panel.ZIndex="1"
+                Panel.ZIndex="1" Background="Transparent" Visibility="{Binding ProgressVisible}">
+        <Border 
                 Width="226"
                 Height="58"
                 Background="{StaticResource color.sys.layout.dark.bg}"
                 BorderThickness="0"
                 CornerRadius="{StaticResource border-radius.8}"
                 Effect="{StaticResource shadow.neutral.m}"
-                Visibility="{Binding ProgressVisible}">
+                >
             <Grid Margin="16,13" Background="Transparent">
                 <StackPanel Orientation="Horizontal">
                     <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="Translating..." />
@@ -64,6 +65,7 @@
                         Value="{Binding Value}" />
             </Grid>
         </Border>
+        </Border>
         <Grid Grid.Row="0">
             <StackPanel Orientation="Horizontal">
                 <TextBlock  Margin="16,0,0,0" Text="AI Translation" FontFamily="Segoe UI"