瀏覽代碼

bota 注释列表、书签列表UI

OYXH\oyxh 2 年之前
父節點
當前提交
f479247c6b

二進制
PDF Office/Resources/BOTA/empty_bookmark.png


+ 13 - 50
PDF Office/Styles/ExpanderStyle.xaml

@@ -138,10 +138,10 @@
 
     <SolidColorBrush x:Key="Expander.MouseOver.Circle.Stroke" Color="#FF5593FF" />
     <SolidColorBrush x:Key="Expander.MouseOver.Circle.Fill" Color="#FFF3F9FF" />
-    <SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#FF000000" />
+    <SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#616469" />
     <SolidColorBrush x:Key="Expander.Pressed.Circle.Stroke" Color="#FF3C77DD" />
     <SolidColorBrush x:Key="Expander.Pressed.Circle.Fill" Color="#FFD9ECFF" />
-    <SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#FF000000" />
+    <SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#616469" />
     <SolidColorBrush x:Key="Expander.Disabled.Circle.Stroke" Color="#FFBCBCBC" />
     <SolidColorBrush x:Key="Expander.Disabled.Circle.Fill" Color="#FFE6E6E6" />
     <SolidColorBrush x:Key="Expander.Disabled.Arrow.Stroke" Color="#FF707070" />
@@ -153,11 +153,11 @@
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type ToggleButton}">
                     <Border Padding="{TemplateBinding Padding}">
-                        <Grid Background="Transparent" SnapsToDevicePixels="False">
+                        <Grid Background="{StaticResource color.sys.layout.fg.light}" SnapsToDevicePixels="False">
                             <Grid.ColumnDefinitions>
 
                                 <ColumnDefinition Width="*" />
-                                <ColumnDefinition Width="19" />
+                                <ColumnDefinition Width="35" />
                             </Grid.ColumnDefinitions>
                             <Ellipse
                                 x:Name="circle"
@@ -169,29 +169,11 @@
                                 Stroke="{StaticResource Expander.Static.Circle.Stroke}"
                                 Visibility="Collapsed" />
                             <Rectangle Grid.Column="0" />
-                            <!--<Polygon
-                            x:Name="Collapsed"
-                            Grid.Column="1"
-                            Margin="0,0,12,0"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center"
-                            Fill="Black"
-                            Points="11 2 5 8 11 14"
-                            SnapsToDevicePixels="false"
-                            Stroke="{StaticResource Expander.Static.Arrow.Stroke}"
-                            StrokeThickness="2">
-                            <Polygon.RenderTransform>
-                            <TransformGroup>
-                            <TranslateTransform X="8" Y="8" />
-                            <ScaleTransform ScaleX="-1" ScaleY="1" />
-                            <TranslateTransform X="25" Y="-8" />
-                            </TransformGroup>
-                            </Polygon.RenderTransform>
-                            </Polygon>-->
+
                             <Path
                                 Name="arrowdown"
                                 Grid.Column="1"
-                                Margin="0,0,5,0"
+                                Margin="0,0,15,0"
                                 HorizontalAlignment="Right"
                                 VerticalAlignment="Center"
                                 Data="M6 7.56427L2.03039 3.59467L0.969727 4.65533L5.46967 9.15526C5.76256 9.44816 6.23743 9.44816 6.53033 9.15526L11.0303 4.65533L9.9696 3.59467L6 7.56427Z"
@@ -199,34 +181,15 @@
                             <Path
                                 Name="Collapsed"
                                 Grid.Column="1"
-                                Margin="0,0,5,0"
+                                Margin="0,0,15,0"
                                 HorizontalAlignment="Right"
                                 VerticalAlignment="Center"
                                 Data="M7.56438 5.99999L3.59473 9.96964L4.65539 11.0303L9.15537 6.53032C9.44826 6.23743 9.44826 5.76255 9.15537 5.46966L4.65539 0.969675L3.59473 2.03033L7.56438 5.99999Z"
                                 Fill="Black" />
