enhance: simpfy the way to lock a worktree

This commit is contained in:
leo 2024-06-27 19:19:21 +08:00
parent 8a8aabede3
commit fa2c7c0e18
No known key found for this signature in database
10 changed files with 25 additions and 125 deletions

View file

@ -13,7 +13,7 @@
<TextBlock FontSize="18"
Classes="bold"
Text="{DynamicResource Text.AddWorktree}"/>
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,Auto" ColumnDefinitions="150,*">
<Grid Margin="0,16,0,0" RowDefinitions="32,32,32,Auto" ColumnDefinitions="120,*">
<TextBlock Grid.Row="0" Grid.Column="0"
HorizontalAlignment="Right" VerticalAlignment="Center"
Margin="0,0,8,0"
@ -22,7 +22,8 @@
x:Name="TxtLocation"
Height="28"
CornerRadius="3"
Text="{Binding FullPath, Mode=TwoWay}">
Text="{Binding Path, Mode=TwoWay}"
Watermark="{DynamicResource Text.AddWorktree.Location.Placeholder}">
<TextBox.InnerRightContent>
<Button Classes="icon_button" Width="28" Height="28" Margin="4,0,0,0" Click="SelectLocation">
<Path Data="{StaticResource Icons.Folder.Open}" Fill="{DynamicResource Brush.FG1}"/>

View file

@ -1,41 +0,0 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:m="using:SourceGit.Models"
xmlns:vm="using:SourceGit.ViewModels"
xmlns:v="using:SourceGit.Views"
xmlns:c="using:SourceGit.Converters"
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
x:Class="SourceGit.Views.LockWorktree"
x:DataType="vm:LockWorktree">
<StackPanel Orientation="Vertical" Margin="8,0,0,0">
<TextBlock FontSize="18"
Classes="bold"
Text="{DynamicResource Text.LockWorktree}"/>
<Grid Margin="8,16,0,0" RowDefinitions="32,32" ColumnDefinitions="120,*">
<TextBlock Grid.Row="0" Grid.Column="0"
HorizontalAlignment="Right"
Margin="8,0"
Text="{DynamicResource Text.LockWorktree.Target}"/>
<Grid Grid.Row="0" Grid.Column="1" ColumnDefinitions="Auto,*">
<Path Grid.Column="0" Width="12" Height="12" Data="{StaticResource Icons.Worktree}"/>
<TextBlock Grid.Column="1" Classes="monospace" Margin="8,0,0,0" TextTrimming="CharacterEllipsis">
<Run Text="{Binding Target.FullPath}"/>
<Run Text="{Binding Target.Name}" Foreground="{DynamicResource Brush.FG2}"/>
</TextBlock>
</Grid>
<TextBlock Grid.Row="1" Grid.Column="0"
HorizontalAlignment="Right"
Margin="8,0"
Text="{DynamicResource Text.LockWorktree.Reason}"/>
<TextBox Grid.Row="1" Grid.Column="1"
Height="26"
CornerRadius="3"
Text="{Binding Reason, Mode=TwoWay}"
Watermark="{DynamicResource Text.LockWorktree.Reason.Placeholder}"
v:AutoFocusBehaviour.IsEnabled="True"/>
</Grid>
</StackPanel>
</UserControl>

View file

@ -1,12 +0,0 @@
using Avalonia.Controls;
namespace SourceGit.Views
{
public partial class LockWorktree : UserControl
{
public LockWorktree()
{
InitializeComponent();
}
}
}