Prechádzať zdrojové kódy

注释 - 注释颜色初始化为红色,注释标题切换、悬浮文字

chenrongqian@kdanmobile.com 2 rokov pred
rodič
commit
3ecc8da670

+ 8 - 0
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreehandAnnotPropertyViewModel.cs

@@ -223,6 +223,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot;
                 BasicVm.IsMultiSelected = PropertyPanel.IsMultiSelected;
+                if(Annot is FreehandAnnotArgs)
+                {
+                    BasicVm.AnnotTypeTitle = "画笔";
+                }
+                else
+                {
+                    BasicVm.AnnotTypeTitle = "橡皮擦";
+                }
 
                 if (BasicVm.IsMultiSelected)
                 {

+ 1 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/FreetextAnnotPropertyViewModel.cs

@@ -336,7 +336,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot as FreeTextAnnotArgs;
                 LoadPropertyHandler?.Invoke(this, Annot);
-
+                BasicVm.AnnotTypeTitle = "文字";
                 BasicVm.IsMultiSelected = PropertyPanel.IsMultiSelected;
                 if (BasicVm.IsMultiSelected)
                 {

+ 9 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/SharpsAnnotPropertyViewModel.cs

@@ -514,6 +514,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             BasicVm.AnnotThickness = Square.LineWidth;
                             Dash = Square.LineDash;
                             SharpsType("Rect",true);
+                            BasicVm.AnnotTypeTitle = "矩形";
                         }
                         break;
 
@@ -528,7 +529,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             BasicVm.AnnotThickness = Circle.LineWidth;
                             Dash = Circle.LineDash;
                             SharpsType("Circle", true);
-
+                            BasicVm.AnnotTypeTitle = "圆";
                         }
                         break;
 
@@ -544,9 +545,16 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             Dash = line.LineDash;
 
                             if (line.TailLineType == C_LINE_TYPE.LINETYPE_ARROW && line.HeadLineType == C_LINE_TYPE.LINETYPE_NONE)
+                            {
                                 SharpsType("Arrow", true);
+                                BasicVm.AnnotTypeTitle = "箭头";
+                            }
                             else
+                            {
                                 SharpsType("Line", true);
+                                BasicVm.AnnotTypeTitle = "线条";
+                            }
+                               
 
                            
                         }

+ 9 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/StickyNotePropertyViewModel.cs

@@ -55,6 +55,14 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
             set => SetProperty(ref _isMultiSelected, value);
         }
 
+        //注释类型名称
+        private string _annotTypeTitle;
+        public string AnnotTypeTitle
+        {
+            get { return _annotTypeTitle; }
+            set => SetProperty(ref _annotTypeTitle, value);
+        }
+
         Dictionary<string, string> StickyNoteTypes = new Dictionary<string, string>();
         public event EventHandler<object> LoadPropertyHandler;
         public DelegateCommand<object> SelectedColorChangedCommand { get; set; }
@@ -158,7 +166,7 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                 AnnotEvent = PropertyPanel.AnnotEvent;
                 Annot = PropertyPanel.annot;
                 IsMultiSelected = PropertyPanel.IsMultiSelected;
-
+                AnnotTypeTitle = "便签";
                 if (IsMultiSelected)
                 {
                     IsAttributeEquals();

+ 0 - 1
PDF Office/ViewModels/PropertyPanel/AnnotPanel/TextAnnotPropertyViewModel.cs

@@ -198,7 +198,6 @@ namespace PDF_Office.ViewModels.PropertyPanel.AnnotPanel
                             var Hightlight = Annot as TextHighlightAnnotArgs;
                             BasicVm.FillOpacity = Hightlight.Transparency;
                             BasicVm.FontColor = new SolidColorBrush(Hightlight.Color);
-
                         }
                         break;
 

+ 6 - 6
PDF Office/ViewModels/Tools/AnnotToolContentViewModel.Function.cs

@@ -61,7 +61,7 @@ namespace PDF_Office.ViewModels.Tools
             }
             else
             {
-                HighLightColor = new SolidColorBrush(Colors.Transparent);
+                HighLightColor = new SolidColorBrush(Colors.Red);
                 HighLightOpacity = 1;
             }
             