-                            <!--<Polygon
-                            x:Name="arrowdown"
-                            Grid.Column="1"
-                            Margin="0,0,12,0"
-                            HorizontalAlignment="Center"
-                            VerticalAlignment="Center"
-                            Fill="Black"
-                            Points="11 2 5 8 11 14"
-                            SnapsToDevicePixels="false"
-                            Stroke="{StaticResource Expander.Static.Arrow.Stroke}"
-                            StrokeThickness="2"
-                            Visibility="Collapsed">
-                            <Polygon.RenderTransform>
-                            <TransformGroup>
-                            <TranslateTransform X="8" Y="8" />
-                            <RotateTransform Angle="-90" />
-                            <TranslateTransform X="-5" Y="22" />
-                            </TransformGroup>
-                            </Polygon.RenderTransform>
-                            </Polygon>-->
+
                             <ContentPresenter
                                 Grid.Column="0"
-                                Margin="0,0,0,0"
+                                Margin="2,0,0,0"
                                 HorizontalAlignment="Stretch"
                                 VerticalAlignment="Center"
                                 RecognizesAccessKey="True"
@@ -268,8 +231,8 @@
     </Style>
 
     <Style x:Key="GropExpanderHeader" TargetType="{x:Type Expander}">
-        <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
-        <Setter Property="Background" Value="#FFFFFF" />
+        <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
+        <Setter Property="Background" Value="{StaticResource color.sys.layout.mg}" />
         <Setter Property="HorizontalContentAlignment" Value="Stretch" />
         <Setter Property="VerticalContentAlignment" Value="Stretch" />
         <Setter Property="BorderBrush" Value="Transparent" />
@@ -278,7 +241,7 @@
             <Setter.Value>
                 <ControlTemplate TargetType="{x:Type Expander}">
                     <Border
-                        Margin="0,8"
+                        Margin="0,2"
                         Background="{TemplateBinding Background}"
                         BorderBrush="{TemplateBinding BorderBrush}"
                         BorderThickness="{TemplateBinding BorderThickness}"
@@ -321,7 +284,7 @@
                             <Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
                         </Trigger>
                         <Trigger Property="IsExpanded" Value="false">
-                            <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
+                            <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv1}" />
                         </Trigger>
                     </ControlTemplate.Triggers>
                 </ControlTemplate>

+ 9 - 6
PDF Office/Styles/ListViewStyle.xaml

@@ -398,9 +398,9 @@
     <ControlTemplate x:Key="AnnotationListItemStyle" TargetType="{x:Type ListBoxItem}">
         <Border
             x:Name="Bd"
-            Margin="5,0,5,10"
-            Padding="5"
-            Background="#f5f5f5"
+            Padding="8"
+            Margin="5"
+            Background="{StaticResource color.sys.layout.mg}"
             BorderBrush="{TemplateBinding BorderBrush}"
             BorderThickness="{TemplateBinding BorderThickness}"
             CornerRadius="4"
@@ -418,24 +418,27 @@
                 <MultiTrigger.Conditions>
                     <Condition Property="IsMouseOver" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#EDEEF0" />
+                <Setter TargetName="Bd" Property="Background" Value="{ StaticResource color.item-state.hov.bg}" />
                 <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+                <!--<Setter Property="Margin" Value="5,0,5,10" />-->
             </MultiTrigger>
             <MultiTrigger>
                 <MultiTrigger.Conditions>
                     <Condition Property="Selector.IsSelectionActive" Value="False" />
                     <Condition Property="IsSelected" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#d7d8db" />
+                <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
                 <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+                <!--<Setter Property="Margin" Value="5,0,5,10" />-->
             </MultiTrigger>
             <MultiTrigger>
                 <MultiTrigger.Conditions>
                     <Condition Property="Selector.IsSelectionActive" Value="True" />
                     <Condition Property="IsSelected" Value="True" />
                 </MultiTrigger.Conditions>
-                <Setter TargetName="Bd" Property="Background" Value="#d7d8db" />
+                <Setter TargetName="Bd" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv3}" />
                 <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
+                <!--<Setter Property="Margin" Value="5,0,5,10" />-->
             </MultiTrigger>
             <Trigger Property="IsEnabled" Value="False">
                 <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />

+ 1 - 1
PDF Office/Themes/Generic.xaml

@@ -66,8 +66,8 @@
                                 x:Name="placeholder"
                                 Margin="{Binding ElementName=PART_ContentHost, Path=Margin}"
                                 Padding="{TemplateBinding Padding}"
