Skip to content

Commit 13fe73f

Browse files
authored
Improve AutoCompleteBox border (#6)
* fix: unify autocompletebox border with textbox. * feat: reduce padding, improve demo.
1 parent c74d656 commit 13fe73f

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

samples/Classic.Demo/MainWindow.axaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,13 @@
300300
<TextBox Text="Lorem ipsum dolor sit amet.."/>
301301
<ComboBox ItemsSource="abcdefgh" SelectedIndex="1" />
302302
<ComboBox ItemsSource="abcdefgh" IsEnabled="False" SelectedIndex="0" />
303+
<AutoCompleteBox ItemsSource="{Binding People}" ValueMemberBinding="{Binding FirstName}">
304+
<AutoCompleteBox.ItemTemplate>
305+
<DataTemplate x:DataType="demo:PersonViewModel">
306+
<TextBlock Text="{Binding FirstName}"/>
307+
</DataTemplate>
308+
</AutoCompleteBox.ItemTemplate>
309+
</AutoCompleteBox>
303310
</StackPanel>
304311
</TabItem>
305312
<TabItem Header="Buttons">

src/Classic.Avalonia.Theme/Styles/AutoCompleteBox.axaml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
<ResourceDictionary xmlns="https://github.com/avaloniaui"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
3+
xmlns:common="clr-namespace:Classic.CommonControls;assembly=Classic.CommonControls.Avalonia"
34
x:ClassModifier="internal">
45
<ControlTheme x:Key="{x:Type AutoCompleteBox}"
56
TargetType="AutoCompleteBox">
6-
<Setter Property="Background" Value="{DynamicResource ThemeBackgroundBrush}" />
7-
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorderMidBrush}" />
8-
<Setter Property="BorderThickness" Value="{DynamicResource ThemeBorderThickness}" />
9-
<Setter Property="Padding" Value="4" />
7+
<Setter Property="Background" Value="{DynamicResource {x:Static common:SystemColors.WindowBrushKey}}" />
8+
<Setter Property="BorderBrush" Value="{x:Static ClassicBorderDecorator.ClassicBorderBrush}" />
9+
<Setter Property="BorderThickness" Value="2" />
10+
<Setter Property="Padding" Value="1" />
1011
<Setter Property="Template">
1112
<ControlTemplate>
1213
<Panel>

0 commit comments

Comments
 (0)