Browse Source

Merge branch 'compdfkit_demo_windows' of http://git.kdan.cc:8865/Others/kmpdfkit_demo into compdfkit_demo_windows

# Conflicts:
#	compdfkit_demo_windows/compdfkit/compdfkit-tools/Common/PropertyControl/ColorPickerControl.xaml.cs
zhuyi 1 year ago
parent
commit
dc82200be5

+ 35 - 1
compdfkit_demo_windows/compdfkit/compdfkit-tools/Common/PropertyControl/ColorPickerControl.xaml.cs

@@ -119,7 +119,6 @@ namespace compdfkit_tools.Common
                 return false;
             }
         }
-
         /// <summary>
         /// 设置允许为空
         /// </summary>
@@ -172,6 +171,41 @@ namespace compdfkit_tools.Common
         private void OnColorChanged()
         {
             ColorChanged?.Invoke(this, null);
+            try
+            {
+                SolidColorBrush colorBrush = Brush as SolidColorBrush;
+                if (colorBrush != null)
+                {
+                    if (colorBrush.Color == (TransparentBtn.Background as SolidColorBrush).Color)
+                    {
+                        TransparentBtn.IsChecked = true;
+                    }
+
+                    if (colorBrush.Color == (FirstBtn.Background as SolidColorBrush).Color)
+                    {
+                        FirstBtn.IsChecked = true;
+                    }
+
+                    if (colorBrush.Color == (SecondBtn.Background as SolidColorBrush).Color)
+                    {
+                        SecondBtn.IsChecked = true;
+                    }
+
+                    if (colorBrush.Color == (ThirdBtn.Background as SolidColorBrush).Color)
+                    {
+                        ThirdBtn.IsChecked = true;
+                    }
+
+                    if (colorBrush.Color == (FourthBtn.Background as SolidColorBrush).Color)
+                    {
+                        FourthBtn.IsChecked = true;
+                    }
+                }
+            }
+            catch (Exception ex)
+            {
+
+            }
         }
 
         private void ColorRadioButton_Click(object sender, RoutedEventArgs e)

+ 3 - 0
compdfkit_demo_windows/compdfkit/compdfkit-tools/Edit/PDFImageEdit/PDFImageEditControl/PDFImageEditControl.xaml.cs

@@ -110,6 +110,7 @@ namespace compdfkit_tools.Edit
             {
                 EditEvent.Transparency = (int)(ImasgeOpacitySlider.Value * 255);
                 EditEvent.UpdatePDFEditByEventArgs();
+                ImageThumbUI.Opacity = ImasgeOpacitySlider.Value;
             }
         }
 
@@ -130,6 +131,7 @@ namespace compdfkit_tools.Edit
             {
                 EditEvent.Transparency = (int)(ImasgeOpacitySlider.Value * 255);
                 EditEvent.UpdatePDFEditByEventArgs();
+                ImageThumbUI.Opacity = ImasgeOpacitySlider.Value;
             }
         }
 
@@ -241,6 +243,7 @@ namespace compdfkit_tools.Edit
         public void SetImageTransparency(double transparency)
         {
             ImasgeOpacitySlider.Value = transparency / 255D;
+            ImageThumbUI.Opacity = transparency / 255D;
             OpacityTextBox.Text = string.Format("{0}%", (int)(Math.Ceiling(ImasgeOpacitySlider.Value * 100)));
         }
     }

+ 5 - 1
compdfkit_demo_windows/compdfkit/edit-ctrl-demo/MainWindow.xaml.cs

@@ -798,6 +798,7 @@ namespace edit_ctrl_demo
                     CPDFDocument pdfDoc = pdfViewControl.PDFView.Document;
                     if (pdfDoc.WriteToLoadedPath())
                     {
+                        pdfViewControl.PDFView.UndoManager.CanSave = false;
                         return;
                     }
 
@@ -808,7 +809,10 @@ namespace edit_ctrl_demo
 
                     if (saveDialog.ShowDialog() == true)
                     {
-                        pdfDoc.WriteToFilePath(saveDialog.FileName);
+                       if( pdfDoc.WriteToFilePath(saveDialog.FileName))
+                        {
+                            pdfViewControl.PDFView.UndoManager.CanSave = false;
+                        }
                     }
                 }
                 catch (Exception ex)