fix: remove MinHeight & fix TagInput Foreground.

This commit is contained in:
Zhang Dian
2025-09-16 19:03:58 +08:00
parent 13008225c0
commit 68cdd4609f
4 changed files with 17 additions and 19 deletions

View File

@@ -1,33 +1,31 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:u="https://irihi.tech/ursa">
<!-- Add Resources Here -->
<ControlTheme x:Key="{x:Type u:MultiAutoCompleteBox}" TargetType="u:MultiAutoCompleteBox">
<Setter Property="MinHeight" Value="{DynamicResource AutoCompleteBoxDefaultHeight}" />
<Setter Property="MaxDropDownHeight" Value="{DynamicResource AutoCompleteMaxDropdownHeight}" />
<Setter Property="CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}"></Setter>
<Setter Property="CornerRadius" Value="{DynamicResource TextBoxDefaultCornerRadius}" />
<Setter Property="Template">
<ControlTemplate TargetType="u:MultiAutoCompleteBox">
<Panel>
<Border
Name="PART_RootBorder"
MinHeight="30"
Padding="{DynamicResource TextBoxContentPadding}"
VerticalAlignment="Stretch"
CornerRadius="{TemplateBinding CornerRadius}"
Background="{DynamicResource TextBoxDefaultBackground}"
BorderBrush="{DynamicResource TextBoxDefaultBorderBrush}">
<u:MultiComboBoxSelectedItemList
<u:MultiComboBoxSelectedItemList
Name="{x:Static u:MultiAutoCompleteBox.PART_SelectedItemsControl}"
VerticalAlignment="Center"
RemoveCommand="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Remove}"
ItemTemplate="{TemplateBinding SelectedItemTemplate}"
ItemsSource="{TemplateBinding SelectedItems}" >
ItemsSource="{TemplateBinding SelectedItems}">
<u:MultiComboBoxSelectedItemList.ItemsPanel>
<ItemsPanelTemplate>
<u:WrapPanelWithTrailingItem>
<u:WrapPanelWithTrailingItem.TrailingItem>
<TextBox VerticalAlignment="Center" Theme="{DynamicResource TagInputTextBoxTheme}"/>
<TextBox VerticalAlignment="Center" Theme="{DynamicResource TagInputTextBoxTheme}" />
</u:WrapPanelWithTrailingItem.TrailingItem>
</u:WrapPanelWithTrailingItem>
</ItemsPanelTemplate>
@@ -61,4 +59,4 @@
</ControlTemplate>
</Setter>
</ControlTheme>
</ResourceDictionary>
</ResourceDictionary>

View File

@@ -63,7 +63,7 @@
</ControlTheme>
<ControlTheme x:Key="TagInputTextBoxTheme" TargetType="TextBox">
<Setter Property="Foreground" Value="{DynamicResource TextBoxInnerForeground}" />
<Setter Property="Foreground" Value="{DynamicResource TextBoxForeground}" />
<Setter Property="Background" Value="{DynamicResource TextBoxDefaultBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxDefaultBorderBrush}" />
<Setter Property="SelectionBrush" Value="{DynamicResource TextBoxSelectionBackground}" />