mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-23 20:47:25 -08:00
style: use TextBox.InnerLeftContent and TextBox.InnerRightContent instead of custom layout for search
This commit is contained in:
parent
13c5c116fd
commit
c1c47074f4
5 changed files with 109 additions and 118 deletions
|
@ -17,30 +17,28 @@
|
|||
|
||||
<Grid Grid.Column="0" RowDefinitions="26,*">
|
||||
<!-- Search & Display Mode -->
|
||||
<Grid Grid.Row="0" ColumnDefinitions="24,*,24,24">
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Background="Transparent"
|
||||
BorderBrush="{DynamicResource Brush.Border2}"
|
||||
BorderThickness="1"/>
|
||||
<Path Grid.Column="0"
|
||||
Width="14" Height="14"
|
||||
Fill="{DynamicResource Brush.FG2}"
|
||||
Data="{StaticResource Icons.Search}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Classes="no_background no_border"
|
||||
Height="24"
|
||||
<Grid Grid.Row="0" ColumnDefinitions="*,24">
|
||||
<TextBox Grid.Column="0"
|
||||
FontSize="12"
|
||||
CornerRadius="0"
|
||||
Height="26"
|
||||
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"
|
||||
Background="Transparent"
|
||||
Watermark="{DynamicResource Text.CommitDetail.Changes.Search}"
|
||||
Text="{Binding SearchChangeFilter, Mode=TwoWay}"/>
|
||||
<Button Grid.Column="2"
|
||||
Classes="icon_button"
|
||||
IsVisible="{Binding SearchChangeFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Command="{Binding ClearSearchChangeFilter}">
|
||||
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
Text="{Binding SearchChangeFilter, Mode=TwoWay}">
|
||||
<TextBox.InnerLeftContent>
|
||||
<Path Width="14" Height="14" Margin="4,0,0,0" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Search}"/>
|
||||
</TextBox.InnerLeftContent>
|
||||
|
||||
<v:ChangeViewModeSwitcher Grid.Column="3"
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Classes="icon_button"
|
||||
IsVisible="{Binding SearchChangeFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Command="{Binding ClearSearchChangeFilter}">
|
||||
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
|
||||
<v:ChangeViewModeSwitcher Grid.Column="1"
|
||||
Width="18" Height="18"
|
||||
HorizontalAlignment="Right"
|
||||
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode, Mode=TwoWay}"/>
|
||||
|
|
|
@ -359,36 +359,40 @@
|
|||
<!-- Left Search Mode -->
|
||||
<Grid Grid.Column="0" RowDefinitions="32,*" IsVisible="{Binding IsSearching}" PropertyChanged="OnSearchCommitPanelPropertyChanged">
|
||||
<!-- Search -->
|
||||
<Grid Grid.Row="0" Margin="4,2">
|
||||
<TextBox Grid.Column="1"
|
||||
x:Name="txtSearchCommitsBox"
|
||||
Padding="22,0"
|
||||
FontSize="12"
|
||||
Height="24"
|
||||
Background="{DynamicResource Brush.Contents}"
|
||||
BorderBrush="{DynamicResource Brush.Border2}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="12"
|
||||
Watermark="{DynamicResource Text.Repository.SearchTip}"
|
||||
Text="{Binding SearchCommitFilter, Mode=TwoWay}"
|
||||
KeyDown="OnSearchKeyDown"/>
|
||||
<Path Width="14" Height="14"
|
||||
Margin="6,0,0,0"
|
||||
Fill="{DynamicResource Brush.FG2}"
|
||||
Data="{StaticResource Icons.Search}"
|
||||
HorizontalAlignment="Left"/>
|
||||
<Button Classes="icon_button"
|
||||
Width="16"
|
||||
Margin="0,0,6,0"
|
||||
Command="{Binding ClearSearchCommitFilter}"
|
||||
IsVisible="{Binding SearchCommitFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
HorizontalAlignment="Right">
|
||||
<TextBox Grid.Row="0"
|
||||
x:Name="txtSearchCommitsBox"
|
||||
Margin="4,2"
|
||||
FontSize="12"
|
||||
Height="24"
|
||||
CornerRadius="12"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource Brush.Border2}"
|
||||
Background="{DynamicResource Brush.Contents}"
|
||||
Watermark="{DynamicResource Text.Repository.SearchTip}"
|
||||
Text="{Binding SearchCommitFilter, Mode=TwoWay}"
|
||||
VerticalContentAlignment="Center"
|
||||
KeyDown="OnSearchKeyDown">
|
||||
<TextBox.InnerLeftContent>
|
||||
<Path Width="14" Height="14"
|
||||
Margin="0,1,0,0"
|
||||
Fill="{DynamicResource Brush.FG1}"
|
||||
Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
Margin="6,0,0,0"
|
||||
Fill="{DynamicResource Brush.FG2}"
|
||||
Data="{StaticResource Icons.Search}"/>
|
||||
</TextBox.InnerLeftContent>
|
||||
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Classes="icon_button"
|
||||
Width="16"
|
||||
Margin="0,0,6,0"
|
||||
Command="{Binding ClearSearchCommitFilter}"
|
||||
IsVisible="{Binding SearchCommitFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
HorizontalAlignment="Right">
|
||||
<Path Width="14" Height="14"
|
||||
Margin="0,1,0,0"
|
||||
Fill="{DynamicResource Brush.FG1}"
|
||||
Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
|
||||
<DataGrid Grid.Row="1"
|
||||
ItemsSource="{Binding SearchedCommits}"
|
||||
|
|
|
@ -56,30 +56,28 @@
|
|||
|
||||
<Grid Grid.Column="0" RowDefinitions="26,*">
|
||||
<!-- Search & Display Mode -->
|
||||
<Grid Grid.Row="0" ColumnDefinitions="24,*,24,24">
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Background="Transparent"
|
||||
BorderBrush="{DynamicResource Brush.Border2}"
|
||||
BorderThickness="1"/>
|
||||
<Path Grid.Column="0"
|
||||
Width="14" Height="14"
|
||||
Fill="{DynamicResource Brush.FG2}"
|
||||
Data="{StaticResource Icons.Search}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Classes="no_background no_border"
|
||||
<Grid Grid.Row="0" ColumnDefinitions="*,24">
|
||||
<TextBox Grid.Column="0"
|
||||
FontSize="12"
|
||||
Height="24"
|
||||
CornerRadius="0"
|
||||
Height="26"
|
||||
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"
|
||||
Background="Transparent"
|
||||
Watermark="{DynamicResource Text.CommitDetail.Changes.Search}"
|
||||
Text="{Binding SearchFilter, Mode=TwoWay}"/>
|
||||
<Button Grid.Column="2"
|
||||
Classes="icon_button"
|
||||
IsVisible="{Binding SearchFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Command="{Binding ClearSearchFilter}">
|
||||
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
Text="{Binding SearchFilter, Mode=TwoWay}">
|
||||
<TextBox.InnerLeftContent>
|
||||
<Path Width="14" Height="14" Margin="4,0,0,0" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Search}"/>
|
||||
</TextBox.InnerLeftContent>
|
||||
|
||||
<v:ChangeViewModeSwitcher Grid.Column="3"
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Classes="icon_button"
|
||||
IsVisible="{Binding SearchFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Command="{Binding ClearSearchFilter}">
|
||||
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
|
||||
<v:ChangeViewModeSwitcher Grid.Column="1"
|
||||
Width="18" Height="18"
|
||||
HorizontalAlignment="Right"
|
||||
ViewMode="{Binding Source={x:Static vm:Preference.Instance}, Path=CommitChangeViewMode, Mode=TwoWay}"/>
|
||||
|
|
|
@ -19,29 +19,25 @@
|
|||
|
||||
<Grid Grid.Column="0" RowDefinitions="26,*">
|
||||
<!-- Search -->
|
||||
<Grid Grid.Row="0" ColumnDefinitions="24,*,24">
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Background="Transparent"
|
||||
BorderBrush="{DynamicResource Brush.Border2}"
|
||||
BorderThickness="1"/>
|
||||
<Path Grid.Column="0"
|
||||
Width="14" Height="14"
|
||||
Fill="{DynamicResource Brush.FG2}"
|
||||
Data="{StaticResource Icons.Search}"/>
|
||||
<TextBox Grid.Column="1"
|
||||
Classes="no_background no_border"
|
||||
FontSize="12"
|
||||
Height="24"
|
||||
CornerRadius="0"
|
||||
Watermark="{DynamicResource Text.CommitDetail.Changes.Search}"
|
||||
Text="{Binding SearchFileFilter, Mode=TwoWay}"/>
|
||||
<Button Grid.Column="2"
|
||||
Classes="icon_button"
|
||||
IsVisible="{Binding SearchFileFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Command="{Binding ClearSearchFileFilter}">
|
||||
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<TextBox Grid.Row="0"
|
||||
FontSize="12"
|
||||
Height="26"
|
||||
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border2}"
|
||||
Background="Transparent"
|
||||
Watermark="{DynamicResource Text.CommitDetail.Changes.Search}"
|
||||
Text="{Binding SearchFileFilter, Mode=TwoWay}">
|
||||
<TextBox.InnerLeftContent>
|
||||
<Path Width="14" Height="14" Margin="4,0,0,0" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Search}"/>
|
||||
</TextBox.InnerLeftContent>
|
||||
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Classes="icon_button"
|
||||
IsVisible="{Binding SearchFileFilter, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"
|
||||
Command="{Binding ClearSearchFileFilter}">
|
||||
<Path Width="14" Height="14" Fill="{DynamicResource Brush.FG2}" Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
|
||||
<!-- File Tree -->
|
||||
<Border Grid.Row="1" Margin="0,4,0,0" BorderBrush="{DynamicResource Brush.Border2}" BorderThickness="1" Background="{DynamicResource Brush.Contents}">
|
||||
|
|
|
@ -27,31 +27,26 @@
|
|||
|
||||
<Grid Grid.Row="1" Margin="0,8" ColumnDefinitions="*,600,*">
|
||||
<Grid Grid.Column="1" RowDefinitions="Auto,*">
|
||||
<Grid Grid.Row="0" ColumnDefinitions="28,*,Auto">
|
||||
<Border Grid.Column="0" Grid.ColumnSpan="3"
|
||||
Height="32"
|
||||
CornerRadius="16"
|
||||
BorderBrush="{DynamicResource Brush.Border0}"
|
||||
BorderThickness="1"
|
||||
Background="{DynamicResource Brush.Contents}"/>
|
||||
<TextBox Grid.Row="0"
|
||||
Height="32"
|
||||
Padding="0"
|
||||
CornerRadius="16"
|
||||
BorderBrush="{DynamicResource Brush.Border0}"
|
||||
BorderThickness="1"
|
||||
Background="{DynamicResource Brush.Contents}"
|
||||
Watermark="{DynamicResource Text.Welcome.Search}"
|
||||
VerticalContentAlignment="Center"
|
||||
Text="{Binding SearchFilter, Mode=TwoWay}">
|
||||
<TextBox.InnerLeftContent>
|
||||
<Path Width="16" Height="16" Margin="6,0,3,0" Data="{StaticResource Icons.Search}" Fill="{DynamicResource Brush.FG1}"/>
|
||||
</TextBox.InnerLeftContent>
|
||||
|
||||
<Path Grid.Column="0"
|
||||
Width="16" Height="16"
|
||||
Margin="4,0,0,0"
|
||||
Data="{StaticResource Icons.Search}"/>
|
||||
|
||||
<TextBox Grid.Column="1"
|
||||
Height="24"
|
||||
Padding="0"
|
||||
Classes="no_border no_background"
|
||||
Watermark="{DynamicResource Text.Welcome.Search}"
|
||||
VerticalContentAlignment="Center"
|
||||
Text="{Binding SearchFilter, Mode=TwoWay}"/>
|
||||
|
||||
<Button Grid.Column="2" Classes="icon_button" IsVisible="{Binding IsClearSearchVisible}" Command="{Binding ClearSearchFilter}">
|
||||
<Path Width="16" Height="16" Margin="0,0,4,0" Data="{StaticResource Icons.Clear}"/>
|
||||
</Button>
|
||||
</Grid>
|
||||
<TextBox.InnerRightContent>
|
||||
<Button Classes="icon_button" IsVisible="{Binding IsClearSearchVisible}" Command="{Binding ClearSearchFilter}">
|
||||
<Path Width="16" Height="16" Margin="0,0,0,0" Data="{StaticResource Icons.Clear}" Fill="{DynamicResource Brush.FG1}"/>
|
||||
</Button>
|
||||
</TextBox.InnerRightContent>
|
||||
</TextBox>
|
||||
|
||||
<TreeView Grid.Row="1"
|
||||
Margin="0,8,8,0"
|
||||
|
|
Loading…
Reference in a new issue