@@ -77,7 +77,7 @@ namespace PDF_Office.ViewModels.Tools
             }
             else
             {
-                UnderLineColor = new SolidColorBrush(Colors.Transparent);
+                UnderLineColor = new SolidColorBrush(Colors.Red);
                 UnderLineOpacity = 1;
             }
             
@@ -93,7 +93,7 @@ namespace PDF_Office.ViewModels.Tools
             }
             else
             {
-                SquigglyColor = new SolidColorBrush(Colors.Transparent);
+                SquigglyColor = new SolidColorBrush(Colors.Red);
                 SquigglyOpacity = 1;
             }
         }
@@ -108,7 +108,7 @@ namespace PDF_Office.ViewModels.Tools
             }
             else
             {
-                StrikeoutColor = new SolidColorBrush(Colors.Transparent);
+                StrikeoutColor = new SolidColorBrush(Colors.Red);
                 StrikeoutOpacity = 1;
             }
 
@@ -571,7 +571,7 @@ namespace PDF_Office.ViewModels.Tools
                 else
                 {
                     squareArgs.LineColor = Colors.Red;
-                    squareArgs.BgColor = Colors.Transparent;
+                    squareArgs.BgColor = Colors.Red;
                 }
 
                 squareArgs.LineWidth = 1;
@@ -623,7 +623,7 @@ namespace PDF_Office.ViewModels.Tools
                 else
                 {
                     circleAnnotArgs.LineColor = Colors.Red;
-                    circleAnnotArgs.BgColor = Colors.Transparent;
+                    circleAnnotArgs.BgColor = Colors.Red;
                 }
 
                 circleAnnotArgs.LineWidth = 1;

+ 8 - 3
PDF Office/Views/PropertyPanel/AnnotPanel/FreehandAnnotProperty.xaml

@@ -39,7 +39,9 @@
     </UserControl.Resources>
     <Grid Background="#F3F3F3">
         <StackPanel>
-            <TextBlock Name="AnnotTypeTitle" FontFamily="SegoeUI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0">Freehand</TextBlock>
+            <TextBlock Name="AnnotTypeTitle" 
+                       Text="{Binding BasicVm.AnnotTypeTitle}"
+                       FontFamily="SegoeUI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="10,8,0,0"></TextBlock>
 
             <Border Width="128" Height="32" Margin="0,12,0,0" BorderThickness="1" BorderBrush="#FFE2E3E6"
                     Visibility="{Binding  BasicVm.IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"
@@ -50,7 +52,10 @@
                         <ColumnDefinition Width="*"></ColumnDefinition>
                     </Grid.ColumnDefinitions>
 
-                    <ToggleButton Name="PenBtn"  IsEnabled="True" Tag="PenBtn" Background="Transparent"  BorderThickness="0" Click="PenBtn_Click" IsChecked="{Binding IsPen}" Checked="PenBtn_Checked" Command="{Binding PenCommand}" CommandParameter="{Binding ElementName=PenBtn}" >
+                    <ToggleButton Name="PenBtn" ToolTip="画笔" IsEnabled="True" Tag="PenBtn" Background="Transparent"  BorderThickness="0" Click="PenBtn_Click" 
+                                  
+                                  IsChecked="{Binding IsPen}" 
+                                  Checked="PenBtn_Checked" Command="{Binding PenCommand}" CommandParameter="{Binding ElementName=PenBtn}" >
                         <Image Width="16" Height="16">
                             <Image.Source>
                                 <DrawingImage>
@@ -84,7 +89,7 @@
 
                     <Line HorizontalAlignment="Left" Style="{StaticResource lineStyle}" VerticalAlignment="Center" Grid.Column="1" X1="0" Y1="0" X2="0" Y2="16" StrokeThickness="1" Stroke="#33000000"></Line>
 
