瀏覽代碼

UI-调整窗体边框

ZhouJieSheng 2 年之前
父節點
當前提交
f2f653acf2

+ 3 - 3
PDF Office/Styles/WindowsStyle.xaml

@@ -7,8 +7,8 @@
             <Setter.Value>
                 <WindowChrome
                     CaptionHeight="32"
-                    CornerRadius="10"
-                    GlassFrameThickness="-1"
+                    CornerRadius="0"
+                    GlassFrameThickness="0"
                     ResizeBorderThickness="5"
                     UseAeroCaptionButtons="False" />
                 <!--  GlassFrameThickness="-1" win11上显示异常  -->
@@ -102,7 +102,7 @@
 
     <Style
         x:Key="Caption16DialogWindowStyle"
-         BasedOn="{StaticResource DialogWindowStyle}"
+        BasedOn="{StaticResource DialogWindowStyle}"
         TargetType="{x:Type Window}">
         <Setter Property="WindowChrome.WindowChrome">
             <Setter.Value>

+ 4 - 1
PDF Office/ViewModels/MainContentViewModel.cs

@@ -238,7 +238,10 @@ namespace PDF_Office.ViewModels
                 { ParameterNames.PDFViewer,PDFViewer}
             };
 
-            toolregion.RequestNavigate(MainContentRegionName, "ViewContent", parameters);
+            System.Windows.Application.Current.Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Send, new Action(() =>
+            {
+                toolregion.RequestNavigate(MainContentRegionName, "ViewContent", parameters);
+            }));
 
             IsReNameEnable = true;
             if (!string.IsNullOrEmpty(PDFViewer.Document.FilePath))

+ 0 - 1
PDF Office/ViewModels/ViewContentViewModel.cs

@@ -1305,7 +1305,6 @@ namespace PDF_Office.ViewModels
             CanSave = PDFViewer.UndoManager.CanSave;
             CanUndo = PDFViewer.UndoManager.CanUndo;
             CanRedo = PDFViewer.UndoManager.CanRedo;
-            region.Regions[ViwerRegionName].RemoveAll();
             region.AddToRegion(ViwerRegionName, PDFViewer);
         }
 

+ 2 - 1
PDF Office/Views/BOTA/AnnotationContent.xaml

@@ -66,8 +66,8 @@
                 BorderThickness="0"
                 ItemTemplate="{StaticResource AnnotationListItemTemplate}"
                 ItemsSource="{Binding AnnotationListItems}"
-                SelectionChanged="AnnotationList_SelectionChanged"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                SelectionChanged="AnnotationList_SelectionChanged"
                 SelectionMode="Extended">
                 <ListBox.ItemContainerStyle>
                     <Style TargetType="ListBoxItem">
@@ -194,6 +194,7 @@
                     x:Name="Title"
                     Margin="16,0,0,0"
                     VerticalAlignment="Center"
+                    FontFamily="Segoe UI"
                     FontSize="14"
                     FontWeight="SemiBold"
                     Foreground="{StaticResource color.sys.text.neutral.lv1}"

+ 7 - 2
PDF Office/Views/BOTA/BookmarkContent.xaml

@@ -113,6 +113,7 @@
                     Margin="16,0,0,0"
                     HorizontalAlignment="Left"
                     VerticalAlignment="Center"
+                    FontFamily="Segoe UI"
                     FontSize="14"
                     FontWeight="SemiBold"
                     Foreground="{StaticResource color.sys.text.neutral.lv1}"
@@ -144,10 +145,11 @@
                 ItemTemplate="{StaticResource myDataTemplate}"
                 ItemsSource="{Binding Bookmarklist}"
                 ScrollViewer.HorizontalScrollBarVisibility="Disabled"
+                SelectionChanged="BookMarkListView_SelectionChanged"
                 VirtualizingPanel.CacheLength="1"
                 VirtualizingPanel.CacheLengthUnit="Page"
                 VirtualizingPanel.IsVirtualizing="True"