-                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                 HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+                                VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
                                 FontSize="{TemplateBinding FontSize}"
                                 Foreground="{TemplateBinding PlaceholderForeground}"
                                 Text="{TemplateBinding PlaceholderText}"

+ 6 - 0
PDF Office/ViewModels/BOTA/AnnotationContentViewModel.cs

@@ -1104,6 +1104,12 @@ namespace PDF_Office.ViewModels.BOTA
                 WriteableBitmap bitmap = GetAnnotImage(PdfViewer.Document, item.PageIndex, item.AnnotIndex);
                 args.WriteableBitmap = bitmap;
             }
+            //if (item.EventType == AnnotArgsType.AnnotLink)
+            //{
+            //    if (string.IsNullOrEmpty(item.MarkupContent))
+            //    {
+            //    }
+            //}
             args.AnnotHandlerEventArgs = item;
             args.PageIndex = item.PageIndex;
             args.AnnotIndex = item.AnnotIndex;

+ 2 - 3
PDF Office/ViewModels/BOTA/BookmarkContentViewModel.cs

@@ -331,6 +331,7 @@ namespace PDF_Office.ViewModels.BOTA
                                 Bookmarklist.Add(bookmark);
 
                                 Bookmarklist = new ObservableCollection<CPDFBookmark>(Bookmarklist.OrderBy(item => item.PageIndex));
+                                Bookmarklist.CollectionChanged += Bookmarklist_CollectionChanged;
                                 SetListViewItemState(listView, bookmark);
                             }
                         }
@@ -438,8 +439,6 @@ namespace PDF_Office.ViewModels.BOTA
             return isExistBookmark;
         }
 
-        private ListViewItem selectListViewItem = null;
-
         public void OnNavigatedTo(NavigationContext navigationContext)
         {
             navigationContext.Parameters.TryGetValue<CPDFViewer>(ParameterNames.PDFViewer, out PDFViewer);
@@ -449,7 +448,7 @@ namespace PDF_Office.ViewModels.BOTA
                 return;
             }
 
