[update] 随机点名的设置已经有效,托盘图标和托盤菜單基本完成(除了那个快捷键的没整之外),随机点名窗口小细节变动,其他小细节修复和Bug修复。

This commit is contained in:
Dubi906w 2024-06-13 19:34:37 +08:00
parent b5dd53ea22
commit 3433d2b14d
16 changed files with 633 additions and 68 deletions

View File

@ -2,20 +2,235 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:Ink_Canvas"
StartupUri="MainWindow.xaml"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern">
xmlns:tb="http://www.hardcodet.net/taskbar"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<Style TargetType="ui:ScrollViewerEx">
<EventSetter Event="PreviewMouseWheel" Handler="ScrollViewer_PreviewMouseWheel"/>
</Style>
<Style TargetType="ui:FontIcon">
<Setter Property="FontSize" Value="20"/>
</Style>
<Style TargetType="ui:SymbolIcon">
<Setter Property="FontSize" Value="20"/>
</Style>
<ResourceDictionary.MergedDictionaries>
<ContextMenu Opened="SysTrayMenu_Opened" x:Shared="false" x:Key="SysTrayMenu" Padding="6" ui:ThemeManager.RequestedTheme="Light">
<MenuItem IsCheckable="True" IsChecked="False" Checked="HideICCMainWindowTrayIconMenuItem_Checked" Unchecked="HideICCMainWindowTrayIconMenuItem_UnChecked" Name="HideICCMainWindowTrayIconMenuItem">
<MenuItem.Header>
<ui:SimpleStackPanel Orientation="Horizontal" Margin="-4,0,0,0">
<TextBlock Name="HideICCMainWindowTrayIconMenuItemHeaderText" FontSize="14" VerticalAlignment="Center" Foreground="#18181b" Text="隐藏ICC主窗口" />
</ui:SimpleStackPanel>
</MenuItem.Header>
<MenuItem.Icon>
<Image Width="28" Height="28" Margin="-2">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#27272a" Geometry="F0 M24,24z M0,0z M5,6C4.73478,6 4.48043,6.10536 4.29289,6.29289 4.10536,6.48043 4,6.73478 4,7L4,17C4,17.2652 4.10536,17.5196 4.29289,17.7071 4.48043,17.8946 4.73478,18 5,18L19,18C19.2652,18 19.5196,17.8946 19.7071,17.7071 19.8946,17.5196 20,17.2652 20,17L20,7C20,6.73478 19.8946,6.48043 19.7071,6.29289 19.5196,6.10536 19.2652,6 19,6L5,6z M2.87868,4.87868C3.44129,4.31607,4.20435,4,5,4L19,4C19.7957,4 20.5587,4.31607 21.1213,4.87868 21.6839,5.44129 22,6.20435 22,7L22,17C22,17.7957 21.6839,18.5587 21.1213,19.1213 20.5587,19.6839 19.7957,20 19,20L5,20C4.20435,20 3.44129,19.6839 2.87868,19.1213 2.31607,18.5587 2,17.7956 2,17L2,7C2,6.20435,2.31607,5.44129,2.87868,4.87868z M5,8C5,7.44772,5.44772,7,6,7L6.01,7C6.56228,7 7.01,7.44772 7.01,8 7.01,8.55228 6.56228,9 6.01,9L6,9C5.44772,9,5,8.55228,5,8z M9,7C8.44772,7 8,7.44772 8,8 8,8.55228 8.44772,9 9,9L9.01,9C9.56228,9 10.01,8.55228 10.01,8 10.01,7.44772 9.56228,7 9.01,7L9,7z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
<Separator Margin="0,3" />
<MenuItem>
<MenuItem.Header>
<ui:SimpleStackPanel Orientation="Horizontal" Margin="-4,0,0,0">
<TextBlock FontSize="14" VerticalAlignment="Center" Foreground="#18181b" Text="禁用所有快捷键" />
</ui:SimpleStackPanel>
</MenuItem.Header>
<MenuItem.Icon>
<Image Width="28" Height="28" Margin="-2">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#27272a" Geometry="F0 M24,24z M0,0z M3.29289,7.29289C3.48043,7.10536,3.73478,7,4,7L20,7C20.2652,7 20.5196,7.10536 20.7071,7.29289 20.8946,7.48043 21,7.73478 21,8L21,16C21,16.2652 20.8946,16.5196 20.7071,16.7071 20.5196,16.8946 20.2652,17 20,17L4,17C3.73478,17 3.48043,16.8946 3.29289,16.7071 3.10536,16.5196 3,16.2652 3,16L3,8C3,7.73478,3.10536,7.48043,3.29289,7.29289z M4,5C3.20435,5 2.44129,5.31607 1.87868,5.87868 1.31607,6.44129 1,7.20435 1,8L1,16C1,16.7956 1.31607,17.5587 1.87868,18.1213 2.44129,18.6839 3.20435,19 4,19L20,19C20.7957,19 21.5587,18.6839 22.1213,18.1213 22.6839,17.5587 23,16.7957 23,16L23,8C23,7.20435 22.6839,6.44129 22.1213,5.87868 21.5587,5.31607 20.7957,5 20,5L4,5z M7,10C7,9.44772 6.55228,9 6,9 5.44772,9 5,9.44772 5,10L5,10.01C5,10.5623 5.44772,11.01 6,11.01 6.55228,11.01 7,10.5623 7,10.01L7,10z M10,9C10.5523,9,11,9.44772,11,10L11,10.01C11,10.5623 10.5523,11.01 10,11.01 9.44771,11.01 9,10.5623 9,10.01L9,10C9,9.44772,9.44771,9,10,9z M15,10C15,9.44772 14.5523,9 14,9 13.4477,9 13,9.44772 13,10L13,10.01C13,10.5623 13.4477,11.01 14,11.01 14.5523,11.01 15,10.5623 15,10.01L15,10z M18,9C18.5523,9,19,9.44772,19,10L19,10.01C19,10.5623 18.5523,11.01 18,11.01 17.4477,11.01 17,10.5623 17,10.01L17,10C17,9.44772,17.4477,9,18,9z M7,14C7,13.4477 6.55228,13 6,13 5.44772,13 5,13.4477 5,14L5,14.01C5,14.5623 5.44772,15.01 6,15.01 6.55228,15.01 7,14.5623 7,14.01L7,14z M18,13C18.5523,13,19,13.4477,19,14L19,14.01C19,14.5623 18.5523,15.01 18,15.01 17.4477,15.01 17,14.5623 17,14.01L17,14C17,13.4477,17.4477,13,18,13z M10.0025,13C9.45022,12.9986 9.00138,13.4452 9,13.9975 8.99862,14.5498 9.44522,14.9986 9.9975,15L13.9975,15.01C14.5498,15.0114 14.9986,14.5648 15,14.0125 15.0014,13.4602 14.5548,13.0114 14.0025,13.01L10.0025,13z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
<MenuItem Name="ForceFullScreenTrayIconMenuItem" Click="ForceFullScreenTrayIconMenuItem_Clicked">
<MenuItem.Header>
<ui:SimpleStackPanel Orientation="Horizontal" Margin="-4,0,0,0">
<TextBlock FontSize="14" VerticalAlignment="Center" Foreground="#18181b" Text="强制全屏化" />
<ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="4" Margin="16,0,0,0">
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="CTRL" />
</Border>
<TextBlock FontSize="10" Foreground="#3f3f46" Text="+" />
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="F" />
</Border>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</MenuItem.Header>
<MenuItem.Icon>
<Image Width="28" Height="28" Margin="-2">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#27272a" Geometry="F0 M24,24z M0,0z M3.61722,3.07588C3.4962,3.12606 3.38717,3.19933 3.29562,3.29018 3.39086,3.19565 3.50039,3.12422 3.61722,3.07588z" />
<GeometryDrawing Brush="#27272a" Geometry="F1 M24,24z M0,0z M8,3L4,3C3.86441,3 3.73512,3.02699 3.61722,3.07588 3.4962,3.12606 3.38717,3.19933 3.29562,3.29018 3.20228,3.38281 3.1271,3.49373 3.07592,3.61711 3.027,3.73504 3,3.86437 3,4L3,8C3,8.55228 3.44772,9 4,9 4.55228,9 5,8.55228 5,8L5,6.41421 9.29289,10.7071C9.68342,11.0976 10.3166,11.0976 10.7071,10.7071 11.0976,10.3166 11.0976,9.68342 10.7071,9.29289L6.41421,5 8,5C8.55228,5 9,4.55228 9,4 9,3.44772 8.55228,3 8,3z" />
<GeometryDrawing Brush="#27272a" Geometry="F1 M24,24z M0,0z M16,3C15.4477,3 15,3.44772 15,4 15,4.55228 15.4477,5 16,5L17.5858,5 13.2929,9.29289C12.9024,9.68342 12.9024,10.3166 13.2929,10.7071 13.6834,11.0976 14.3166,11.0976 14.7071,10.7071L19,6.41421 19,8C19,8.55228 19.4477,9 20,9 20.5523,9 21,8.55228 21,8L21,4C21,3.44772,20.5523,3,20,3L16,3z" />
<GeometryDrawing Brush="#27272a" Geometry="F1 M24,24z M0,0z M21,16C21,15.4477 20.5523,15 20,15 19.4477,15 19,15.4477 19,16L19,17.5858 14.7071,13.2929C14.3166,12.9024 13.6834,12.9024 13.2929,13.2929 12.9024,13.6834 12.9024,14.3166 13.2929,14.7071L17.5858,19 16,19C15.4477,19 15,19.4477 15,20 15,20.5523 15.4477,21 16,21L20,21C20.5523,21,21,20.5523,21,20L21,16z" />
<GeometryDrawing Brush="#27272a" Geometry="F1 M24,24z M0,0z M5,16C5,15.4477 4.55228,15 4,15 3.44772,15 3,15.4477 3,16L3,20C3,20.5523,3.44772,21,4,21L8,21C8.55228,21 9,20.5523 9,20 9,19.4477 8.55228,19 8,19L6.41421,19 10.7071,14.7071C11.0976,14.3166 11.0976,13.6834 10.7071,13.2929 10.3166,12.9024 9.68342,12.9024 9.29289,13.2929L5,17.5858 5,16z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
<MenuItem Name="FoldFloatingBarTrayIconMenuItem" Click="FoldFloatingBarTrayIconMenuItem_Clicked">
<MenuItem.Header>
<ui:SimpleStackPanel Orientation="Horizontal" Margin="-4,0,0,0">
<TextBlock Name="FoldFloatingBarTrayIconMenuItemHeaderText" FontSize="14" VerticalAlignment="Center" Foreground="#18181b" Text="切换为收纳模式" />
<ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="4" Margin="16,0,0,0">
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="CTRL" />
</Border>
<TextBlock FontSize="10" Foreground="#3f3f46" Text="+" />
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="S" />
</Border>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</MenuItem.Header>
<MenuItem.Icon>
<Grid>
<Image Width="28" Height="28" Margin="-2" x:Name="FoldFloatingBarTrayIconMenuItemIconEyeOff" Visibility="Hidden">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#27272a" Geometry="F0 M24,24z M0,0z M17.3074,15.8932L3.70711,2.29289C3.31658,1.90237 2.68342,1.90237 2.29289,2.29289 1.90237,2.68342 1.90237,3.31658 2.29289,3.70711L5.77595,7.19016C4.41908,8.25997 3.21193,9.70316 2.14251,11.4855 1.9525,11.8022 1.9525,12.1978 2.14251,12.5145 4.66152,16.7129 7.94268,18.9988 11.9967,19 13.5692,19.0099 15.1164,18.638 16.5073,17.9215L20.2929,21.7071C20.6834,22.0976 21.3166,22.0976 21.7071,21.7071 22.0976,21.3166 22.0976,20.6834 21.7071,20.2929L17.4597,16.0455C17.4139,15.9885,17.3627,15.9376,17.3074,15.8932z M12,15.0011C11.2044,15.0012 10.4412,14.6853 9.87852,14.1227 9.3158,13.5602 8.99959,12.7972 8.99945,12.0015 8.99937,11.5492 9.10142,11.1075 9.29284,10.7071L7.20216,8.61637C6.1303,9.41883 5.11853,10.537 4.17707,12.0001 6.39041,15.4411 9.00116,17 12,17L12.0066,17C13.0383,17.0068,14.0564,16.8067,15.0021,16.4163L13.2934,14.7077C12.8933,14.8989,12.452,15.001,12,15.0011z" />
<GeometryDrawing Brush="#27272a" Geometry="F1 M24,24z M0,0z M11.9974,7.00003C11.4537,6.99862 10.9113,7.05227 10.3784,7.16015 9.83711,7.26973 9.30946,6.91975 9.19988,6.37844 9.0903,5.83714 9.44028,5.30949 9.98159,5.19991 10.6464,5.06534 11.323,4.99837 12.0013,5.00003 16.0563,5.00051 19.3381,7.2865 21.8575,11.4855 22.0475,11.8022 22.0475,12.1978 21.8575,12.5145 21.1604,13.6763 20.405,14.6934 19.5887,15.5569 19.2094,15.9583 18.5765,15.9761 18.1751,15.5968 17.7737,15.2174 17.7559,14.5845 18.1353,14.1831 18.7203,13.5641 19.2838,12.8377 19.8229,11.9999 17.6096,8.55894 14.9988,7.00003 12,7.00003L11.9974,7.00003z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Image Width="28" Height="28" Margin="-2" x:Name="FoldFloatingBarTrayIconMenuItemIconEyeOn" Visibility="Hidden">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#27272a" Geometry="F1 M24,24z M0,0z M9.87868,9.87868C10.4413,9.31607 11.2043,9 12,9 12.7957,9 13.5587,9.31607 14.1213,9.87868 14.6839,10.4413 15,11.2043 15,12 15,12.7957 14.6839,13.5587 14.1213,14.1213 13.5587,14.6839 12.7957,15 12,15 11.2043,15 10.4413,14.6839 9.87868,14.1213 9.31607,13.5587 9,12.7957 9,12 9,11.2043 9.31607,10.4413 9.87868,9.87868z" />
<GeometryDrawing Brush="#27272a" Geometry="F0 M24,24z M0,0z M12,5C7.94444,5 4.66219,7.28603 2.14251,11.4855 1.9525,11.8022 1.9525,12.1978 2.14251,12.5145 4.66219,16.714 7.94444,19 12,19 16.0556,19 19.3378,16.714 21.8575,12.5145 22.0475,12.1978 22.0475,11.8022 21.8575,11.4855 19.3378,7.28603 16.0556,5 12,5z M12,17C9.00114,17 6.39038,15.4411 4.17703,12 6.39038,8.55893 9.00114,7 12,7 14.9989,7 17.6096,8.55893 19.823,12 17.6096,15.4411 14.9989,17 12,17z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</Grid>
</MenuItem.Icon>
</MenuItem>
<MenuItem Name="ResetFloatingBarPositionTrayIconMenuItem" Click="ResetFloatingBarPositionTrayIconMenuItem_Clicked">
<MenuItem.Header>
<ui:SimpleStackPanel Orientation="Horizontal" Margin="-4,0,0,0">
<TextBlock FontSize="14" VerticalAlignment="Center" Foreground="#18181b" Text="重置工具栏位置" />
<ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="4" Margin="16,0,0,0">
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="CTRL" />
</Border>
<TextBlock FontSize="10" Foreground="#3f3f46" Text="+" />
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="T" />
</Border>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</MenuItem.Header>
<MenuItem.Icon>
<Image Width="28" Height="28" Margin="-2">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#27272a" Geometry="F0 M24,24z M0,0z M12,7C10.9391,7 9.92172,7.42143 9.17157,8.17157 8.42143,8.92172 8,9.93913 8,11 8,12.0609 8.42143,13.0783 9.17157,13.8284 9.92172,14.5786 10.9391,15 12,15 13.0609,15 14.0783,14.5786 14.8284,13.8284 15.5786,13.0783 16,12.0609 16,11 16,9.93913 15.5786,8.92172 14.8284,8.17157 14.0783,7.42143 13.0609,7 12,7z M10.5858,9.58579C10.9609,9.21071 11.4696,9 12,9 12.5304,9 13.0391,9.21071 13.4142,9.58579 13.7893,9.96086 14,10.4696 14,11 14,11.5304 13.7893,12.0391 13.4142,12.4142 13.0391,12.7893 12.5304,13 12,13 11.4696,13 10.9609,12.7893 10.5858,12.4142 10.2107,12.0391 10,11.5304 10,11 10,10.4696 10.2107,9.96086 10.5858,9.58579z" />
<GeometryDrawing Brush="#27272a" Geometry="F0 M24,24z M0,0z M12,2.00024C10.22,2.00024 8.47995,2.52807 6.99992,3.51699 5.51989,4.5059 4.36633,5.91148 3.68513,7.55599 3.00393,9.20049 2.82567,11.0101 3.1729,12.7559 3.52013,14.5017 4.37725,16.1053 5.63588,17.364L9.87998,21.6071C10.4425,22.1691 11.2054,22.485 12.0005,22.485 12.7956,22.485 13.5582,22.1694 14.1208,21.6074L18.3641,17.3641C19.6227,16.1054 20.4799,14.5017 20.8271,12.7559 21.1743,11.0101 20.9961,9.20049 20.3149,7.55599 19.6337,5.91148 18.4801,4.5059 17.0001,3.51699 15.5201,2.52807 13.78,2.00024 12,2.00024z M8.11105,5.17993C9.26219,4.41078 10.6156,4.00024 12,4.00024 13.3845,4.00024 14.7378,4.41078 15.889,5.17993 17.0401,5.94909 17.9373,7.04232 18.4671,8.32138 18.997,9.60044 19.1356,11.0079 18.8655,12.3657 18.5955,13.7236 17.9288,14.9709 16.9499,15.9498L12.7073,20.1925C12.5197,20.3798 12.2655,20.485 12.0005,20.485 11.7355,20.485 11.4813,20.3798 11.2938,20.1925L7.05013,15.9499C6.07125,14.9709 5.40454,13.7236 5.13448,12.3657 4.86441,11.0079 5.00306,9.60044 5.53288,8.32138 6.06271,7.04232 6.95991,5.94909 8.11105,5.17993z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
<Separator Margin="0,3" />
<MenuItem Name="RestartAppTrayIconMenuItem" Click="RestartAppTrayIconMenuItem_Clicked">
<MenuItem.Header>
<ui:SimpleStackPanel Orientation="Horizontal" Margin="-4,0,0,0">
<TextBlock FontSize="14" FontWeight="Bold" VerticalAlignment="Center" Foreground="#2563eb" Text="重启软件" />
<ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="4" Margin="16,0,0,0">
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="CTRL" />
</Border>
<TextBlock FontSize="10" Foreground="#3f3f46" Text="+" />
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="R" />
</Border>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</MenuItem.Header>
<MenuItem.Icon>
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#2563eb"
Geometry="F1 M24,24z M0,0z M6.34315,6.34315C7.84299,4.8433 9.87707,4.0005 11.9981,4 14.2527,4.00897 16.4167,4.88785 18.039,6.45324L18.5858,7 16,7C15.4477,7 15,7.44772 15,8 15,8.55228 15.4477,9 16,9L21,9C21.1356,9 21.2649,8.97301 21.3828,8.92412 21.5007,8.87532 21.6112,8.80298 21.7071,8.70711 21.8902,8.52405 21.9874,8.28768 21.9989,8.04797 21.9996,8.03199 22,8.016 22,8L22,3C22,2.44772 21.5523,2 21,2 20.4477,2 20,2.44772 20,3L20,5.58579 19.4471,5.03289 19.435,5.02103C17.4405,3.09289,14.7779,2.01044,12.0038,2L12,2C9.34784,2 6.8043,3.05357 4.92893,4.92893 3.05357,6.8043 2,9.34784 2,12 2,12.5523 2.44772,13 3,13 3.55228,13 4,12.5523 4,12 4,9.87827 4.84285,7.84344 6.34315,6.34315z" />
<GeometryDrawing Brush="#2563eb"
Geometry="F1 M24,24z M0,0z M22,12C22,14.6522 20.9464,17.1957 19.0711,19.0711 17.1957,20.9464 14.6522,22 12,22L11.9962,22C9.22213,21.9896,6.55946,20.9071,4.56496,18.979L4.55289,18.9671 4,18.4142 4,21C4,21.5523 3.55228,22 3,22 2.44772,22 2,21.5523 2,21L2,16.0002C2,15.8646 2.02699,15.7351 2.07588,15.6172 2.12432,15.5001 2.19595,15.3904 2.29078,15.295 2.29219,15.2936 2.2936,15.2922 2.29502,15.2908 2.48924,15.0977 2.74301,15.0008 2.997,15 2.998,15 2.999,15 3,15L8,15C8.55228,15 9,15.4477 9,16 9,16.5523 8.55228,17 8,17L5.41421,17 5.96095,17.5467C7.5833,19.1122 9.74736,19.9911 12.002,20 14.123,19.9995 16.157,19.1567 17.6569,17.6569 19.1571,16.1566 20,14.1217 20,12 20,11.4477 20.4477,11 21,11 21.5523,11 22,11.4477 22,12z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
<MenuItem Name="CloseAppTrayIconMenuItem" Click="CloseAppTrayIconMenuItem_Clicked">
<MenuItem.Header>
<ui:SimpleStackPanel Orientation="Horizontal" Margin="-4,0,0,0">
<TextBlock FontSize="14" FontWeight="Bold" VerticalAlignment="Center" Foreground="#dc2626" Text="退出软件" />
<ui:SimpleStackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="4" Margin="16,0,0,0">
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="CTRL" />
</Border>
<TextBlock FontSize="10" Foreground="#3f3f46" Text="+" />
<Border Padding="4,2,4,1" Background="#e4e4e7" BorderBrush="#a1a1aa" BorderThickness="1" CornerRadius="2.5">
<TextBlock FontSize="8" Foreground="#3f3f46" FontWeight="Bold" Text="Q" />
</Border>
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</MenuItem.Header>
<MenuItem.Icon>
<Image Width="24" Height="24">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#dc2626"
Geometry="F1 M24,24z M0,0z M13,2C13,1.44772 12.5523,1 12,1 11.4477,1 11,1.44772 11,2L11,12C11,12.5523 11.4477,13 12,13 12.5523,13 13,12.5523 13,12L13,2z" />
<GeometryDrawing Brush="#dc2626"
Geometry="F1 M24,24z M0,0z M19.1073,5.89303C18.7168,5.50243 18.0837,5.50232 17.6931,5.89277 17.3025,6.28322 17.3024,6.91639 17.6928,7.30698 18.8098,8.42441 19.571,9.84758 19.8802,11.397 20.1894,12.9464 20.0329,14.5528 19.4305,16.0134 18.828,17.474 17.8065,18.7235 16.4948,19.6043 15.1831,20.4851 13.64,20.9578 12.06,20.9628 10.48,20.9677 8.93392,20.5047 7.61674,19.6321 6.29956,18.7595 5.27025,17.5164 4.65863,16.0596 4.04701,14.6028 3.88046,12.9975 4.17999,11.4462 4.47952,9.89485 5.23171,8.46694 6.3417,7.34254 6.7297,6.9495 6.72562,6.31635 6.33258,5.92835 5.93955,5.54036 5.3064,5.54444 4.9184,5.93747 3.5309,7.34298 2.59067,9.12786 2.21626,11.067 1.84185,13.0062 2.05003,15.0128 2.81456,16.8338 3.57909,18.6549 4.86572,20.2087 6.5122,21.2994 8.15867,22.3902 10.0913,22.9689 12.0662,22.9627 14.0412,22.9566 15.9701,22.3657 17.6098,21.2647 19.2494,20.1637 20.5262,18.6018 21.2793,16.776 22.0324,14.9502 22.2281,12.9424 21.8415,11.0056 21.455,9.06878 20.5036,7.28981 19.1073,5.89303z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
</MenuItem.Icon>
</MenuItem>
</ContextMenu>
<tb:TaskbarIcon x:Key="TaskbarTrayIcon"
ToolTipText="InkCanvasForClass"
ContextMenu="{StaticResource SysTrayMenu}"
IconSource="/Resources/icc.ico"/>
<ResourceDictionary.MergedDictionaries>
<ui:ThemeResources RequestedTheme="Light"/>
<ui:XamlControlsResources />
<ResourceDictionary Source="Resources/SeewoImageDictionary.xaml"/>

