Skip to content

Commit

Permalink
Improve AutoCompleteBox border (#6)
Browse files Browse the repository at this point in the history
* fix: unify autocompletebox border with textbox.

* feat: reduce padding, improve demo.
  • Loading branch information
rabbitism authored Dec 5, 2024
1 parent c74d656 commit 13fe73f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
7 changes: 7 additions & 0 deletions samples/Classic.Demo/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,13 @@
<TextBox Text="Lorem ipsum dolor sit amet.."/>
<ComboBox ItemsSource="abcdefgh" SelectedIndex="1" />
<ComboBox ItemsSource="abcdefgh" IsEnabled="False" SelectedIndex="0" />
<AutoCompleteBox ItemsSource="{Binding People}" ValueMemberBinding="{Binding FirstName}">
<AutoCompleteBox.ItemTemplate>
<DataTemplate x:DataType="demo:PersonViewModel">
<TextBlock Text="{Binding FirstName}"/>
</DataTemplate>
</AutoCompleteBox.ItemTemplate>
</AutoCompleteBox>
</StackPanel>
</TabItem>
<TabItem Header="Buttons">
Expand Down
9 changes: 5 additions & 4 deletions src/Classic.Avalonia.Theme/Styles/AutoCompleteBox.axaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="clr-namespace:Classic.CommonControls;assembly=Classic.CommonControls.Avalonia"
x:ClassModifier="internal">
<ControlTheme x:Key="{x:Type AutoCompleteBox}"
TargetType="AutoCompleteBox">
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" />
<Setter Property="Padding" Value="4" />
<Setter Property="Background" Value="{DynamicResource {x:Static common:SystemColors.WindowBrushKey}}" />
<Setter Property="BorderBrush" Value="{x:Static ClassicBorderDecorator.ClassicBorderBrush}" />
<Setter Property="BorderThickness" Value="2" />
<Setter Property="Padding" Value="1" />
<Setter Property="Template">
<ControlTemplate>
<Panel>
Expand Down

0 comments on commit 13fe73f

Please sign in to comment.