-                VirtualizingPanel.ScrollUnit="Pixel" SelectionChanged="BookMarkListView_SelectionChanged">
+                VirtualizingPanel.ScrollUnit="Pixel">
                 <ListView.ItemsPanel>
                     <ItemsPanelTemplate>
                         <VirtualizingStackPanel Margin="-5,0,0,0" Background="Transparent" />
@@ -169,7 +171,10 @@
             Width="150"
             VerticalAlignment="Center"
             Visibility="{Binding IsEmptyPanelVisibility}">
-            <Image Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" Width="128" Height="128" />
+            <Image
+                Width="128"
+                Height="128"
+                Source="pack://application:,,,/Resources/BOTA/empty_bookmark.png" />
             <TextBlock
                 Name="txtEmpty"
                 Margin="0,12,0,0"

文件差異過大導致無法顯示
+ 304 - 199
PDF Office/Views/BOTA/SearchContent.xaml


+ 1 - 1
PDF Office/Views/HomePanel/PDFTools/QuickToolsContent.xaml

@@ -89,7 +89,7 @@
                 x:Name="BtnMore"
                 Width="32"
                 Height="32"
-                Margin="12,0,0,0"
+                Margin="12,0,0,16"
                 Command="{Binding OpenMenuCommand}"
                 CommandParameter="{Binding ElementName=BtnMore}"
                 Style="{StaticResource btn.sec}">

+ 191 - 176
PDF Office/Views/MainWindow.xaml

@@ -18,6 +18,8 @@
     d:DataContext="{d:DesignInstance Type=viewmodels:MainWindowViewModel}"
     prism:ViewModelLocator.AutoWireViewModel="True"
     Activated="Window_Activated"
+    BorderBrush="{StaticResource color.sys.layout.bg.tabbar}"
+    BorderThickness="2"
     Closed="Window_Closed"
     Closing="Window_Closing"
     SizeChanged="Window_SizeChanged"
@@ -180,197 +182,210 @@
             <convert:UnVisivleConvert x:Key="UnvisibleConvert" />
         </ResourceDictionary>
     </Window.Resources>
-    <Border>
-        <Grid Background="{StaticResource color.sys.layout.bg.tabbar}">
-            <Grid.RowDefinitions>
-                <RowDefinition Height="40" />
-                <RowDefinition Height="*" />
-            </Grid.RowDefinitions>
-            <dragablz:TabablzControl
-                Name="TabablzControl"
-                Grid.RowSpan="3"
-                BorderThickness="0"
-                FocusVisualStyle="{x:Null}"
-                ItemContainerStyle="{StaticResource DragablzItemStyle}"
-                SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
-                WindowChrome.IsHitTestVisibleInChrome="True">
-                <dragablz:TabablzControl.InterTabController>
-                    <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" />
-                </dragablz:TabablzControl.InterTabController>
-                <dragablz:TabablzControl.HeaderSuffixContent>
-                    <Button
-                        x:Name="BtnAdd"
-                        Width="20"
-                        Height="20"
-                        Margin="8,13,200,7"
-                        Padding="0"
-                        HorizontalAlignment="Left"
-                        Background="Transparent"
-                        BorderThickness="0"
-                        Command="{Binding AddTab}"
-                        WindowChrome.IsHitTestVisibleInChrome="True">
-                        <Path
-                            Width="20"
-                            Height="20"
-                            Data="M9 11V16H11V11H16V9H11V4H9V9H4L4 11H9Z"
-                            Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
-                    </Button>
-                </dragablz:TabablzControl.HeaderSuffixContent>
-                <dragablz:TabablzControl.HeaderPrefixContent>
-                    <Grid
-                        Width="16"
-                        Height="38"
-                        Margin="0,0,0,0"
-                        Background="Transparent" />
-                </dragablz:TabablzControl.HeaderPrefixContent>
-            </dragablz:TabablzControl>
-            <!--  标题栏右侧栏,关闭按钮,会员,试用等  -->
-            <StackPanel
-                Name="StkPnlRight"
-                HorizontalAlignment="Right"
-                Orientation="Horizontal"
-                WindowChrome.IsHitTestVisibleInChrome="True">
+    <Grid Background="{StaticResource color.sys.layout.bg.tabbar}">
+        <Grid.RowDefinitions>
+            <RowDefinition Height="40" />
+            <RowDefinition Height="*" />
+        </Grid.RowDefinitions>
+        <dragablz:TabablzControl
+            Name="TabablzControl"
+            Grid.RowSpan="3"
+            BorderThickness="0"
+            FocusVisualStyle="{x:Null}"
+            ItemContainerStyle="{StaticResource DragablzItemStyle}"
+            SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
+            WindowChrome.IsHitTestVisibleInChrome="True">
+            <dragablz:TabablzControl.InterTabController>
+                <dragablz:InterTabController InterTabClient="{Binding InterTabClient}" />
+            </dragablz:TabablzControl.InterTabController>
+            <dragablz:TabablzControl.HeaderSuffixContent>
                 <Button
