Double-clicking a channel auto-opens export setup (#1493)

Co-authored-by: Tyrrrz <1935960+Tyrrrz@users.noreply.github.com>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This commit is contained in:
Copilot
2026-02-27 19:10:19 +02:00
committed by GitHub
parent 40491bdc0f
commit 5e39611395
2 changed files with 18 additions and 1 deletions

View File

@@ -160,7 +160,8 @@
<Grid
Background="Transparent"
Classes.category="{Binding Channel.IsCategory}"
ColumnDefinitions="Auto,*,Auto">
ColumnDefinitions="Auto,*,Auto"
DoubleTapped="ChannelGrid_OnDoubleTapped">
<Grid.Styles>
<Style Selector="Grid">
<Style Selector="^:not(.category)">

View File

@@ -1,5 +1,6 @@
using System.Linq;
using Avalonia.Controls;
using Avalonia.Input;
using Avalonia.Interactivity;
using DiscordChatExporter.Core.Discord.Data;
using DiscordChatExporter.Gui.Framework;
@@ -22,6 +23,21 @@ public partial class DashboardView : UserControl<DashboardViewModel>
SelectionChangedEventArgs args
) => DataContext.PullChannelsCommand.Execute(null);
private void ChannelGrid_OnDoubleTapped(object? sender, TappedEventArgs args)
{
if (sender is not Control { DataContext: ChannelConnection channelConnection })
{
return;
}
if (channelConnection.Channel.IsCategory)
{
return;
}
DataContext.ExportCommand.Execute(null);
}
private void AvailableChannelsTreeView_OnSelectionChanged(
object? sender,
SelectionChangedEventArgs args