style: use TextBox.InnerLeftContent and TextBox.InnerRightContent instead of custom layout for search

This commit is contained in:
leo 2024-03-12 09:53:52 +08:00
parent ea3e28b5e7
commit b8a230cf16
6 changed files with 114 additions and 102 deletions

View file

@ -41,17 +41,19 @@
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{DynamicResource Text.SSHKey}" Text="{DynamicResource Text.SSHKey}"
IsVisible="{Binding UseSSH}"/> IsVisible="{Binding UseSSH}"/>
<Grid Grid.Row="2" Grid.Column="2" Height="32" ColumnDefinitions="*,Auto" IsVisible="{Binding UseSSH}"> <TextBox Grid.Row="2" Grid.Column="1"
<TextBox Grid.Column="0" x:Name="txtSSHKey"
x:Name="txtSSHKey" Height="28"
Height="26" CornerRadius="3"
CornerRadius="3" IsVisible="{Binding UseSSH}"
Watermark="{DynamicResource Text.SSHKey.Placeholder}" Watermark="{DynamicResource Text.SSHKey.Placeholder}"
Text="{Binding SSHKey, Mode=TwoWay}"/> Text="{Binding SSHKey, Mode=TwoWay}">
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectSSHKey"> <TextBox.InnerRightContent>
<Path Data="{StaticResource Icons.Folder.Open}"/> <Button Classes="icon_button" Width="30" Height="30" Click="SelectSSHKey">
</Button> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Grid> </Button>
</TextBox.InnerRightContent>
</TextBox>
</Grid> </Grid>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View file

@ -18,17 +18,18 @@
HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{DynamicResource Text.Apply.File}"/> Text="{DynamicResource Text.Apply.File}"/>
<Grid Grid.Row="0" Grid.Column="1" ColumnDefinitions="*,Auto"> <TextBox Grid.Row="0" Grid.Column="1"
<TextBox Grid.Column="0" x:Name="txtPatchFile"
x:Name="txtPatchFile" Height="28"
Height="28" CornerRadius="3"
CornerRadius="3" Watermark="{DynamicResource Text.Apply.File.Placeholder}"
Watermark="{DynamicResource Text.Apply.File.Placeholder}" Text="{Binding PatchFile, Mode=TwoWay}">
Text="{Binding PatchFile, Mode=TwoWay}"/> <TextBox.InnerRightContent>
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectPatchFile"> <Button Classes="icon_button" Width="30" Height="30" Click="SelectPatchFile">
<Path Data="{StaticResource Icons.Folder.Open}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button> </Button>
</Grid> </TextBox.InnerRightContent>
</TextBox>
<TextBlock Grid.Row="1" Grid.Column="0" <TextBlock Grid.Row="1" Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center"

View file

@ -47,17 +47,18 @@
HorizontalAlignment="Right" VerticalAlignment="Center" HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{DynamicResource Text.Archive.File}"/> Text="{DynamicResource Text.Archive.File}"/>
<Grid Grid.Row="1" Grid.Column="1" ColumnDefinitions="*,Auto"> <TextBox Grid.Row="1" Grid.Column="1"
<TextBox Grid.Column="0" x:Name="txtSaveFile"
x:Name="txtSaveFile" Height="28"
Height="28" CornerRadius="3"
CornerRadius="3" Watermark="{DynamicResource Text.Archive.File.Placeholder}"
Watermark="{DynamicResource Text.Archive.File.Placeholder}" Text="{Binding SaveFile, Mode=TwoWay}">
Text="{Binding SaveFile, Mode=TwoWay}"/> <TextBox.InnerRightContent>
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectOutputFile"> <Button Classes="icon_button" Width="30" Height="30" Click="SelectOutputFile">
<Path Data="{StaticResource Icons.Folder.Open}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button> </Button>
</Grid> </TextBox.InnerRightContent>
</TextBox>
</Grid> </Grid>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View file