-                    x:Name="Btn_Register"
-                    Width="40"
-                    Height="40"
-                    Style="{StaticResource subToolBar}"
+                    x:Name="BtnAdd"
+                    Width="20"
+                    Height="20"
+                    Margin="8,13,200,7"
+                    Padding="0"
+                    HorizontalAlignment="Left"
                     Background="Transparent"
-                    Command="{Binding OpenRegisterCommand}"
-                    Visibility="{Binding RegisterVis,Mode=TwoWay}"
-                    >
-                    <Border    BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}" Width="28" Height="28"  BorderThickness="1" CornerRadius="100" Background="{StaticResource color.icon.base.neutral.norm.lv1}">
-                        <Path
-                            Margin="-3,0,0,0"
+                    BorderThickness="0"
+                    Command="{Binding AddTab}"
+                    WindowChrome.IsHitTestVisibleInChrome="True">
+                    <Path
                         Width="20"
                         Height="20"
+                        Data="M9 11V16H11V11H16V9H11V4H9V9H4L4 11H9Z"
+                        Fill="{StaticResource color.icon.base.neutral.norm.lv1}" />
+                </Button>
+            </dragablz:TabablzControl.HeaderSuffixContent>
+            <dragablz:TabablzControl.HeaderPrefixContent>
+                <Grid
+                    Width="16"
+                    Height="38"
+                    Margin="0,0,0,0"
+                    Background="Transparent" />
+            </dragablz:TabablzControl.HeaderPrefixContent>
+        </dragablz:TabablzControl>
+        <!--  标题栏右侧栏,关闭按钮,会员,试用等  -->
+        <StackPanel
+            Name="StkPnlRight"
+            HorizontalAlignment="Right"
+            Orientation="Horizontal"
+            WindowChrome.IsHitTestVisibleInChrome="True">
+            <Button
+                x:Name="Btn_Register"
+                Width="40"
+                Height="40"
+                Background="Transparent"
+                Command="{Binding OpenRegisterCommand}"
+                Style="{StaticResource subToolBar}"
+                Visibility="{Binding RegisterVis, Mode=TwoWay}">
+                <Border
+                    Width="28"
+                    Height="28"
+                    Background="{StaticResource color.icon.base.neutral.norm.lv1}"
+                    BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}"
+                    BorderThickness="1"
+                    CornerRadius="100">
+                    <Path
+                        Width="20"
+                        Height="20"
+                        Margin="-3,0,0,0"
                         Data="M12 13C14.2091 13 16 11.2091 16 9C16 6.79086 14.2091 5 12 5C9.79086 5 8 6.79086 8 9C8 11.2091 9.79086 13 12 13ZM12 31C17.5228 31 22 27.4183 22 23C22 18.5817 17.5228 15 12 15C6.47715 15 2 18.5817 2 23C2 27.4183 6.47715 31 12 31Z"
                         Fill="White" />
