#0047 美观界面

This commit is contained in:
zhengxuan.zhang
2026-03-26 15:24:48 +08:00
parent e67e7ec67b
commit 69af65644a
5 changed files with 48 additions and 39 deletions
+4 -1
View File
@@ -26,8 +26,11 @@ namespace XplorePlane
{ {
protected override void OnStartup(StartupEventArgs e) protected override void OnStartup(StartupEventArgs e)
{ {
// 设置 Telerik Fluent 主题 // 设置 Telerik Windows11 主题,缩小 Ribbon 整体尺寸
StyleManager.ApplicationTheme = new Windows11Theme(); StyleManager.ApplicationTheme = new Windows11Theme();
//Windows11Palette.Palette.FontSize = 11;
//Windows11Palette.Palette.FontSizeS = 10;
//Windows11Palette.Palette.FontSizeL = 13;
// 强制使用中文 UI,确保 ImageProcessing 库显示中文 // 强制使用中文 UI,确保 ImageProcessing 库显示中文
var zhCN = new CultureInfo("zh-CN"); var zhCN = new CultureInfo("zh-CN");
@@ -6,9 +6,9 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:prism="http://prismlibrary.com/" xmlns:prism="http://prismlibrary.com/"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation"
prism:ViewModelLocator.AutoWireViewModel="True"
d:DesignHeight="700" d:DesignHeight="700"
d:DesignWidth="350" d:DesignWidth="350"
prism:ViewModelLocator.AutoWireViewModel="True"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources> <UserControl.Resources>
@@ -106,13 +106,6 @@
Style="{StaticResource ToolbarBtn}" Style="{StaticResource ToolbarBtn}"
ToolTip="工具箱" /> ToolTip="工具箱" />
</StackPanel> </StackPanel>
<Button
Width="50"
HorizontalAlignment="Right"
Command="{Binding OpenToolboxCommand}"
Content="工具箱"
Style="{StaticResource ToolbarBtn}"
ToolTip="打开算子工具箱" />
</Grid> </Grid>
</Border> </Border>
+25 -27
View File
@@ -1,4 +1,4 @@
<telerik:RadRibbonWindow <Window
x:Class="XplorePlane.Views.MainWindow" x:Class="XplorePlane.Views.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
@@ -44,13 +44,14 @@
Grid.ColumnSpan="3" Grid.ColumnSpan="3"
VerticalAlignment="Center" VerticalAlignment="Center"
ApplicationButtonVisibility="Collapsed" ApplicationButtonVisibility="Collapsed"
ApplicationName="XplorePlane" ApplicationName=""
BackstageClippingElement="{Binding ElementName=LayoutRoot}" BackstageClippingElement="{Binding ElementName=LayoutRoot}"
FontFamily="Microsoft YaHei" FontFamily="Microsoft YaHei UI"
FontSize="10" FontSize="11"
HeaderBackground="LightGray" HeaderBackground="LightGray"
TextOptions.TextFormattingMode="Display" TextOptions.TextFormattingMode="Display"
TextOptions.TextRenderingMode="ClearType"> TextOptions.TextRenderingMode="ClearType"
TitleBarVisibility="Collapsed">
<telerik:RadRibbonView.Resources> <telerik:RadRibbonView.Resources>
<spreadsheet:FunctionsProvider x:Key="FunctionsProvider" /> <spreadsheet:FunctionsProvider x:Key="FunctionsProvider" />
@@ -93,13 +94,13 @@
<telerik:RadRibbonButton <telerik:RadRibbonButton
telerik:ScreenTip.Title="加载CNC" telerik:ScreenTip.Title="加载CNC"
Command="{Binding OpenFileCommand}" Command="{Binding OpenFileCommand}"
Size="Medium" Size="Large"
SmallImage="/Assets/Icons/open.png" SmallImage="/Assets/Icons/open.png"
Text="加载CNC" /> Text="加载CNC" />
</StackPanel> </StackPanel>
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Width="160" Header="程序"> <telerik:RadRibbonGroup Header="程序">
<!-- 安全门控 & 系统 --> <!-- 安全门控 & 系统 -->
@@ -141,7 +142,7 @@
telerik:ScreenTip.Title="中心十字线" telerik:ScreenTip.Title="中心十字线"
Size="Medium" Size="Medium"
SmallImage="/Assets/Icons/crosshair.png" SmallImage="/Assets/Icons/crosshair.png"
Text="十字线" /> Text="辅助线" />
<telerik:RadRibbonButton <telerik:RadRibbonButton
telerik:ScreenTip.Title="白背景检测黑区域" telerik:ScreenTip.Title="白背景检测黑区域"
Size="Medium" Size="Medium"
@@ -254,16 +255,13 @@
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
<telerik:RadRibbonGroup telerik:ScreenTip.Title="图像算子" Header="图像算子"> <telerik:RadRibbonGroup telerik:ScreenTip.Title="图像算子" Header="图像算子">
<telerik:RadRibbonDropDownButton <telerik:RadRibbonButton
telerik:ScreenTip.Description="打开算子工具箱,拖拽算子到流水线中" telerik:ScreenTip.Description="打开算子工具箱,拖拽算子到流水线中"
telerik:ScreenTip.Title="算子工具箱" telerik:ScreenTip.Title="算子工具箱"
LargeImage="/Assets/Icons/dynamic-range.png" Click="OpenToolboxButton_Click"
Size="Large" Size="Large"
Text="算子工具箱"> SmallImage="/Assets/Icons/dynamic-range.png"
<telerik:RadRibbonDropDownButton.DropDownContent> Text="算子工具箱" />
<views:OperatorToolboxView Width="280" Height="480" />
</telerik:RadRibbonDropDownButton.DropDownContent>
</telerik:RadRibbonDropDownButton>
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="CNC"> <telerik:RadRibbonGroup Header="CNC">
@@ -341,16 +339,16 @@
Command="{Binding Path=ShowHyperlinkDialog.Command}" Command="{Binding Path=ShowHyperlinkDialog.Command}"
Content="BGA检测" Content="BGA检测"
IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}" IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}"
LargeImage="/Assets/Icons/bga.png" Size="Large"
Size="Large" /> SmallImage="/Assets/Icons/bga.png" />
<telerik:RadRibbonButton <telerik:RadRibbonButton
telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document." telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document."
telerik:ScreenTip.Title="Add a Hyperlink" telerik:ScreenTip.Title="Add a Hyperlink"
Command="{Binding Path=ShowHyperlinkDialog.Command}" Command="{Binding Path=ShowHyperlinkDialog.Command}"
Content="孔隙检测" Content="孔隙检测"
IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}" IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}"
LargeImage="/Assets/Icons/Pores.png" Size="Large"
Size="Large" /> SmallImage="/Assets/Icons/Pores.png" />
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="扫描模式" IsEnabled="{Binding Path=LinksGroup.IsEnabled}"> <telerik:RadRibbonGroup Header="扫描模式" IsEnabled="{Binding Path=LinksGroup.IsEnabled}">
@@ -363,16 +361,16 @@
Command="{Binding Path=ShowHyperlinkDialog.Command}" Command="{Binding Path=ShowHyperlinkDialog.Command}"
Content="快速扫描" Content="快速扫描"
IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}" IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}"
LargeImage="/Assets/Icons/quick-scan.png" Size="Large"
Size="Large" /> SmallImage="/Assets/Icons/quick-scan.png" />
<telerik:RadRibbonButton <telerik:RadRibbonButton
telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document." telerik:ScreenTip.Description="Create a link in your document for quick access to webpages and files.&#13;&#13;Hyperlinks can also take you to places in your document."
telerik:ScreenTip.Title="Add a Hyperlink" telerik:ScreenTip.Title="Add a Hyperlink"
Command="{Binding Path=ShowHyperlinkDialog.Command}" Command="{Binding Path=ShowHyperlinkDialog.Command}"
Content="螺旋扫描" Content="螺旋扫描"
IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}" IsEnabled="{Binding Path=ShowHyperlinkDialog.IsEnabled}"
LargeImage="/Assets/Icons/spiral.png" Size="Large"
Size="Large" /> SmallImage="/Assets/Icons/spiral.png" />
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="图像处理"> <telerik:RadRibbonGroup Header="图像处理">
@@ -381,8 +379,8 @@
</telerik:RadRibbonGroup.Variants> </telerik:RadRibbonGroup.Variants>
<telerik:RadRibbonButton <telerik:RadRibbonButton
Command="{Binding OpenPipelineEditorCommand}" Command="{Binding OpenPipelineEditorCommand}"
LargeImage="/Assets/Icons/workflow.png"
Size="Large" Size="Large"
SmallImage="/Assets/Icons/workflow.png"
Text="流水线编辑器" /> Text="流水线编辑器" />
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
</telerik:RadRibbonTab> </telerik:RadRibbonTab>
@@ -392,8 +390,8 @@
<telerik:GroupVariant Priority="0" Variant="Large" /> <telerik:GroupVariant Priority="0" Variant="Large" />
</telerik:RadRibbonGroup.Variants> </telerik:RadRibbonGroup.Variants>
<telerik:RadRibbonButton <telerik:RadRibbonButton
LargeImage="/Assets/Icons/tools.png"
Size="Large" Size="Large"
SmallImage="/Assets/Icons/tools.png"
Text="关于 XplorePlane" /> Text="关于 XplorePlane" />
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
<telerik:RadRibbonGroup Header="帮助"> <telerik:RadRibbonGroup Header="帮助">
@@ -401,8 +399,8 @@
<telerik:GroupVariant Priority="0" Variant="Large" /> <telerik:GroupVariant Priority="0" Variant="Large" />
</telerik:RadRibbonGroup.Variants> </telerik:RadRibbonGroup.Variants>
<telerik:RadRibbonButton <telerik:RadRibbonButton
LargeImage="/Assets/Icons/message.png"
Size="Large" Size="Large"
SmallImage="/Assets/Icons/message.png"
Text="帮助文档" /> Text="帮助文档" />
</telerik:RadRibbonGroup> </telerik:RadRibbonGroup>
</telerik:RadRibbonTab> </telerik:RadRibbonTab>
@@ -505,4 +503,4 @@
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>
</telerik:RadRibbonWindow> </Window>
+16 -1
View File
@@ -7,7 +7,7 @@ namespace XplorePlane.Views
/// <summary> /// <summary>
/// MainWindow.xaml 的交互逻辑 /// MainWindow.xaml 的交互逻辑
/// </summary> /// </summary>
public partial class MainWindow : RadRibbonWindow public partial class MainWindow : Window
{ {
public MainWindow(MainViewModel viewModel) public MainWindow(MainViewModel viewModel)
{ {
@@ -21,5 +21,20 @@ namespace XplorePlane.Views
NavigationPanel.Visibility = show ? Visibility.Visible : Visibility.Collapsed; NavigationPanel.Visibility = show ? Visibility.Visible : Visibility.Collapsed;
NavColumn.Width = show ? new GridLength(180) : new GridLength(0); NavColumn.Width = show ? new GridLength(180) : new GridLength(0);
} }
private OperatorToolboxWindow _toolboxWindow;
private void OpenToolboxButton_Click(object sender, RoutedEventArgs e)
{
if (_toolboxWindow == null || !_toolboxWindow.IsLoaded)
{
_toolboxWindow = new OperatorToolboxWindow { Owner = this };
_toolboxWindow.Show();
}
else
{
_toolboxWindow.Activate();
}
}
} }
} }
+2 -2
View File
@@ -44,8 +44,8 @@
2026.3.26 2026.3.26
---------------------- ----------------------
1、各窗体间数据流的传递,全局数据结构的设计(包括一个基本的说明文档)√ 1、各窗体间数据流的传递,全局数据结构的设计(包括一个基本的说明文档)√
2、集成 2、将telerik 升级到 2024.1.408.310;调整界面和主题;引入 硬件层依赖 √
3、图像算子流程文件,保存文件后缀 .imw, image process workflow 缩写