@ -17,30 +17,32 @@
</Grid> </Grid>
<Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="120,*" IsVisible="{Binding UseSSH}"> <Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="120,*" IsVisible="{Binding UseSSH}">
<TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.SSHKey}"/> <TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.SSHKey}"/>
<Grid Grid.Column="1" ColumnDefinitions="*,Auto"> <TextBox Grid.Column="1"
<TextBox Grid.Column="0" x:Name="txtSSHKey"
x:Name="txtSSHKey" Height="28"
Height="28" CornerRadius="3"
CornerRadius="3" Watermark="{DynamicResource Text.SSHKey.Placeholder}"
Watermark="{DynamicResource Text.SSHKey.Placeholder}" Text="{Binding SSHKey, Mode=TwoWay}">
Text="{Binding SSHKey, Mode=TwoWay}"/> <TextBox.InnerRightContent>
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectSSHKey"> <Button Classes="icon_button" Width="30" Height="30" Click="SelectSSHKey">
<Path Data="{StaticResource Icons.Folder.Open}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button> </Button>
</Grid> </TextBox.InnerRightContent>
</TextBox>
</Grid> </Grid>
<Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="120,*"> <Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="120,*">
<TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.Clone.ParentFolder}"/> <TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.Clone.ParentFolder}"/>
<Grid Grid.Column="1" ColumnDefinitions="*,Auto"> <TextBox Grid.Column="1"
<TextBox Grid.Column="0" x:Name="txtParentFolder"
x:Name="txtParentFolder" Height="28"
Height="28" CornerRadius="3"
CornerRadius="3" Text="{Binding ParentFolder, Mode=TwoWay}">
Text="{Binding ParentFolder, Mode=TwoWay}"/> <TextBox.InnerRightContent>
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectParentFolder"> <Button Classes="icon_button" Width="30" Height="30" Margin="4,0,0,0" Click="SelectParentFolder">
<Path Data="{StaticResource Icons.Folder.Open}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button> </Button>
</Grid> </TextBox.InnerRightContent>
</TextBox>
</Grid> </Grid>
<Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="120,*"> <Grid Margin="8,4,0,0" Height="28" ColumnDefinitions="120,*">
<TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.Clone.LocalName}"/> <TextBlock Grid.Column="0" HorizontalAlignment="Right" Margin="0,0,8,0" Text="{DynamicResource Text.Clone.LocalName}"/>

View file

@ -41,17 +41,19 @@
Margin="0,0,8,0" Margin="0,0,8,0"
Text="{DynamicResource Text.SSHKey}" Text="{DynamicResource Text.SSHKey}"
IsVisible="{Binding UseSSH}"/> IsVisible="{Binding UseSSH}"/>
<Grid Grid.Row="2" Grid.Column="2" Height="32" ColumnDefinitions="*,Auto" IsVisible="{Binding UseSSH}"> <TextBox Grid.Row="2" Grid.Column="1"
<TextBox Grid.Column="0" x:Name="txtSSHKey"
x:Name="txtSSHKey" Height="26"
Height="26" CornerRadius="3"
CornerRadius="3" IsVisible="{Binding UseSSH}"
Watermark="{DynamicResource Text.SSHKey.Placeholder}" Watermark="{DynamicResource Text.SSHKey.Placeholder}"
Text="{Binding SSHKey, Mode=TwoWay}"/> Text="{Binding SSHKey, Mode=TwoWay}">
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectSSHKey"> <TextBox.InnerRightContent>
<Path Data="{StaticResource Icons.Folder.Open}"/> <Button Classes="icon_button" Width="30" Height="30" Click="SelectSSHKey">
</Button> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Grid> </Button>
</TextBox.InnerRightContent>
</TextBox>
</Grid> </Grid>
</StackPanel> </StackPanel>
</UserControl> </UserControl>

View file