View File

@ -1,10 +1,13 @@
using Ink_Canvas.Helpers;
using Hardcodet.Wpf.TaskbarNotification;
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Controls;
using System;
using System.Linq;
using System.Reflection;
using System.Windows;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using MessageBox = System.Windows.MessageBox;
using Window = System.Windows.Window;
namespace Ink_Canvas
{
@ -31,6 +34,8 @@ namespace Ink_Canvas
e.Handled = true;
}
private TaskbarIcon _taskbar;
void App_Startup(object sender, StartupEventArgs e)
{
/*if (!StoreHelper.IsStoreApp) */RootPath = AppDomain.CurrentDomain.SetupInformation.ApplicationBase;
@ -48,6 +53,8 @@ namespace Ink_Canvas
Environment.Exit(0);
}
_taskbar = (TaskbarIcon)FindResource("Taskbar");
StartArgs = e.Args;
}

View File

@ -8,7 +8,7 @@ using System.Timers;
namespace Ink_Canvas.Helpers
{
internal class DelayAction
public class DelayAction
{
Timer _timerDebounce;

View File

@ -22,27 +22,27 @@
<ApplicationVersion>2.0.2.%2a</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>false</BootstrapperEnabled>
<GenerateAssemblyInfo>false</GenerateAssemblyInfo>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
<UseWPF>true</UseWPF>
<Configurations>Debug;Release;x86 Debug</Configurations>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugType>full</DebugType>
<DebugType>embedded</DebugType>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Prefer32Bit>True</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='x86 Debug|AnyCPU'">
<DebugType>full</DebugType>
<DebugType>embedded</DebugType>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Prefer32Bit>True</Prefer32Bit>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>full</DebugType>
<DebugType>embedded</DebugType>
<OutputPath>bin\$(Configuration)\</OutputPath>
<Prefer32Bit>True</Prefer32Bit>
</PropertyGroup>
<PropertyGroup>
<ApplicationIcon>icc.ico</ApplicationIcon>
<ApplicationIcon>Resources\icc.ico</ApplicationIcon>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<OutputPath>bin\$(Platform)\$(Configuration)\</OutputPath>
@ -138,6 +138,7 @@
<None Include="app.manifest" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Hardcodet.NotifyIcon.Wpf" Version="1.1.0" />
<PackageReference Include="iNKORE.UI.WPF.Modern" Version="0.9.27" />
<PackageReference Include="MdXaml" Version="1.27.0" />
<PackageReference Include="Microsoft.Office.Interop.PowerPoint" Version="15.0.4420.1018" />
@ -189,6 +190,7 @@
<Resource Include="Resources\DeveloperAvatars\RaspberryKan.jpg" />
<Resource Include="Resources\DeveloperAvatars\wwei.png" />
<Resource Include="Resources\DeveloperAvatars\yuwenhui2020.png" />
<Resource Include="Resources\icc.ico" />
<Resource Include="Resources\Icons-png\AdmoxBooth.png" />
<Resource Include="Resources\Icons-png\AdmoxWhiteboard.png" />
<Resource Include="Resources\Icons-png\check-box-background.png" />
@ -464,10 +466,6 @@
<Resource Include="Resources\new-icons\undo.png" />
</ItemGroup>
<ItemGroup>
<Resource Include="Resources\icc.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="icc.ico" />
<Resource Include="Resources\new-icons\unfold-chevron.png" />
<Resource Include="Resources\new-icons\zoom.png" />
</ItemGroup>
@ -475,6 +473,7 @@
<Compile Remove="AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Remove="MainWindow.xaml~RF6c3144.TMP" />
<None Remove="Resources\Cursors\Cursor.cur" />
<None Remove="Resources\Cursors\Pen.cur" />
<None Remove="Resources\DeveloperAvatars\aaaaaaccd.jpg" />
@ -484,6 +483,7 @@
<None Remove="Resources\DeveloperAvatars\RaspberryKan.jpg" />
<None Remove="Resources\DeveloperAvatars\wwei.png" />
<None Remove="Resources\DeveloperAvatars\yuwenhui2020.png" />
<None Remove="Resources\icc.ico" />
<None Remove="Resources\Icons-png\AdmoxBooth.png" />
<None Remove="Resources\Icons-png\AdmoxWhiteboard.png" />
<None Remove="Resources\Icons-png\Donview.png" />

View File

@ -596,14 +596,46 @@
<ComboBoxItem Content="笔" FontFamily="Microsoft YaHei UI" />
</ComboBox>
</ui:SimpleStackPanel>
<!--
<TextBlock Text="颜色主题" FontFamily="Microsoft YaHei UI" FontSize="14"/>
<ComboBox Name="ComboBoxTheme" FontFamily="Microsoft YaHei UI" SelectedIndex="0" SelectionChanged="ComboBoxTheme_SelectionChanged">
<ComboBoxItem Content="浅色(默认)" FontFamily="Microsoft YaHei UI"/>
<ComboBoxItem Content="深色" FontFamily="Microsoft YaHei UI"/>
<ComboBoxItem Content="跟随系统" FontFamily="Microsoft YaHei UI"/>
</ComboBox>
-->
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
<Border Background="#101010" Height="50" Margin="-20,0" Padding="20,0">
<Grid>
<ui:SimpleStackPanel Orientation="Horizontal" FlowDirection="RightToLeft">
<Image Height="24" Width="24" Margin="16,0,0,0">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H19 V0 H0 Z">
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M19,17z M0,0z M14.8268,0.0699463C15.3572,0.600333 15.8257,1.17492 16.2323,1.7937 16.6448,2.41249 16.9925,3.06368 17.2754,3.74729 17.5583,4.42501 17.7704,5.12925 17.9119,5.86 18.0592,6.58486 18.1329,7.32151 18.1329,8.06995 18.1329,8.81838 18.0592,9.55798 17.9119,10.2887 17.7704,11.0136 17.5583,11.7178 17.2754,12.4014 16.9925,13.0792 16.6448,13.7274 16.2323,14.3462 15.8257,14.965 15.3572,15.5396 14.8268,16.0699L14.0312,15.2744C14.5086,14.797 14.9299,14.2814 15.2953,13.7274 15.6666,13.1676 15.9789,12.5812 16.2323,11.9683 16.4857,11.3554 16.6773,10.7219 16.8069,10.0677 16.9424,9.4077 17.0102,8.74177 17.0102,8.06995 17.0102,7.39812 16.9424,6.73514 16.8069,6.081 16.6773,5.42096 16.4857,4.7845 16.2323,4.1716 15.9789,3.55871 15.6666,2.97529 15.2953,2.42133 14.9299,1.86147 14.5086,1.34287 14.0312,0.865526L14.8268,0.0699463z M12.4312,2.46553C12.8025,2.8368 13.1296,3.24048 13.4124,3.67658 13.7012,4.10678 13.9428,4.56055 14.1373,5.0379 14.3377,5.51525 14.4879,6.01028 14.5881,6.52299 14.6942,7.03569 14.7472,7.55135 14.7472,8.06995 14.7472,8.59444 14.6942,9.11304 14.5881,9.62575 14.4879,10.1326 14.3377,10.6246 14.1373,11.102 13.9428,11.5793 13.7012,12.0361 13.4124,12.4722 13.1296,12.9024 12.8025,13.3031 12.4312,13.6744L11.6268,12.8699C12.2633,12.2335 12.7524,11.4998 13.0942,10.6688 13.4419,9.8379 13.6157,8.9716 13.6157,8.06995 13.6157,7.16829 13.4419,6.30199 13.0942,5.47105 12.7524,4.64011 12.2633,3.90641 11.6268,3.26995L12.4312,2.46553z M10.0268,4.86995C10.4511,5.29426 10.7782,5.78339 11.008,6.33735 11.2378,6.89131 11.3528,7.46884 11.3528,8.06995 11.3528,8.67105 11.2378,9.24858 11.008,9.80254 10.7782,10.3565 10.4511,10.8456 10.0268,11.2699L9.23121,10.4744C9.54944,10.1561 9.79401,9.79076 9.96491,9.37823 10.1358,8.95982 10.2213,8.52372 10.2213,8.06995 10.2213,7.61617 10.1358,7.18302 9.96491,6.7705 9.79401,6.35208 9.54944,5.98376 9.23121,5.66553L10.0268,4.86995z M6.02237,1.281L6.82679,1.281 6.82679,14.8589 6.02237,14.8589 2.6279,11.4644 0.0378418,11.4644 0.0378418,4.67547 2.6279,4.67547 6.02237,1.281z M5.6953,3.21691L3.10525,5.80696 1.16933,5.80696 1.16933,10.3329 3.10525,10.3329 5.6953,12.923 5.6953,3.21691z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Image Height="24" Width="24" Margin="8,0,0,0">
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V17 H22 V0 H0 Z">
<GeometryDrawing Brush="#FFFFFFFF" Geometry="F1 M22,17z M0,0z M21.3712,12.8727L12.0378,12.8727 12.0378,15.5393 16.0378,15.5393 16.0378,16.8727 6.70451,16.8727 6.70451,15.5393 10.7045,15.5393 10.7045,12.8727 4.03784,12.8727 4.03784,16.8727 2.70451,16.8727 2.70451,8.87268 0.0378418,8.87268 0.0378418,0.872681 21.3712,0.872681 21.3712,12.8727z M1.37118,2.20601L1.37118,3.53935 5.37118,3.53935 5.37118,2.20601 1.37118,2.20601z M1.37118,7.53935L5.37118,7.53935 5.37118,4.87268 4.03784,4.87268 4.03784,6.20601 2.70451,6.20601 2.70451,4.87268 1.37118,4.87268 1.37118,7.53935z M4.03784,11.5393L20.0378,11.5393 20.0378,2.20601 6.70451,2.20601 6.70451,8.87268 4.03784,8.87268 4.03784,11.5393z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<Image Name="ICCTrayIconExampleImage" Height="24" Width="24" Source="Resources/icc.ico" Margin="8,0,0,0"/>
</ui:SimpleStackPanel>
<TextBlock Margin="12,0,0,0" VerticalAlignment="Center" Text="任务栏托盘图标" FontWeight="Bold" Foreground="#fafafa"
FontSize="20" />
</Grid>
</Border>
<ui:SimpleStackPanel Orientation="Horizontal" HorizontalAlignment="Left">
<TextBlock Foreground="#fafafa" Text="启用托盘图标" VerticalAlignment="Center"
FontSize="14" Margin="0,0,16,0" />
<ui:ToggleSwitch OnContent="" OffContent="" Name="ToggleSwitchEnableTrayIcon"
IsOn="True" FontFamily="Microsoft YaHei UI" FontWeight="Bold"
Toggled="ToggleSwitchEnableTrayIcon_Toggled" />
</ui:SimpleStackPanel>
</ui:SimpleStackPanel>
</GroupBox>
<GroupBox>
@ -1461,7 +1493,7 @@
<ui:ToggleSwitch OnContent="" OffContent=""
Name="ToggleSwitchDisplayRandWindowNamesInputBtn"
IsOn="True" FontFamily="Microsoft YaHei UI"
FontWeight="Bold" />
FontWeight="Bold" Toggled="ToggleSwitchDisplayRandWindowNamesInputBtn_OnToggled" />
</ui:SimpleStackPanel>
<Line HorizontalAlignment="Center" X1="0" Y1="0" X2="400" Y2="0"
Stroke="#3f3f46" StrokeThickness="1" Margin="0,4,0,4" />
@ -1471,7 +1503,7 @@
<Slider x:Name="RandWindowOnceCloseLatencySlider" Minimum="0.5"
Maximum="8" Width="168" FontFamily="Microsoft YaHei UI"
FontSize="20" IsSnapToTickEnabled="True" Value="2.5"
TickFrequency="0.1"
TickFrequency="0.1" ValueChanged="RandWindowOnceCloseLatencySlider_ValueChanged"
TickPlacement="None" AutoToolTipPlacement="None" />
<StackPanel Orientation="Horizontal" VerticalAlignment="Center"
Margin="12,0,16,0">
@ -1485,6 +1517,7 @@
FontSize="14" Margin="0,0,16,0" />
<Slider x:Name="RandWindowOnceMaxStudentsSlider" Minimum="0"
Maximum="20" Width="168" FontFamily="Microsoft YaHei UI"
ValueChanged="RandWindowOnceMaxStudentsSlider_ValueChanged"
FontSize="20" IsSnapToTickEnabled="True" Value="10" TickFrequency="1"
TickPlacement="None" AutoToolTipPlacement="None" />
<TextBlock VerticalAlignment="Center" Margin="12,0,16,0" FontSize="14"
@ -5710,9 +5743,18 @@
MouseUp="CursorWithDelIcon_Click"
Background="Transparent" Orientation="Vertical"
HorizontalAlignment="Center" Width="28" Margin="0,-2">
<Image Source="/Resources/new-icons/cursor-clear.png"
RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17"
Margin="0,3,0,0" />
<Image RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17"
Margin="0,3,0,0" >
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF000000" Geometry="F0 M24,24z M0,0z M11.5007,11.0214C11.5007,10.674,11.7823,10.3923,12.1298,10.3923L14.2967,10.3923 14.2967,9.90299C14.2967,9.41878 14.5325,8.98723 14.8305,8.68924 15.1285,8.39124 15.56,8.15547 16.0442,8.15547L18.281,8.15547C18.7652,8.15547 19.1968,8.39124 19.4948,8.68924 19.7928,8.98723 20.0286,9.41878 20.0286,9.90299L20.0286,10.3923 22.1955,10.3923C22.5429,10.3923 22.8246,10.674 22.8246,11.0214 22.8246,11.3688 22.5429,11.6505 22.1955,11.6505L21.7062,11.6505 21.7062,18.8503C21.7062,19.3345 21.4704,19.766 21.1724,20.064 20.8744,20.362 20.4429,20.5978 19.9587,20.5978L14.3666,20.5978C13.8824,20.5978 13.4508,20.362 13.1528,20.064 12.8549,19.766 12.6191,19.3345 12.6191,18.8503L12.6191,11.6505 12.1298,11.6505C11.7823,11.6505,11.5007,11.3688,11.5007,11.0214z M14.0425,19.1743C13.9211,19.0529,13.8773,18.9253,13.8773,18.8503L13.8773,11.6505 20.448,11.6505 20.448,18.8503C20.448,18.9253 20.4041,19.0529 20.2827,19.1743 20.1613,19.2958 20.0337,19.3396 19.9587,19.3396L14.3666,19.3396C14.2916,19.3396,14.1639,19.2958,14.0425,19.1743z M15.5549,9.90299C15.5549,9.82799 15.5987,9.70034 15.7202,9.57893 15.8416,9.45752 15.9692,9.41368 16.0442,9.41368L18.281,9.41368C18.356,9.41368 18.4837,9.45752 18.6051,9.57893 18.7265,9.70034 18.7703,9.82799 18.7703,9.90299L18.7703,10.3923 15.5549,10.3923 15.5549,9.90299z M18.9101,13.8174C18.9101,13.47 18.6285,13.1883 18.281,13.1883 17.9336,13.1883 17.6519,13.47 17.6519,13.8174L17.6519,17.1727C17.6519,17.5201 17.9336,17.8018 18.281,17.8018 18.6285,17.8018 18.9101,17.5201 18.9101,17.1727L18.9101,13.8174z M16.6733,13.8174C16.6733,13.47 16.3917,13.1883 16.0442,13.1883 15.6968,13.1883 15.4151,13.47 15.4151,13.8174L15.4151,17.1727C15.4151,17.5201 15.6968,17.8018 16.0442,17.8018 16.3917,17.8018 16.6733,17.5201 16.6733,17.1727L16.6733,13.8174z M1.32567,3.55246C1.47265,3.40549,1.69379,3.36174,1.88566,3.44167L11.8342,7.58639C12.0311,7.66845 12.1567,7.86389 12.1495,8.07716 12.1424,8.29043 12.0039,8.47698 11.8018,8.54561L8.25047,9.75183 11.4309,12.9323C11.6313,13.1326 11.6313,13.4574 11.4309,13.6577 11.2306,13.8581 10.9058,13.8581 10.7055,13.6577L7.52503,10.4773 6.31881,14.0286C6.25019,14.2307 6.06364,14.3692 5.85037,14.3763 5.6371,14.3835 5.44166,14.2579 5.3596,14.0609L1.21488,4.11245C1.13494,3.92058,1.1787,3.69944,1.32567,3.55246z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="ClearAndMouseToolbarTextBlock" Text="清并鼠" Foreground="Black"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
@ -5819,9 +5861,18 @@
MouseUp="ImageBlackboard_MouseUp" Background="Transparent"
Orientation="Vertical" HorizontalAlignment="Center" Width="28"
Margin="0,-2">
<Image Source="/Resources/new-icons/blackboard.png"
RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17"
Margin="0,3,0,0" />
<Image RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17"
Margin="0,3,0,0" >
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF000000" Geometry="F0 M24,24z M0,0z M5,5.875C4.70163,5.875 4.41548,5.99353 4.2045,6.2045 3.99353,6.41548 3.875,6.70163 3.875,7L3.875,17C3.875,17.2984 3.99353,17.5845 4.2045,17.7955 4.41548,18.0065 4.70163,18.125 5,18.125L8,18.125C8.48325,18.125 8.875,18.5168 8.875,19 8.875,19.4832 8.48325,19.875 8,19.875L5,19.875C4.2375,19.875 3.50623,19.5721 2.96707,19.0329 2.4279,18.4938 2.125,17.7625 2.125,17L2.125,7C2.125,6.2375 2.4279,5.50624 2.96707,4.96707 3.50624,4.4279 4.2375,4.125 5,4.125L19,4.125C19.7625,4.125 20.4938,4.4279 21.0329,4.96707 21.5721,5.50623 21.875,6.2375 21.875,7L21.875,18C21.875,18.4973 21.6775,18.9742 21.3258,19.3258 20.9742,19.6775 20.4973,19.875 20,19.875 19.5168,19.875 19.125,19.4832 19.125,19 19.125,18.5168 19.5168,18.125 20,18.125 20.0332,18.125 20.0649,18.1118 20.0884,18.0884 20.1118,18.0649 20.125,18.0332 20.125,18L20.125,7C20.125,6.70163 20.0065,6.41548 19.7955,6.2045 19.5845,5.99353 19.2984,5.875 19,5.875L5,5.875z M10.6742,15.6742C11.0258,15.3225,11.5027,15.125,12,15.125L16,15.125C16.4973,15.125 16.9742,15.3225 17.3258,15.6742 17.6775,16.0258 17.875,16.5027 17.875,17L17.875,18C17.875,18.4973 17.6775,18.9742 17.3258,19.3258 16.9742,19.6775 16.4973,19.875 16,19.875L12,19.875C11.5027,19.875 11.0258,19.6775 10.6742,19.3258 10.3225,18.9742 10.125,18.4973 10.125,18L10.125,17C10.125,16.5027,10.3225,16.0258,10.6742,15.6742z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="WhiteboardToolbarTextBlock" Text="白板" Foreground="Black"
FontSize="8" Margin="0,1,0,0" TextAlignment="Center" />
</ui:SimpleStackPanel>
@ -5832,9 +5883,18 @@
MouseUp="SymbolIconTools_MouseUp" Background="Transparent"
Orientation="Vertical" HorizontalAlignment="Center" Width="28"
Margin="0,-2">
<Image Source="/Resources/new-icons/grid.png"
RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17"
Margin="0,3,0,0" />
<Image RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17"
Margin="0,3,0,0" >
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF1B1B1B" Geometry="F0 M24,24z M0,0z M4.41721,4.29873C4.35178,4.29873,4.29873,4.35178,4.29873,4.41721L4.29873,9.15646C4.29873,9.22189,4.35178,9.27494,4.41721,9.27494L9.15646,9.27494C9.22189,9.27494,9.27494,9.22189,9.27494,9.15646L9.27494,4.41721C9.27494,4.35178,9.22189,4.29873,9.15646,4.29873L4.41721,4.29873z M2.64,4.41721C2.64,3.43569,3.43569,2.64,4.41721,2.64L9.15646,2.64C10.138,2.64,10.9337,3.43569,10.9337,4.41721L10.9337,9.15646C10.9337,10.138,10.138,10.9337,9.15646,10.9337L4.41721,10.9337C3.43569,10.9337,2.64,10.138,2.64,9.15646L2.64,4.41721z M14.8435,4.29873C14.7781,4.29873,14.7251,4.35178,14.7251,4.41721L14.7251,9.15646C14.7251,9.22189,14.7781,9.27494,14.8435,9.27494L19.5828,9.27494C19.6482,9.27494,19.7013,9.22189,19.7013,9.15646L19.7013,4.41721C19.7013,4.35178,19.6482,4.29873,19.5828,4.29873L14.8435,4.29873z M13.0663,4.41721C13.0663,3.43569,13.862,2.64,14.8435,2.64L19.5828,2.64C20.5643,2.64,21.36,3.43569,21.36,4.41721L21.36,9.15646C21.36,10.138,20.5643,10.9337,19.5828,10.9337L14.8435,10.9337C13.862,10.9337,13.0663,10.138,13.0663,9.15646L13.0663,4.41721z M14.8435,14.7251C14.7781,14.7251,14.7251,14.7781,14.7251,14.8435L14.7251,19.5828C14.7251,19.6482,14.7781,19.7013,14.8435,19.7013L19.5828,19.7013C19.6482,19.7013,19.7013,19.6482,19.7013,19.5828L19.7013,14.8435C19.7013,14.7781,19.6482,14.7251,19.5828,14.7251L14.8435,14.7251z M13.0663,14.8435C13.0663,13.862,13.862,13.0663,14.8435,13.0663L19.5828,13.0663C20.5643,13.0663,21.36,13.862,21.36,14.8435L21.36,19.5828C21.36,20.5643,20.5643,21.36,19.5828,21.36L14.8435,21.36C13.862,21.36,13.0663,20.5643,13.0663,19.5828L13.0663,14.8435z M4.41721,14.7251C4.35178,14.7251,4.29873,14.7781,4.29873,14.8435L4.29873,19.5828C4.29873,19.6482,4.35178,19.7013,4.41721,19.7013L9.15646,19.7013C9.22189,19.7013,9.27494,19.6482,9.27494,19.5828L9.27494,14.8435C9.27494,14.7781,9.22189,14.7251,9.15646,14.7251L4.41721,14.7251z M2.64,14.8435C2.64,13.862,3.43569,13.0663,4.41721,13.0663L9.15646,13.0663C10.138,13.0663,10.9337,13.862,10.9337,14.8435L10.9337,19.5828C10.9337,20.5643,10.138,21.36,9.15646,21.36L4.41721,21.36C3.43569,21.36,2.64,20.5643,2.64,19.5828L2.64,14.8435z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="ToolsToolbarTextBlock" Text="工具" Foreground="Black"
FontSize="8"
Margin="0,1,0,0" TextAlignment="Center" />
@ -5846,9 +5906,18 @@
MouseUp="FoldFloatingBar_MouseUp" Background="Transparent"
Orientation="Vertical" HorizontalAlignment="Center" Width="28"
Margin="0,-2">
<Image Source="/Resources/new-icons/eye-off.png"
RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17"
Margin="0,3,0,0" />
<Image RenderOptions.BitmapScalingMode="HighQuality" Width="28" Height="17"
Margin="0,3,0,0" >
<Image.Source>
<DrawingImage>
<DrawingImage.Drawing>
<DrawingGroup ClipGeometry="M0,0 V24 H24 V0 H0 Z">
<GeometryDrawing Brush="#FF1B1B1B" Geometry="F1 M24,24z M0,0z M19.1634,15.0537C18.9999,15.0537 18.8278,15.0021 18.6902,14.8902 18.3632,14.6321 18.3116,14.1589 18.5783,13.832 19.0343,13.2642 19.4387,12.6447 19.7656,11.9909 19.172,10.8208 16.763,6.72556 11.9967,6.72556 11.6612,6.72556 11.3256,6.75137 10.9987,6.78579 10.5943,6.83741 10.2072,6.54489 10.1556,6.13193 10.1039,5.71896 10.3965,5.34041 10.8094,5.28879 11.1966,5.23717 11.5923,5.21136 11.9967,5.21136 18.4407,5.21136 21.1766,11.423 21.297,11.6897 21.383,11.8876 21.3744,12.1113 21.2884,12.3006 20.8754,13.1781 20.3592,14.0041 19.757,14.7612 19.6107,14.9418 19.387,15.0451 19.172,15.0451L19.1634,15.0537z M10.689,15.1483C11.0847,15.3118,11.5063,15.3892,11.9365,15.3892L11.9451,15.4064 12.0053,15.4064C12.4613,15.3978 12.8915,15.2946 13.3044,15.1139 13.4763,15.0387 13.6392,14.9486 13.7931,14.8455L15.4197,16.472 16.533,17.5854 20.0753,21.1277C20.2216,21.2826,20.4195,21.3514,20.6087,21.3514L20.6001,21.36C20.7894,21.36 20.9873,21.2826 21.1335,21.1363 21.4261,20.8438 21.4261,20.362 21.1335,20.0695L3.92668,2.86262C3.63416,2.5615 3.16958,2.57011 2.86846,2.86262 2.56734,3.15514 2.56734,3.62833 2.86846,3.92085L6.21371,7.2661C4.72738,8.44444 3.5311,9.95577 2.71359,11.6725 2.62756,11.8704 2.61896,12.0941 2.70499,12.292 2.81684,12.5587 5.55273,18.7704 12.0053,18.7704L12.0311,18.7704C13.6161,18.7704,15.1606,18.3654,16.533,17.5854L15.4197,16.472C14.3708,16.9906,13.2144,17.2648,12.0311,17.2648L12.0053,17.2648C7.239,17.2648 4.83004,13.1695 4.2364,11.9995 4.96897,10.5725 6.01289,9.32147 7.29011,8.3425L9.15767,10.2101C9.05523,10.3645 8.96629,10.5279 8.89086,10.7003 8.71018,11.1133 8.60694,11.5521 8.60694,11.9995 8.59834,12.4468 8.67577,12.8856 8.84784,13.3072 9.0113,13.7288 9.26081,14.0987 9.57913,14.417 9.89746,14.7354 10.2674,14.9763 10.689,15.1483z" />
</DrawingGroup>
</DrawingImage.Drawing>
</DrawingImage>
</Image.Source>
</Image>
<TextBlock x:Name="HideToolbarTextBlock" Text="隐藏" Foreground="Black"
FontSize="8"
Margin="0,1,0,0" TextAlignment="Center" />

View File

@ -211,7 +211,7 @@ namespace Ink_Canvas {
}).Start();
}
private DelayAction dpiChangedDelayAction = new DelayAction();
public DelayAction dpiChangedDelayAction = new DelayAction();
private void MainWindow_OnDpiChanged(object sender, DpiChangedEventArgs e)
{
@ -254,7 +254,7 @@ namespace Ink_Canvas {
}
[DllImport("user32.dll", SetLastError = true)]
internal static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
public static extern bool MoveWindow(IntPtr hWnd, int X, int Y, int nWidth, int nHeight, bool bRepaint);
private void MainWindow_OnSizeChanged(object sender, SizeChangedEventArgs e) {
if (Settings.Advanced.IsEnableForceFullScreen) {

View File

@ -13,7 +13,8 @@ using System.Windows.Media.Imaging;
namespace Ink_Canvas {
public partial class MainWindow : Window {
private bool isFloatingBarFolded = false, isFloatingBarChangingHideMode = false;
public bool isFloatingBarFolded = false;
private bool isFloatingBarChangingHideMode = false;
private void CloseWhiteboardImmediately() {
if (isDisplayingOrHidingBlackboard) return;
@ -35,11 +36,16 @@ namespace Ink_Canvas {
})).Start();
}
private async void FoldFloatingBar_MouseUp(object sender, MouseButtonEventArgs e) {
public async void FoldFloatingBar_MouseUp(object sender, MouseButtonEventArgs e) {
var isShouldRejectAction = false;
if (lastBorderMouseDownObject != null && lastBorderMouseDownObject is Panel)
((Panel)lastBorderMouseDownObject).Background = new SolidColorBrush(Colors.Transparent);
if (sender == Fold_Icon && lastBorderMouseDownObject != Fold_Icon) return;
await Dispatcher.InvokeAsync(() => {
if (lastBorderMouseDownObject != null && lastBorderMouseDownObject is Panel)
((Panel)lastBorderMouseDownObject).Background = new SolidColorBrush(Colors.Transparent);
if (sender == Fold_Icon && lastBorderMouseDownObject != Fold_Icon) isShouldRejectAction = true;
});
if (isShouldRejectAction) return;
// FloatingBarIcons_MouseUp_New(sender);
if (sender == null)
@ -179,7 +185,7 @@ namespace Ink_Canvas {
HideRightQuickPanel();
}
private async void UnFoldFloatingBar_MouseUp(object sender, MouseButtonEventArgs e) {
public async void UnFoldFloatingBar_MouseUp(object sender, MouseButtonEventArgs e) {
await Dispatcher.InvokeAsync(() => {
LeftUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;
RightUnFoldButtonQuickPanel.Visibility = Visibility.Collapsed;

View File

@ -732,7 +732,7 @@ namespace Ink_Canvas {
AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
new RandWindow().Show();
new RandWindow(Settings).Show();
}
public void CheckEraserTypeTab() {
@ -800,7 +800,7 @@ namespace Ink_Canvas {
AnimationsHelper.HideWithSlideAndFade(BorderTools);
AnimationsHelper.HideWithSlideAndFade(BoardBorderTools);
new RandWindow(true).ShowDialog();
new RandWindow(Settings,true).ShowDialog();
}
private void GridInkReplayButton_MouseUp(object sender, MouseButtonEventArgs e) {
@ -1039,7 +1039,7 @@ namespace Ink_Canvas {
private bool isViewboxFloatingBarMarginAnimationRunning = false;
private async void ViewboxFloatingBarMarginAnimation(int MarginFromEdge,
public async void ViewboxFloatingBarMarginAnimation(int MarginFromEdge,
bool PosXCaculatedWithTaskbarHeight = false) {
if (MarginFromEdge == 60) MarginFromEdge = 55;
await Dispatcher.InvokeAsync(() => {
@ -1105,6 +1105,94 @@ namespace Ink_Canvas {
});
}
public async void PureViewboxFloatingBarMarginAnimationInDesktopMode()
{
await Dispatcher.InvokeAsync(() => {
ViewboxFloatingBar.Visibility = Visibility.Visible;
isViewboxFloatingBarMarginAnimationRunning = true;
double dpiScaleX = 1, dpiScaleY = 1;
var source = PresentationSource.FromVisual(this);
if (source != null)
{
dpiScaleX = source.CompositionTarget.TransformToDevice.M11;
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
}
var windowHandle = new WindowInteropHelper(this).Handle;
var screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight -
SystemParameters.WindowCaptionHeight;
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
pos.Y = screenHeight - ViewboxFloatingBar.ActualHeight * ViewboxFloatingBarScaleTransform.ScaleY -
toolbarHeight - ViewboxFloatingBarScaleTransform.ScaleY * 3;
if (pointDesktop.X != -1 || pointDesktop.Y != -1) pointDesktop = pos;
var marginAnimation = new ThicknessAnimation
{
Duration = TimeSpan.FromSeconds(0.35),
From = ViewboxFloatingBar.Margin,
To = new Thickness(pos.X, pos.Y, 0, -20)
};
marginAnimation.EasingFunction = new CircleEase();
ViewboxFloatingBar.BeginAnimation(MarginProperty, marginAnimation);
});
await Task.Delay(349);
await Dispatcher.InvokeAsync(() => {
ViewboxFloatingBar.Margin = new Thickness(pos.X, pos.Y, -2000, -200);
});
}
public async void PureViewboxFloatingBarMarginAnimationInPPTMode()
{
await Dispatcher.InvokeAsync(() => {
ViewboxFloatingBar.Visibility = Visibility.Visible;
isViewboxFloatingBarMarginAnimationRunning = true;
double dpiScaleX = 1, dpiScaleY = 1;
var source = PresentationSource.FromVisual(this);
if (source != null)
{
dpiScaleX = source.CompositionTarget.TransformToDevice.M11;
dpiScaleY = source.CompositionTarget.TransformToDevice.M22;
}
var windowHandle = new WindowInteropHelper(this).Handle;
var screen = System.Windows.Forms.Screen.FromHandle(windowHandle);
double screenWidth = screen.Bounds.Width / dpiScaleX, screenHeight = screen.Bounds.Height / dpiScaleY;
var toolbarHeight = SystemParameters.PrimaryScreenHeight - SystemParameters.FullPrimaryScreenHeight -
SystemParameters.WindowCaptionHeight;
pos.X = (screenWidth - ViewboxFloatingBar.ActualWidth * ViewboxFloatingBarScaleTransform.ScaleX) / 2;
pos.Y = screenHeight - 55 * ViewboxFloatingBarScaleTransform.ScaleY;
if (pointPPT.X != -1 || pointPPT.Y != -1)
{
pointPPT = pos;
}
var marginAnimation = new ThicknessAnimation
{
Duration = TimeSpan.FromSeconds(0.35),
From = ViewboxFloatingBar.Margin,
To = new Thickness(pos.X, pos.Y, 0, -20)
};
marginAnimation.EasingFunction = new CircleEase();
ViewboxFloatingBar.BeginAnimation(MarginProperty, marginAnimation);
});
await Task.Delay(349);
await Dispatcher.InvokeAsync(() => {
ViewboxFloatingBar.Margin = new Thickness(pos.X, pos.Y, -2000, -200);
});
}
private async void CursorIcon_Click(object sender, RoutedEventArgs e) {
if (lastBorderMouseDownObject != null && lastBorderMouseDownObject is Panel)
((Panel)lastBorderMouseDownObject).Background = new SolidColorBrush(Colors.Transparent);
@ -1473,12 +1561,12 @@ namespace Ink_Canvas {
public static bool CloseIsFromButton = false;
private void BtnExit_Click(object sender, RoutedEventArgs e) {
public void BtnExit_Click(object sender, RoutedEventArgs e) {
CloseIsFromButton = true;
Close();
}
private void BtnRestart_Click(object sender, RoutedEventArgs e) {
public void BtnRestart_Click(object sender, RoutedEventArgs e) {
Process.Start(System.Windows.Forms.Application.ExecutablePath, "-m");
CloseIsFromButton = true;

View File

@ -11,6 +11,7 @@ using System.Windows.Media;
using System.Windows.Ink;
using System.Windows.Media.Imaging;
using System.Windows.Interop;
using Hardcodet.Wpf.TaskbarNotification;
using OSVersionExtension;
namespace Ink_Canvas {
@ -160,6 +161,15 @@ namespace Ink_Canvas {
SaveSettingsToFile();
}
private void ToggleSwitchEnableTrayIcon_Toggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Appearance.EnableTrayIcon = ToggleSwitchEnableTrayIcon.IsOn;
ICCTrayIconExampleImage.Visibility = Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
var _taskbar = (TaskbarIcon)Application.Current.Resources["TaskbarTrayIcon"];
_taskbar.Visibility = ToggleSwitchEnableTrayIcon.IsOn? Visibility.Visible : Visibility.Collapsed;
SaveSettingsToFile();
}
private void ComboBoxUnFoldBtnImg_SelectionChanged(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.Appearance.UnFoldButtonImageType = ComboBoxUnFoldBtnImg.SelectedIndex;
@ -939,6 +949,7 @@ namespace Ink_Canvas {
Settings.Appearance.ChickenSoupSource = 1;
Settings.Appearance.ViewboxFloatingBarOpacityValue = 1.0;
Settings.Appearance.ViewboxFloatingBarOpacityInPPTValue = 1.0;
Settings.Appearance.EnableTrayIcon = true;
Settings.Automation.IsAutoFoldInEasiNote = true;
Settings.Automation.IsAutoFoldInEasiNoteIgnoreDesktopAnno = true;
@ -1200,6 +1211,30 @@ namespace Ink_Canvas {
#endregion
#region RandSettings
private void ToggleSwitchDisplayRandWindowNamesInputBtn_OnToggled(object sender, RoutedEventArgs e) {
if (!isLoaded) return;
Settings.RandSettings.DisplayRandWindowNamesInputBtn = ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn;
SaveSettingsToFile();
}
private void RandWindowOnceCloseLatencySlider_ValueChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.RandSettings.RandWindowOnceCloseLatency = RandWindowOnceCloseLatencySlider.Value;
SaveSettingsToFile();
}
private void RandWindowOnceMaxStudentsSlider_ValueChanged(object sender, RoutedEventArgs e)
{
if (!isLoaded) return;
Settings.RandSettings.RandWindowOnceMaxStudents = (int)RandWindowOnceMaxStudentsSlider.Value;
SaveSettingsToFile();
}
#endregion
public static void SaveSettingsToFile() {
var text = JsonConvert.SerializeObject(Settings, Formatting.Indented);
try {

View File

@ -1,4 +1,5 @@
using Ink_Canvas.Helpers;
using Hardcodet.Wpf.TaskbarNotification;
using Ink_Canvas.Helpers;
using Newtonsoft.Json;
using OSVersionExtension;
using System;
@ -9,11 +10,12 @@ using System.Windows.Ink;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using static System.Windows.Forms.VisualStyles.VisualStyleElement;
using File = System.IO.File;
using OperatingSystem = OSVersionExtension.OperatingSystem;
namespace Ink_Canvas {
public partial class MainWindow : Window {
public partial class MainWindow : System.Windows.Window {
private void LoadSettings(bool isStartup = false) {
AppVersionTextBlock.Text = Assembly.GetExecutingAssembly().GetName().Version.ToString();
try {
@ -168,6 +170,11 @@ namespace Ink_Canvas {
ToggleSwitchEnableQuickPanel.IsOn = Settings.Appearance.IsShowQuickPanel;
ToggleSwitchEnableTrayIcon.IsOn = Settings.Appearance.EnableTrayIcon;
ICCTrayIconExampleImage.Visibility = Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
var _taskbar = (TaskbarIcon)Application.Current.Resources["TaskbarTrayIcon"];
_taskbar.Visibility = Settings.Appearance.EnableTrayIcon ? Visibility.Visible : Visibility.Collapsed;
ViewboxFloatingBar.Opacity = Settings.Appearance.ViewboxFloatingBarOpacityValue;
if (Settings.Appearance.EnableViewboxBlackBoardScaleTransform) // 画板 UI 缩放 80%
@ -506,6 +513,9 @@ namespace Ink_Canvas {
// RandSettings
if (Settings.RandSettings != null) { } else {
Settings.RandSettings = new RandSettings();
ToggleSwitchDisplayRandWindowNamesInputBtn.IsOn = Settings.RandSettings.DisplayRandWindowNamesInputBtn;
RandWindowOnceCloseLatencySlider.Value = Settings.RandSettings.RandWindowOnceCloseLatency;
RandWindowOnceMaxStudentsSlider.Value = Settings.RandSettings.RandWindowOnceMaxStudents;
}
// Automation

View File

@ -0,0 +1,128 @@
using Ink_Canvas.Helpers;
using iNKORE.UI.WPF.Modern.Controls;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Forms.VisualStyles;
using System.Windows.Interop;
using System.Windows.Media.Animation;
namespace Ink_Canvas
{
public partial class App : Application {
private void SysTrayMenu_Opened(object sender, RoutedEventArgs e) {
var s = (ContextMenu)sender;
var FoldFloatingBarTrayIconMenuItemIconEyeOff =
(Image)((Grid)((MenuItem)s.Items[s.Items.Count-5]).Icon).Children[0];
var FoldFloatingBarTrayIconMenuItemIconEyeOn =
(Image)((Grid)((MenuItem)s.Items[s.Items.Count - 5]).Icon).Children[1];
var FoldFloatingBarTrayIconMenuItemHeaderText =
(TextBlock)((SimpleStackPanel)((MenuItem)s.Items[s.Items.Count - 5]).Header).Children[0];
var ResetFloatingBarPositionTrayIconMenuItem = (MenuItem)s.Items[s.Items.Count - 4];
var HideICCMainWindowTrayIconMenuItem = (MenuItem)s.Items[s.Items.Count - 9];
var mainWin = (MainWindow)Application.Current.MainWindow;
if (mainWin.IsLoaded) {
// 判斷是否在收納模式中
if (mainWin.isFloatingBarFolded) {
FoldFloatingBarTrayIconMenuItemIconEyeOff.Visibility = Visibility.Hidden;
FoldFloatingBarTrayIconMenuItemIconEyeOn.Visibility = Visibility.Visible;
FoldFloatingBarTrayIconMenuItemHeaderText.Text = "退出收纳模式";
if (!HideICCMainWindowTrayIconMenuItem.IsChecked) {
ResetFloatingBarPositionTrayIconMenuItem.IsEnabled = false;
ResetFloatingBarPositionTrayIconMenuItem.Opacity = 0.5;
}
} else {
FoldFloatingBarTrayIconMenuItemIconEyeOff.Visibility = Visibility.Visible;
FoldFloatingBarTrayIconMenuItemIconEyeOn.Visibility = Visibility.Hidden;
FoldFloatingBarTrayIconMenuItemHeaderText.Text = "切换为收纳模式";
if (!HideICCMainWindowTrayIconMenuItem.IsChecked) {
ResetFloatingBarPositionTrayIconMenuItem.IsEnabled = true;
ResetFloatingBarPositionTrayIconMenuItem.Opacity = 1;
}
}
}
}
private void CloseAppTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) {
var mainWin = (MainWindow)Application.Current.MainWindow;
if (mainWin.IsLoaded) mainWin.BtnExit_Click(null,null);
}
private void RestartAppTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) {
var mainWin = (MainWindow)Application.Current.MainWindow;
if (mainWin.IsLoaded) mainWin.BtnRestart_Click(null,null);
}
private void ForceFullScreenTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e) {
var mainWin = (MainWindow)Application.Current.MainWindow;
if (mainWin.IsLoaded) {
Ink_Canvas.MainWindow.MoveWindow(new WindowInteropHelper(mainWin).Handle, 0, 0,
System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width, System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height, true);
Ink_Canvas.MainWindow.ShowNewMessage($"已强制全屏化:{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width}x{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height}(缩放比例为{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Width / SystemParameters.PrimaryScreenWidth}x{System.Windows.Forms.Screen.PrimaryScreen.Bounds.Height / SystemParameters.PrimaryScreenHeight}");
}
}
private void FoldFloatingBarTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e)
{
var mainWin = (MainWindow)Application.Current.MainWindow;
if (mainWin.IsLoaded)
if (mainWin.isFloatingBarFolded) mainWin.UnFoldFloatingBar_MouseUp(new object(),null);
else mainWin.FoldFloatingBar_MouseUp(new object(),null);
}
private void ResetFloatingBarPositionTrayIconMenuItem_Clicked(object sender, RoutedEventArgs e)
{
var mainWin = (MainWindow)Application.Current.MainWindow;
if (mainWin.IsLoaded) {
var isInPPTPresentationMode = false;
Dispatcher.Invoke(() => {
isInPPTPresentationMode = mainWin.BtnPPTSlideShowEnd.Visibility == Visibility.Visible;
});
if (!mainWin.isFloatingBarFolded) {
if (!isInPPTPresentationMode) mainWin.PureViewboxFloatingBarMarginAnimationInDesktopMode();
else mainWin.PureViewboxFloatingBarMarginAnimationInPPTMode();
}
}
}
private void HideICCMainWindowTrayIconMenuItem_Checked(object sender, RoutedEventArgs e) {
var mainWin = (MainWindow)Application.Current.MainWindow;
mainWin.Hide();
var s = (ContextMenu)_taskbar.ContextMenu;
var ResetFloatingBarPositionTrayIconMenuItem = (MenuItem)s.Items[s.Items.Count - 4];
var FoldFloatingBarTrayIconMenuItem = (MenuItem)s.Items[s.Items.Count - 5];
var ForceFullScreenTrayIconMenuItem = (MenuItem)s.Items[s.Items.Count - 6];
ResetFloatingBarPositionTrayIconMenuItem.IsEnabled = false;
FoldFloatingBarTrayIconMenuItem.IsEnabled = false;
ForceFullScreenTrayIconMenuItem.IsEnabled = false;
ResetFloatingBarPositionTrayIconMenuItem.Opacity = 0.5;
FoldFloatingBarTrayIconMenuItem.Opacity = 0.5;
ForceFullScreenTrayIconMenuItem.Opacity = 0.5;
}
private void HideICCMainWindowTrayIconMenuItem_UnChecked(object sender, RoutedEventArgs e)
{
var mainWin = (MainWindow)Application.Current.MainWindow;
mainWin.Show();
var s = (ContextMenu)_taskbar.ContextMenu;
var ResetFloatingBarPositionTrayIconMenuItem = (MenuItem)s.Items[s.Items.Count - 4];
var FoldFloatingBarTrayIconMenuItem = (MenuItem)s.Items[s.Items.Count - 5];
var ForceFullScreenTrayIconMenuItem = (MenuItem)s.Items[s.Items.Count - 6];
ResetFloatingBarPositionTrayIconMenuItem.IsEnabled = true;
FoldFloatingBarTrayIconMenuItem.IsEnabled = true;
ForceFullScreenTrayIconMenuItem.IsEnabled = true;
ResetFloatingBarPositionTrayIconMenuItem.Opacity = 1;
FoldFloatingBarTrayIconMenuItem.Opacity = 1;
ForceFullScreenTrayIconMenuItem.Opacity = 1;
}
}
}

View File

@ -119,6 +119,8 @@ namespace Ink_Canvas
public int FloatingBarImg { get; set; } = 0;
[JsonProperty("viewboxFloatingBarOpacityValue")]
public double ViewboxFloatingBarOpacityValue { get; set; } = 1.0;
[JsonProperty("enableTrayIcon")]
public bool EnableTrayIcon { get; set; } = true;
[JsonProperty("viewboxFloatingBarOpacityInPPTValue")]
public double ViewboxFloatingBarOpacityInPPTValue { get; set; } = 0.5;
[JsonProperty("enableViewboxBlackBoardScaleTransform")]
@ -354,9 +356,11 @@ namespace Ink_Canvas
}
public class RandSettings {
[JsonProperty("peopleCount")]
public int PeopleCount { get; set; } = 60;
[JsonProperty("isNotRepeatName")]
public bool IsNotRepeatName { get; set; } = false;
[JsonProperty("displayRandWindowNamesInputBtn")]
public bool DisplayRandWindowNamesInputBtn { get; set; } = false;
[JsonProperty("randWindowOnceCloseLatency")]
public double RandWindowOnceCloseLatency { get; set; } = 2.5;
[JsonProperty("randWindowOnceMaxStudents")]
public int RandWindowOnceMaxStudents { get; set; } = 10;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 KiB

After

Width:  |  Height:  |  Size: 408 KiB

View File

@ -74,7 +74,7 @@
</Viewbox>
</Border>
</StackPanel>
<ui:SimpleStackPanel Margin="0,8,0,0" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="24">
<ui:SimpleStackPanel Visibility="Collapsed" Margin="0,8,0,0" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="24">
<CheckBox x:Name="NoHotStudents" MinWidth="0"
Content="不抽热门人选" IsThreeState="True"
HorizontalAlignment="Center" />
@ -82,7 +82,7 @@
Content="避开生僻字" IsThreeState="True"
HorizontalAlignment="Center" />
</ui:SimpleStackPanel>
<ui:SimpleStackPanel Margin="0,0,0,8" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="24">
<ui:SimpleStackPanel Visibility="Collapsed" Margin="0,0,0,8" Orientation="Horizontal" HorizontalAlignment="Center" Spacing="24">
<ComboBox Name="ComboBoxRandMode"
MinWidth="0"
IsEditable="False"

View File

@ -14,18 +14,22 @@ namespace Ink_Canvas {
/// Interaction logic for RandWindow.xaml
/// </summary>
public partial class RandWindow : Window {
public RandWindow() {
public RandWindow(Settings settings) {
InitializeComponent();
AnimationsHelper.ShowWithSlideFromBottomAndFade(this, 0.25);
BorderBtnHelp.Visibility = RandIsDisplayListManageButton == false ? Visibility.Collapsed : Visibility.Visible;
BorderBtnHelp.Visibility = settings.RandSettings.DisplayRandWindowNamesInputBtn == false ? Visibility.Collapsed : Visibility.Visible;
RandMaxPeopleOneTime = settings.RandSettings.RandWindowOnceMaxStudents;
RandDoneAutoCloseWaitTime = (int)settings.RandSettings.RandWindowOnceCloseLatency*1000;
}
public RandWindow(bool IsAutoClose) {
public RandWindow(Settings settings, bool IsAutoClose) {
InitializeComponent();
isAutoClose = IsAutoClose;
PeopleControlPane.Opacity = 0.4;
PeopleControlPane.IsHitTestVisible = false;
BorderBtnHelp.Visibility = RandIsDisplayListManageButton == false ? Visibility.Collapsed : Visibility.Visible;
BorderBtnHelp.Visibility = settings.RandSettings.DisplayRandWindowNamesInputBtn == false ? Visibility.Collapsed : Visibility.Visible;
RandMaxPeopleOneTime = settings.RandSettings.RandWindowOnceMaxStudents;
RandDoneAutoCloseWaitTime = (int)settings.RandSettings.RandWindowOnceCloseLatency * 1000;
new Thread(new ThreadStart(() => {
Thread.Sleep(100);
@ -66,7 +70,6 @@ namespace Ink_Canvas {
public int RandWaitingThreadSleepTime = 5;
public int RandMaxPeopleOneTime = 10;
public int RandDoneAutoCloseWaitTime = 2500;
public bool RandIsDisplayListManageButton = false;
private void BorderBtnRand_MouseUp(object sender, MouseButtonEventArgs e) {
Random random = new Random();// randSeed + DateTime.Now.Millisecond / 10 % 10);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 396 KiB