-            Bookmarklist = new ObservableCollection<CPDFBookmark>(PDFViewer.Document.GetBookmarkList().OrderBy(d => d.Title));
+            Bookmarklist = new ObservableCollection<CPDFBookmark>(PDFViewer.Document.GetBookmarkList().OrderBy(d => d.PageIndex));
             Bookmarklist.CollectionChanged += Bookmarklist_CollectionChanged;
             if (Bookmarklist.Count < 1)
             {

+ 6 - 7
PDF Office/Views/BOTA/AnnotationContent.xaml

@@ -62,7 +62,7 @@
                 x:Name="AnnotationList"
                 Grid.ColumnSpan="3"
                 HorizontalContentAlignment="Stretch"
-                Background="#F2F2F2"
+                Background="{StaticResource color.sys.layout.mg}"
                 BorderThickness="0"
                 ItemTemplate="{StaticResource AnnotationListItemTemplate}"
                 ItemsSource="{Binding AnnotationListItems}"
@@ -85,6 +85,7 @@
                     <GroupStyle>
                         <GroupStyle.ContainerStyle>
                             <Style TargetType="{x:Type GroupItem}">
+                                <Setter Property="Background" Value="{StaticResource color.sys.layout.mg}" />
                                 <Setter Property="Template">
                                     <Setter.Value>
                                         <ControlTemplate TargetType="{x:Type GroupItem}">
@@ -162,10 +163,7 @@
                 Grid.ColumnSpan="2"
                 VerticalAlignment="Center"
                 Visibility="{Binding IsEmptyPanelVisibility}">
-                <Image
-                    Width="140"
-                    Height="140"
-                    Source="pack://application:,,,/Resources/BOTA/empty_annotation.png" />
+                <Image Source="pack://application:,,,/Resources/BOTA/empty_annotation.png" />
                 <TextBlock
                     Name="txtEmpty"
                     Margin="0,12,0,0"
@@ -189,10 +187,11 @@
         <Grid Name="TopGrid" Grid.Row="0">
             <TextBlock
                 x:Name="Title"
-                Margin="12,0,0,0"
+                Margin="16,0,0,0"
                 VerticalAlignment="Center"
-                FontSize="18"
+                FontSize="14"
                 FontWeight="SemiBold"
+                Foreground="{StaticResource color.sys.text.neutral.lv1}"
                 Text="Markup"
                 TextAlignment="Left" />
             <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">

+ 17 - 11
PDF Office/Views/BOTA/AnnotationListItem.xaml

@@ -368,17 +368,23 @@
 
             <StackPanel Grid.Row="2">
                 <!--  附注  -->
-                <TextBlock
-                    Name="TxbContent"
-                    Margin="5"
-                    FontFamily="Segoe UI"
-                    FontSize="14"
-                    Foreground="#616469"
-                    Text="{Binding Content}"
-                    TextAlignment="Left"
-                    TextTrimming="CharacterEllipsis"
-                    TextWrapping="Wrap"
-                    Visibility="{Binding ElementName=TxbContent, Path=Text, Converter={StaticResource StringToVisibleConvert}}" />
+                <Border
+                    BorderBrush="{StaticResource color.sys.border.neutral.lv2}"
+                    BorderThickness="1"
+                    CornerRadius="4"
+                    Visibility="{Binding ElementName=TxbContent, Path=Text, Converter={StaticResource StringToVisibleConvert}}">
+                    <TextBlock
+                        Name="TxbContent"
+                        Margin="5"
+                        FontFamily="Segoe UI"
+                        FontSize="14"
+                        Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                        Text="{Binding Content}"
+                        TextAlignment="Left"
+                        TextTrimming="CharacterEllipsis"
+                        TextWrapping="Wrap"
+                        Visibility="{Binding ElementName=TxbContent, Path=Text, Converter={StaticResource StringToVisibleConvert}}" />
+                </Border>
                 <!--<TextBox
                 Name="TxTContent"
                 Margin="5"

+ 16 - 9
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -103,11 +103,12 @@
         <Grid MinWidth="190">
             <TextBlock
                 x:Name="TxtTitle"
-                Margin="12,0,0,0"
+                Margin="16,0,0,0"
                 HorizontalAlignment="Left"
                 VerticalAlignment="Center"
-                FontSize="18"
+                FontSize="14"
                 FontWeight="SemiBold"
+                Foreground="{StaticResource color.sys.text.neutral.lv1}"
                 Text="Bookmarks" />
             <Button
                 Name="BtnAddBookmark"
@@ -135,7 +136,6 @@
                 BorderThickness="0"
                 ItemTemplate="{StaticResource myDataTemplate}"
                 ItemsSource="{Binding Bookmarklist}"
-
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                 VirtualizingPanel.CacheLength="1"
                 VirtualizingPanel.CacheLengthUnit="Page"
@@ -162,17 +162,24 @@
             Width="150"
             VerticalAlignment="Center"
             Visibility="{Binding IsEmptyPanelVisibility}">
-            <Image
-                Width="140"
-                Height="140"
-                Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
+            <Image Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
             <TextBlock
                 Name="txtEmpty"
                 Margin="0,12,0,0"
                 FontFamily="Segoe UI"
-                FontSize="16"
-                Text="No bookmark"
+                FontSize="14"
+                Foreground="{StaticResource color.sys.text.neutral.lv2}"
+                Text="No bookmark found"
                 TextAlignment="Center" />
+            <TextBlock
+                Name="txtEmpty2"
+                Margin="0,12,0,0"
+                FontFamily="Segoe UI"
+                FontSize="14"
+                Foreground="{StaticResource color.sys.text.neutral.lv3}"
+                Text="Please right-click on the selected page and select Add Bookmark, or click the Add button on the upper right to create a bookmark."
+                TextAlignment="Center"
+                TextWrapping="Wrap" />
         </StackPanel>
     </Grid>
 </UserControl>

+ 1 - 1
PDF Office/Views/PropertyPanel/ViewModular/ViewModularContent.xaml

@@ -193,7 +193,7 @@
             Style="{StaticResource {x:Static ToolBar.SeparatorStyleKey}}" />-->
             <CheckBox
                 Name="chkContinue"
-                Margin="17,6,0,6"
+                Margin="17,16,0,6"
                 VerticalContentAlignment="Center"
                 Command="{Binding ContinueCommand}"
                 Content="连续滚动"