Skip to content

Commit 93a2edd

Browse files
committed
enhance: text search in ComboBox
Signed-off-by: leo <[email protected]>
1 parent a2f47df commit 93a2edd

File tree

8 files changed

+16
-0
lines changed

8 files changed

+16
-0
lines changed

src/Views/AddWorktree.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@
8080
Height="28" Padding="8,0"
8181
VerticalAlignment="Center" HorizontalAlignment="Stretch"
8282
ItemsSource="{Binding RemoteBranches}"
83+
IsTextSearchEnabled="True"
8384
SelectedItem="{Binding SelectedTrackingBranch, Mode=TwoWay}"
8485
IsVisible="{Binding SetTrackingBranch, Mode=OneWay}">
8586
<ComboBox.ItemTemplate>

src/Views/AddWorktree.axaml.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
23
using Avalonia.Controls;
34
using Avalonia.Interactivity;
45
using Avalonia.Platform.Storage;

src/Views/Pull.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
Margin="0,0,8,0"
4747
Text="{DynamicResource Text.Pull.Branch}"/>
4848
<ComboBox Grid.Row="1" Grid.Column="1"
49+
x:Name="RemoteBranchesComboBox"
4950
Height="28" Padding="8,0"
5051
VerticalAlignment="Center" HorizontalAlignment="Stretch"
5152
ItemsSource="{Binding RemoteBranches}"

src/Views/Pull.axaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using Avalonia.Controls;
2+
using Avalonia.Controls.Primitives;
3+
using Avalonia.Data;
24

35
namespace SourceGit.Views
46
{
@@ -7,6 +9,7 @@ public partial class Pull : UserControl
79
public Pull()
810
{
911
InitializeComponent();
12+
TextSearch.SetTextBinding(RemoteBranchesComboBox, new Binding("Name"));
1013
}
1114
}
1215
}

src/Views/Push.axaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
Margin="0,0,8,0"
1919
Text="{DynamicResource Text.Push.Local}"/>
2020
<ComboBox Grid.Row="0" Grid.Column="1"
21+
x:Name="LocalBranchesComboBox"
2122
Height="28" Padding="8,0"
2223
VerticalAlignment="Center" HorizontalAlignment="Stretch"
2324
ItemsSource="{Binding LocalBranches}"
@@ -58,6 +59,7 @@
5859
Margin="0,0,8,0"
5960
Text="{DynamicResource Text.Push.To}"/>
6061
<ComboBox Grid.Row="2" Grid.Column="1"
62+
x:Name="RemoteBranchesComboBox"
6163
Height="28" Padding="8,0"
6264
VerticalAlignment="Center" HorizontalAlignment="Stretch"
6365
ItemsSource="{Binding RemoteBranches}"

src/Views/Push.axaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using Avalonia.Controls;
2+
using Avalonia.Controls.Primitives;
3+
using Avalonia.Data;
24

35
namespace SourceGit.Views
46
{
@@ -7,6 +9,8 @@ public partial class Push : UserControl
79
public Push()
810
{
911
InitializeComponent();
12+
TextSearch.SetTextBinding(LocalBranchesComboBox, new Binding("Name"));
13+
TextSearch.SetTextBinding(RemoteBranchesComboBox, new Binding("Name"));
1014
}
1115
}
1216
}

src/Views/SetUpstream.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
Margin="0,0,8,0"
2727
Text="{DynamicResource Text.SetUpstream.Upstream}"/>
2828
<ComboBox Grid.Row="1" Grid.Column="1"
29+
x:Name="RemoteBranchesComboBox"
2930
Height="28" Padding="8,0"
3031
VerticalAlignment="Center" HorizontalAlignment="Stretch"
3132
ItemsSource="{Binding RemoteBranches}"

src/Views/SetUpstream.axaml.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using Avalonia.Controls;
2+
using Avalonia.Controls.Primitives;
3+
using Avalonia.Data;
24

35
namespace SourceGit.Views
46
{
@@ -7,6 +9,7 @@ public partial class SetUpstream : UserControl
79
public SetUpstream()
810
{
911
InitializeComponent();
12+
TextSearch.SetTextBinding(RemoteBranchesComboBox, new Binding("Name"));
1013
}
1114
}
1215
}

0 commit comments

Comments
 (0)