@ -151,15 +151,16 @@
Text="{DynamicResource Text.Preference.Git.Path}" Text="{DynamicResource Text.Preference.Git.Path}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,16,0"/> Margin="0,0,16,0"/>
<Grid Grid.Row="0" Grid.Column="1" ColumnDefinitions="*,Auto"> <TextBox Grid.Row="0" Grid.Column="1"
<TextBox Grid.Column="0" Height="28"
Height="28" CornerRadius="3"
CornerRadius="3" Text="{Binding GitInstallPath, Mode=TwoWay}">
Text="{Binding GitInstallPath, Mode=TwoWay}"/> <TextBox.InnerRightContent>
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectGitExecutable"> <Button Classes="icon_button" Width="30" Height="30" Click="SelectGitExecutable">
<Path Data="{StaticResource Icons.Folder.Open}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button> </Button>
</Grid> </TextBox.InnerRightContent>
</TextBox>
<TextBlock Grid.Row="1" Grid.Column="0" <TextBlock Grid.Row="1" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.Version}" Text="{DynamicResource Text.Preference.Git.Version}"
@ -172,15 +173,16 @@
Text="{DynamicResource Text.Preference.Git.DefaultCloneDir}" Text="{DynamicResource Text.Preference.Git.DefaultCloneDir}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,16,0"/> Margin="0,0,16,0"/>
<Grid Grid.Row="2" Grid.Column="1" ColumnDefinitions="*,Auto"> <TextBox Grid.Row="2" Grid.Column="1"
<TextBox Grid.Column="0" Height="28"
Height="28" CornerRadius="3"
CornerRadius="3" Text="{Binding GitDefaultCloneDir, Mode=TwoWay}">
Text="{Binding GitDefaultCloneDir, Mode=TwoWay}"/> <TextBox.InnerRightContent>
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectDefaultCloneDir"> <Button Classes="icon_button" Width="30" Height="30" Click="SelectDefaultCloneDir">
<Path Data="{StaticResource Icons.Folder.Open}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button> </Button>
</Grid> </TextBox.InnerRightContent>
</TextBox>
<TextBlock Grid.Row="3" Grid.Column="0" <TextBlock Grid.Row="3" Grid.Column="0"
Text="{DynamicResource Text.Preference.Git.User}" Text="{DynamicResource Text.Preference.Git.User}"
@ -245,16 +247,17 @@
Text="{DynamicResource Text.Preference.GPG.Path}" Text="{DynamicResource Text.Preference.GPG.Path}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,16,0"/> Margin="0,0,16,0"/>
<Grid Grid.Row="1" Grid.Column="1" ColumnDefinitions="*,Auto"> <TextBox Grid.Row="1" Grid.Column="1"
<TextBox Grid.Column="0" x:Name="txtGPGExecutable"
x:Name="txtGPGExecutable" Height="28"
Height="28" CornerRadius="3"
CornerRadius="3" Text="{Binding #me.GPGExecutableFile, Mode=TwoWay}">
Text="{Binding #me.GPGExecutableFile, Mode=TwoWay}"/> <TextBox.InnerRightContent>
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectGPGExecutable"> <Button Classes="icon_button" Width="30" Height="30" Click="SelectGPGExecutable">
<Path Data="{StaticResource Icons.Folder.Open}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button> </Button>
</Grid> </TextBox.InnerRightContent>
</TextBox>
<TextBlock Grid.Row="2" Grid.Column="0" <TextBlock Grid.Row="2" Grid.Column="0"
Text="{DynamicResource Text.Preference.GPG.UserKey}" Text="{DynamicResource Text.Preference.GPG.UserKey}"
@ -290,15 +293,16 @@
Text="{DynamicResource Text.Preference.Merger.Path}" Text="{DynamicResource Text.Preference.Merger.Path}"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Margin="0,0,16,0"/> Margin="0,0,16,0"/>
<Grid Grid.Row="1" Grid.Column="1" ColumnDefinitions="*,Auto"> <TextBox Grid.Row="1" Grid.Column="1"
<TextBox Grid.Column="0" Height="28"
Height="28" CornerRadius="3"
CornerRadius="3" Text="{Binding ExternalMergeToolPath, Mode=TwoWay}">
Text="{Binding ExternalMergeToolPath, Mode=TwoWay}"/> <TextBox.InnerRightContent>
<Button Grid.Column="1" Classes="icon_button" Width="32" Height="32" Margin="4,0,0,0" Click="SelectExternalMergeTool"> <Button Classes="icon_button" Width="30" Height="30" Click="SelectExternalMergeTool">
<Path Data="{StaticResource Icons.Folder.Open}"/> <Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>
</Button> </Button>
</Grid> </TextBox.InnerRightContent>
</TextBox>
<TextBlock Grid.Row="2" Grid.Column="0" <TextBlock Grid.Row="2" Grid.Column="0"
Text="{DynamicResource Text.Preference.Merger.CustomMergeCmd}" Text="{DynamicResource Text.Preference.Merger.CustomMergeCmd}"