fix(ui): toggle expand on full folder row click
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -59,6 +59,7 @@
|
|||||||
<TreeView.ItemTemplate>
|
<TreeView.ItemTemplate>
|
||||||
<TreeDataTemplate DataType="vm:WorktreeNodeViewModel"
|
<TreeDataTemplate DataType="vm:WorktreeNodeViewModel"
|
||||||
ItemsSource="{Binding Children}">
|
ItemsSource="{Binding Children}">
|
||||||
|
<Border Background="Transparent" Tapped="OnNodeTapped" Cursor="Hand">
|
||||||
<StackPanel Orientation="Horizontal" Spacing="8">
|
<StackPanel Orientation="Horizontal" Spacing="8">
|
||||||
<TextBlock Text="{Binding Name}"
|
<TextBlock Text="{Binding Name}"
|
||||||
FontFamily="{DynamicResource MonoFont}" FontSize="12"
|
FontFamily="{DynamicResource MonoFont}" FontSize="12"
|
||||||
@@ -71,6 +72,7 @@
|
|||||||
Foreground="{DynamicResource TextBrush}"/>
|
Foreground="{DynamicResource TextBrush}"/>
|
||||||
</Border>
|
</Border>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
</Border>
|
||||||
</TreeDataTemplate>
|
</TreeDataTemplate>
|
||||||
</TreeView.ItemTemplate>
|
</TreeView.ItemTemplate>
|
||||||
</TreeView>
|
</TreeView>
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ using Avalonia.Controls;
|
|||||||
using Avalonia.Input;
|
using Avalonia.Input;
|
||||||
using Avalonia.Media;
|
using Avalonia.Media;
|
||||||
using Avalonia.Styling;
|
using Avalonia.Styling;
|
||||||
|
using Avalonia.VisualTree;
|
||||||
using ClaudeDo.Ui.ViewModels.Modals;
|
using ClaudeDo.Ui.ViewModels.Modals;
|
||||||
|
|
||||||
namespace ClaudeDo.Ui.Views.Modals;
|
namespace ClaudeDo.Ui.Views.Modals;
|
||||||
@@ -56,6 +57,16 @@ public partial class WorktreeModalView : Window
|
|||||||
RenderTransform = new ScaleTransform(1.0, 1.0);
|
RenderTransform = new ScaleTransform(1.0, 1.0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnNodeTapped(object? sender, Avalonia.Input.TappedEventArgs e)
|
||||||
|
{
|
||||||
|
if (sender is not Control c) return;
|
||||||
|
if (c.DataContext is not WorktreeNodeViewModel node) return;
|
||||||
|
if (!node.IsDirectory) return;
|
||||||
|
var tvi = c.FindAncestorOfType<TreeViewItem>();
|
||||||
|
if (tvi is null) return;
|
||||||
|
tvi.IsExpanded = !tvi.IsExpanded;
|
||||||
|
}
|
||||||
|
|
||||||
private void OnTitleBarPressed(object? sender, PointerPressedEventArgs e)
|
private void OnTitleBarPressed(object? sender, PointerPressedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
|
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed)
|
||||||
|
|||||||
Reference in New Issue
Block a user