-                    </Border>
-                </Button>
-                <Button
-                    x:Name="Btn_Login"
-                    Width="40"
-                    Height="40"
-                    Background="Transparent"
-                    Style="{StaticResource subToolBar}"
-                    Visibility="{Binding LoginVis,Mode=TwoWay}"
-                    Command="{Binding OpenLoginCommand}"
-                     >
-                    <Border    BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}" Width="28" Height="28"  BorderThickness="1" CornerRadius="100" Background="{StaticResource color.icon.base.neutral.norm.lv1}">
-                        <Path
-                            Margin="-3,0,0,0"
+                </Border>
+            </Button>
+            <Button
+                x:Name="Btn_Login"
+                Width="40"
+                Height="40"
+                Background="Transparent"
+                Command="{Binding OpenLoginCommand}"
+                Style="{StaticResource subToolBar}"
+                Visibility="{Binding LoginVis, Mode=TwoWay}">
+                <Border
+                    Width="28"
+                    Height="28"
+                    Background="{StaticResource color.icon.base.neutral.norm.lv1}"
+                    BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}"
+                    BorderThickness="1"
+                    CornerRadius="100">
+                    <Path
                         Width="20"
                         Height="20"
+                        Margin="-3,0,0,0"
                         Data="M12 13C14.2091 13 16 11.2091 16 9C16 6.79086 14.2091 5 12 5C9.79086 5 8 6.79086 8 9C8 11.2091 9.79086 13 12 13ZM12 31C17.5228 31 22 27.4183 22 23C22 18.5817 17.5228 15 12 15C6.47715 15 2 18.5817 2 23C2 27.4183 6.47715 31 12 31Z"
                         Fill="White" />
-                    </Border>
-                </Button>
-                <Button
-                    x:Name="Btn_User"
-                    Width="40"
-                    Height="40"
-                    Background="Transparent"
-                    Style="{StaticResource subToolBar}"
-                    Visibility="{Binding UserVis,Mode=TwoWay}"
-                    Command="{Binding OpenUserCommand}"
-                    >
-                    <Border    BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}" Width="28" Height="28"  BorderThickness="1" CornerRadius="100" Background="#1770F4">
-                        <Path
-                            Margin="-3,0,0,0"
+                </Border>
+            </Button>
+            <Button
+                x:Name="Btn_User"
+                Width="40"
+                Height="40"
+                Background="Transparent"
+                Command="{Binding OpenUserCommand}"
+                Style="{StaticResource subToolBar}"
+                Visibility="{Binding UserVis, Mode=TwoWay}">
+                <Border
+                    Width="28"
+                    Height="28"
+                    Background="#1770F4"
+                    BorderBrush="{StaticResource color.icon.base.neutral.norm.lv1}"
+                    BorderThickness="1"
+                    CornerRadius="100">
+                    <Path
                         Width="20"
                         Height="20"
+                        Margin="-3,0,0,0"
                         Data="M12 13C14.2091 13 16 11.2091 16 9C16 6.79086 14.2091 5 12 5C9.79086 5 8 6.79086 8 9C8 11.2091 9.79086 13 12 13ZM12 31C17.5228 31 22 27.4183 22 23C22 18.5817 17.5228 15 12 15C6.47715 15 2 18.5817 2 23C2 27.4183 6.47715 31 12 31Z"
                         Fill="White" />
