From fd4048a6c0b98716c53f733c0bd595d36dd0ad95 Mon Sep 17 00:00:00 2001 From: "zhengxuan.zhang" Date: Wed, 6 May 2026 10:01:27 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=AE=97=E5=AD=90=E5=B7=A5?= =?UTF-8?q?=E5=85=B7=E7=AE=B1=E6=90=9C=E7=B4=A2=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ImageProcessing/OperatorToolboxViewModel.cs | 10 ++++++++++ .../Views/ImageProcessing/OperatorToolboxView.xaml | 1 + .../Views/ImageProcessing/OperatorToolboxWindow.xaml | 3 ++- 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/XplorePlane/ViewModels/ImageProcessing/OperatorToolboxViewModel.cs b/XplorePlane/ViewModels/ImageProcessing/OperatorToolboxViewModel.cs index 2eb128c..b704c3f 100644 --- a/XplorePlane/ViewModels/ImageProcessing/OperatorToolboxViewModel.cs +++ b/XplorePlane/ViewModels/ImageProcessing/OperatorToolboxViewModel.cs @@ -36,6 +36,7 @@ namespace XplorePlane.ViewModels { private readonly IImageProcessingService _imageProcessingService; private string _searchText = string.Empty; + private OperatorGroupViewModel _selectedGroup; // UI 元数据(分类 + 图标)由 ProcessorUiMetadata 统一提供,保持工具箱与流水线图标一致 @@ -52,6 +53,12 @@ namespace XplorePlane.ViewModels public ObservableCollection FilteredOperators { get; } public ObservableCollection FilteredGroups { get; } + public OperatorGroupViewModel SelectedGroup + { + get => _selectedGroup; + set => SetProperty(ref _selectedGroup, value); + } + public string SearchText { get => _searchText; @@ -78,6 +85,7 @@ namespace XplorePlane.ViewModels { FilteredOperators.Clear(); FilteredGroups.Clear(); + SelectedGroup = null; var filtered = string.IsNullOrWhiteSpace(SearchText) ? AvailableOperators @@ -101,6 +109,8 @@ namespace XplorePlane.ViewModels Operators = new ObservableCollection(group) }); } + + SelectedGroup = FilteredGroups.FirstOrDefault(); } private static int GetCategoryOrder(string category) => category switch diff --git a/XplorePlane/Views/ImageProcessing/OperatorToolboxView.xaml b/XplorePlane/Views/ImageProcessing/OperatorToolboxView.xaml index f23a1f7..9c5ff9d 100644 --- a/XplorePlane/Views/ImageProcessing/OperatorToolboxView.xaml +++ b/XplorePlane/Views/ImageProcessing/OperatorToolboxView.xaml @@ -100,6 +100,7 @@ diff --git a/XplorePlane/Views/ImageProcessing/OperatorToolboxWindow.xaml b/XplorePlane/Views/ImageProcessing/OperatorToolboxWindow.xaml index 255ecbc..e07fbab 100644 --- a/XplorePlane/Views/ImageProcessing/OperatorToolboxWindow.xaml +++ b/XplorePlane/Views/ImageProcessing/OperatorToolboxWindow.xaml @@ -3,7 +3,8 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:views="clr-namespace:XplorePlane.Views" Title="算子工具箱" - Width="500" Height="560" + Width="460" Height="540" + MinWidth="420" MinHeight="500" WindowStartupLocation="CenterOwner" ShowInTaskbar="False" WindowStyle="None"