Merge pull request #722 from irihitech/focus

Fix IPBox and MultiComboBox focus style
This commit is contained in:
Zhang Dian
2025-07-10 22:32:22 +08:00
committed by GitHub
3 changed files with 10 additions and 1 deletions

View File

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

View File

@@ -180,6 +180,14 @@
</Style> </Style>
</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"> <Style Selector="^:dropdownopen">
<Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorPressedBorderBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource ComboBoxSelectorPressedBorderBrush}" />
</Style> </Style>

View File

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