-                    <ToggleButton Name="EraseBtn" Tag="EraseBtn" Background="Transparent" Grid.Column="1" BorderThickness="0" Click="EraseBtn_Click" Command="{Binding EraseCommand}" CommandParameter="{Binding ElementName=EraseBtn}">
+                    <ToggleButton Name="EraseBtn" Tag="EraseBtn" ToolTip="橡皮擦" Background="Transparent" Grid.Column="1" BorderThickness="0" Click="EraseBtn_Click" Command="{Binding EraseCommand}" CommandParameter="{Binding ElementName=EraseBtn}">
                         <Path Width="16" Height="16" HorizontalAlignment="Center" VerticalAlignment="Center" Fill="#000000" Data="M11,1.796875 L16.703125,7.5 L9.2109375,15 L5.0390625,15 L2.3984375,
                           12.3515625 L2.30688477,12.2502441 C2.22143555,12.1452637 2.15429688,12.0292969 2.10546875,11.9023438 C2.04036458,11.7330729 2.0078125,11.5572917 2.0078125,
                           11.375 C2.0078125,11.1927083 2.04036458,11.0169271 2.10546875,10.8476562 C2.15429688,10.7207031 2.2199707,

+ 4 - 10
PDF Office/Views/PropertyPanel/AnnotPanel/SharpsAnnotProperty.xaml

@@ -115,9 +115,8 @@
                         <ColumnDefinition Width="40.5" />
                     </Grid.ColumnDefinitions>
 
-
                     <RadioButton x:Name="SharpRectBtn" Tag="Rect" GroupName="Shape" 
-                                 Width="32" Height="32" Margin="0,0" 
+                                 Width="32" Height="32" Margin="0,0" ToolTip="矩形"
                                  VerticalContentAlignment="Center" Background="Transparent"
                                  Style="{DynamicResource GreyBgRadioBtnStyle}">
                         <RadioButton.Content>
@@ -135,10 +134,8 @@
                         </i:Interaction.Triggers>
                     </RadioButton>
 
-
-
                     <RadioButton x:Name="SharpCircleBtn" Tag="Circle" GroupName="Shape"  Grid.Column="1"
-                                 Width="32" Height="32" Margin="0,0" 
+                                 Width="32" Height="32" Margin="0,0" ToolTip="圆"
                                  VerticalContentAlignment="Center" Background="Transparent"
                                  Style="{DynamicResource GreyBgRadioBtnStyle}">
                         <RadioButton.Content>
@@ -156,11 +153,8 @@
                         </i:Interaction.Triggers>
                     </RadioButton>
 
-
-
-
                     <RadioButton x:Name="SharpArrowBtn" Tag="Arrow" GroupName="Shape"  Grid.Column="2"
-                                 Width="32" Height="32" Margin="0,0" 
+                                 Width="32" Height="32" Margin="0,0" ToolTip="箭头"
                                  VerticalContentAlignment="Center" Background="Transparent"
                                  Style="{DynamicResource GreyBgRadioBtnStyle}">
                         <RadioButton.Content>
@@ -183,7 +177,7 @@
                     </RadioButton>
 
                     <RadioButton x:Name="SharpLineBtn" Tag="Line" GroupName="Shape"  Grid.Column="3"
-                                 Width="32" Height="32" Margin="0,0" 
+                                 Width="32" Height="32" Margin="0,0" ToolTip="线条"
                                  VerticalContentAlignment="Center" Background="Transparent"
                                  Style="{DynamicResource GreyBgRadioBtnStyle}">
                         <RadioButton.Content>

+ 1 - 1
PDF Office/Views/PropertyPanel/AnnotPanel/StickyNoteProperty.xaml

@@ -28,7 +28,7 @@
     <Grid  VerticalAlignment="Stretch" Background="#F3F3F3">
         <StackPanel Margin="12 0 12 0">
             <TextBlock Name="AnnotTypeTitle" FontFamily="Segoe UI" FontWeight="Bold" FontSize="18" LineHeight="24" HorizontalAlignment="Left" Margin="0,16,0,8"
-                       Text="便签"
+                       Text="{Binding AnnotTypeTitle}"
                        ></TextBlock>
             <Border Width="228" Height="100" BorderThickness="1" CornerRadius="2" BorderBrush="#DDDDDD" Background="White" Margin="0,8,0,0"
                     Visibility="{Binding IsMultiSelected,Converter={StaticResource InvertBoolToVisibleConvert}}"