-                    </Border>
-                </Button>
-                <Separator BorderBrush="#94989C" BorderThickness="1">
-                    <Separator.LayoutTransform>
-                        <RotateTransform Angle="90" />
-                    </Separator.LayoutTransform>
-                </Separator>
-                <Button
-                    Name="BtnMiniSize"
-                    Width="40"
-                    Height="40"
-                    Background="Transparent"
-                    BorderThickness="0"
-                    Click="BtnMiniSize_Click"
-                    Style="{StaticResource TitleBarBtn}">
-                    <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 7 14 8 2 8 2 7">
-                        <Polygon.RenderTransform>
-                            <TransformGroup>
-                                <TranslateTransform Y="-3" />
-                            </TransformGroup>
-                        </Polygon.RenderTransform>
-                    </Polygon>
-                </Button>
-                <Button
-                    Name="BtnReStore"
-                    Width="40"
-                    Height="40"
-                    Background="Transparent"
-                    BorderThickness="0"
-                    Click="BtnReStore_Click"
-                    Style="{StaticResource TitleBarBtn}">
-                    <Grid>
-                        <Path
-                            x:Name="ico_max"
-                            Data="M14,2 L14,14 L2,14 L2,2 L14,2 Z M13,3 L3,3 L3,13 L13,13 L13,3 Z"
-                            Fill="{StaticResource color.btn.sec.text.def}"
-                            Visibility="Collapsed" />
-                        <Grid x:Name="ico_mini" Visibility="{Binding ElementName=ico_max, Path=Visibility, Converter={StaticResource UnvisibleConvert}}">
-                            <Path Data="M11,5 L11,14 L2,14 L2,5 L11,5 Z M10,6 L3,6 L3,13 L10,13 L10,6 Z" Fill="{StaticResource color.btn.sec.text.def}" />
-                            <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 2 14 11 11 11 11 10 13 10 13 3 6 3 6 5 5 5 5 2" />
-                        </Grid>
+                </Border>
+            </Button>
+            <Separator BorderBrush="#94989C" BorderThickness="1">
+                <Separator.LayoutTransform>
+                    <RotateTransform Angle="90" />
+                </Separator.LayoutTransform>
+            </Separator>
+            <Button
+                Name="BtnMiniSize"
+                Width="40"
+                Height="40"
+                Background="Transparent"
+                BorderThickness="0"
+                Click="BtnMiniSize_Click"
+                Style="{StaticResource TitleBarBtn}">
+                <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 7 14 8 2 8 2 7">
+                    <Polygon.RenderTransform>
+                        <TransformGroup>
+                            <TranslateTransform Y="-3" />
+                        </TransformGroup>
+                    </Polygon.RenderTransform>
+                </Polygon>
+            </Button>
+            <Button
+                Name="BtnReStore"
+                Width="40"
+                Height="40"
+                Background="Transparent"
+                BorderThickness="0"
+                Click="BtnReStore_Click"
+                Style="{StaticResource TitleBarBtn}">
+                <Grid>
+                    <Path
+                        x:Name="ico_max"
+                        Data="M14,2 L14,14 L2,14 L2,2 L14,2 Z M13,3 L3,3 L3,13 L13,13 L13,3 Z"
+                        Fill="{StaticResource color.btn.sec.text.def}"
+                        Visibility="Collapsed" />
+                    <Grid x:Name="ico_mini" Visibility="{Binding ElementName=ico_max, Path=Visibility, Converter={StaticResource UnvisibleConvert}}">
+                        <Path Data="M11,5 L11,14 L2,14 L2,5 L11,5 Z M10,6 L3,6 L3,13 L10,13 L10,6 Z" Fill="{StaticResource color.btn.sec.text.def}" />
+                        <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="14 2 14 11 11 11 11 10 13 10 13 3 6 3 6 5 5 5 5 2" />
                     </Grid>
-                </Button>
-                <Button
-                    Name="BtnClose"
-                    Width="40"
-                    Height="40"
-                    Background="Transparent"
-                    BorderThickness="0"
-                    Click="BtnClose_Click"
-                    Style="{StaticResource CloseBtn}">
-                    <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="11.2919922 12 12 11.2919922 6.70800781 6 12 0.708007813 11.2919922 0 6 5.29199219 0.708007812 9.76996262e-15 -2.27456942e-13 0.708007813 5.29199219 6 0 11.2919922 0.708007812 12 6 6.70800781" />
-                </Button>
-            </StackPanel>
+                </Grid>
+            </Button>
+            <Button
+                Name="BtnClose"
+                Width="40"
+                Height="40"
+                Background="Transparent"
+                BorderThickness="0"
+                Click="BtnClose_Click"
+                Style="{StaticResource CloseBtn}">
+                <Polygon Fill="{StaticResource color.btn.sec.text.def}" Points="11.2919922 12 12 11.2919922 6.70800781 6 12 0.708007813 11.2919922 0 6 5.29199219 0.708007812 9.76996262e-15 -2.27456942e-13 0.708007813 5.29199219 6 0 11.2919922 0.708007812 12 6 6.70800781" />
+            </Button>
+        </StackPanel>
 
