fix: fix ip box focus handling and styles. fix multicombobox focus style.

This commit is contained in:
Dong Bin
2025-07-10 16:35:13 +08:00
parent e025b489e2
commit 55c3941c3d
3 changed files with 10 additions and 1 deletions

View File

@@ -120,7 +120,7 @@
<Setter Property="Background" Value="{DynamicResource IPv4BoxPressedBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxFocusBorderBrush}" />
</Style>
<Style Selector="^:focus-within">
<Style Selector="^:focus-within /template/ Border#PART_Border">
<Setter Property="BorderBrush" Value="{DynamicResource TextBoxFocusBorderBrush}" />
</Style>
<Style Selector="^:disabled">

View File

@@ -179,6 +179,14 @@
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconPressedForeground}" />
</Style>
</Style>
<Style Selector="^:focus">
<Setter Property="Background" Value="{DynamicResource ComboBoxSelectorFocusBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorFocusBorderBrush}" />
<Style Selector="^ /template/ PathIcon#DropDownGlyph">
<Setter Property="Foreground" Value="{DynamicResource ComboBoxIconFocusForeground}" />
</Style>
</Style>
<Style Selector="^:dropdownopen">
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorPressedBorderBrush}" />

View File

@@ -309,6 +309,7 @@ public class IPv4Box: TemplatedControl
protected override void OnLostFocus(RoutedEventArgs e)
{
base.OnLostFocus(e);
foreach (var pre in _presenters)
{
pre?.HideCaret();