-            <!--  OCR Progress Control  -->
-            <Grid Grid.RowSpan="2" Visibility="{Binding IsProcessVisible}">
-                <Grid.Background>
-                    <SolidColorBrush Opacity="0.05" Color="Black" />
-                </Grid.Background>
-                <Border
-                    Width="226"
-                    Height="58"
-                    Background="{StaticResource color.sys.layout.dark.bg}"
-                    BorderThickness="0"
-                    CornerRadius="{StaticResource border-radius.8}"
-                    Effect="{StaticResource shadow.neutral.m}">
-                    <Grid Margin="16,13" Background="Transparent">
-                        <StackPanel Orientation="Horizontal">
-                            <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="{Binding ProgressTitle}" />
-                            <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="{Binding Value, StringFormat={}({0})}" />
-                        </StackPanel>
-                        <Button
-                            Width="12"
-                            Height="12"
-                            HorizontalAlignment="Right"
-                            VerticalAlignment="Top"
-                            Command="{Binding CloseOCRCommand}" />
-                        <ProgressBar
-                            Height="4"
-                            Margin="0,0,0,4"
-                            VerticalAlignment="Bottom"
-                            BorderThickness="0"
-                            Foreground="{StaticResource color.slider.track-filled.norm}"
-                            Maximum="{Binding MaxValue}"
-                            Value="{Binding Value}" />
-                    </Grid>
-                </Border>
-            </Grid>
+        <!--  OCR Progress Control  -->
+        <Grid Grid.RowSpan="2" Visibility="{Binding IsProcessVisible}">
+            <Grid.Background>
+                <SolidColorBrush Opacity="0.05" Color="Black" />
+            </Grid.Background>
+            <Border
+                Width="226"
+                Height="58"
+                Background="{StaticResource color.sys.layout.dark.bg}"
+                BorderThickness="0"
+                CornerRadius="{StaticResource border-radius.8}"
+                Effect="{StaticResource shadow.neutral.m}">
+                <Grid Margin="16,13" Background="Transparent">
+                    <StackPanel Orientation="Horizontal">
+                        <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="{Binding ProgressTitle}" />
+                        <TextBlock Foreground="{StaticResource color.sys.text.anti.norm}" Text="{Binding Value, StringFormat={}({0})}" />
+                    </StackPanel>
+                    <Button
+                        Width="12"
+                        Height="12"
+                        HorizontalAlignment="Right"
+                        VerticalAlignment="Top"
+                        Command="{Binding CloseOCRCommand}" />
+                    <ProgressBar
+                        Height="4"
+                        Margin="0,0,0,4"
+                        VerticalAlignment="Bottom"
+                        BorderThickness="0"
+                        Foreground="{StaticResource color.slider.track-filled.norm}"
+                        Maximum="{Binding MaxValue}"
+                        Value="{Binding Value}" />
+                </Grid>
+            </Border>
         </Grid>
-    </Border>
+    </Grid>
 </Window>

+ 8 - 1
PDF Office/Views/ViewContent.xaml.cs

@@ -202,7 +202,14 @@ namespace PDF_Office.Views
             var item = sender as MenuItem;
             string[] filePath = new string[1];
             filePath[0] = item.Tag.ToString();
-            (this.DataContext as ViewContentViewModel).mainViewModel.OpenFile(filePath[0]);
+            if (App.OpenedFileList.Contains(filePath[0]))
+            {
+                (this.DataContext as ViewContentViewModel).mainViewModel.mainWindowViewModel.SelectItem(filePath[0]);
+            }
+            else
+            {
+                (this.DataContext as ViewContentViewModel).mainViewModel.mainWindowViewModel.AddTabItem(filePath[0]);
+            }
         }
 
         private void MenuDeleteAll_Click(object sender, RoutedEventArgs e)