1 Commits
Author SHA1 Message Date
l4kr 89bba70ee1 Replace spacebar-to-play with double-click
Opening the selected file's default player is now triggered by
double-clicking the file queue row or a track table row, instead of
pressing Space. The Delete key still removes selected queue items.

Double-clicks on the track table's Copy checkbox column are ignored
so rapidly toggling it doesn't also launch the player.
2026-07-14 11:03:40 +02:00
3 changed files with 32 additions and 12 deletions
+2 -2
View File
@@ -9,8 +9,8 @@
<ImplicitUsings>enable</ImplicitUsings> <ImplicitUsings>enable</ImplicitUsings>
<AssemblyName>Futonizer</AssemblyName> <AssemblyName>Futonizer</AssemblyName>
<RootNamespace>Futonizer</RootNamespace> <RootNamespace>Futonizer</RootNamespace>
<Version>1.0.10</Version> <Version>1.0.11</Version>
<FileVersion>1.0.10.0</FileVersion> <FileVersion>1.0.11.0</FileVersion>
<ApplicationIcon>Assets\app.ico</ApplicationIcon> <ApplicationIcon>Assets\app.ico</ApplicationIcon>
</PropertyGroup> </PropertyGroup>
+2 -1
View File
@@ -149,6 +149,7 @@
VirtualizingPanel.ScrollUnit="Pixel" VirtualizingPanel.ScrollUnit="Pixel"
PreviewMouseWheel="SmoothList_PreviewMouseWheel" PreviewMouseWheel="SmoothList_PreviewMouseWheel"
PreviewKeyDown="FileQueueList_PreviewKeyDown" PreviewKeyDown="FileQueueList_PreviewKeyDown"
MouseDoubleClick="FileQueueList_MouseDoubleClick"
ItemContainerStyle="{StaticResource QueueListBoxItemStyle}" ItemContainerStyle="{StaticResource QueueListBoxItemStyle}"
SelectionChanged="FileQueueList_SelectionChanged"> SelectionChanged="FileQueueList_SelectionChanged">
<ListBox.ItemTemplate> <ListBox.ItemTemplate>
@@ -289,7 +290,7 @@
GridLinesVisibility="None" GridLinesVisibility="None"
VirtualizingPanel.ScrollUnit="Pixel" VirtualizingPanel.ScrollUnit="Pixel"
PreviewMouseWheel="SmoothList_PreviewMouseWheel" PreviewMouseWheel="SmoothList_PreviewMouseWheel"
PreviewKeyDown="TrackGrid_PreviewKeyDown" MouseDoubleClick="TrackGrid_MouseDoubleClick"
ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.HorizontalScrollBarVisibility="Auto"
ScrollViewer.VerticalScrollBarVisibility="Auto"> ScrollViewer.VerticalScrollBarVisibility="Auto">
<DataGrid.RowStyle> <DataGrid.RowStyle>
+28 -9
View File
@@ -519,13 +519,6 @@ public partial class MainWindow : FluentWindow
/// </summary> /// </summary>
private void FileQueueList_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) private void FileQueueList_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
{ {
if (e.Key == System.Windows.Input.Key.Space)
{
OpenSelectedFileInDefaultPlayer();
e.Handled = true;
return;
}
if (e.Key != System.Windows.Input.Key.Delete) return; if (e.Key != System.Windows.Input.Key.Delete) return;
var selected = FileQueueList.SelectedItems.Cast<QueuedFileItem>().ToList(); var selected = FileQueueList.SelectedItems.Cast<QueuedFileItem>().ToList();
@@ -545,13 +538,39 @@ public partial class MainWindow : FluentWindow
/// Windows has associated with .mkv files (typically the default video /// Windows has associated with .mkv files (typically the default video
/// player), so the user can quickly preview a file without leaving the app. /// player), so the user can quickly preview a file without leaving the app.
/// </summary> /// </summary>
private void TrackGrid_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e) private void FileQueueList_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{ {
if (e.Key != System.Windows.Input.Key.Space) return;
OpenSelectedFileInDefaultPlayer(); OpenSelectedFileInDefaultPlayer();
e.Handled = true; e.Handled = true;
} }
/// <summary>
/// Same as <see cref="FileQueueList_MouseDoubleClick"/>, but for the track
/// table. Ignores double-clicks on the "Copy" checkbox column so toggling
/// it rapidly doesn't also launch the default player.
/// </summary>
private void TrackGrid_MouseDoubleClick(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
if (e.OriginalSource is DependencyObject source && FindAncestor<CheckBox>(source) != null) return;
OpenSelectedFileInDefaultPlayer();
e.Handled = true;
}
/// <summary>
/// Walks up the visual tree from <paramref name="source"/> looking for an
/// ancestor (or the element itself) of type <typeparamref name="T"/>.
/// </summary>
private static T? FindAncestor<T>(DependencyObject source) where T : DependencyObject
{
var current = source;
while (current != null)
{
if (current is T typed) return typed;
current = System.Windows.Media.VisualTreeHelper.GetParent(current);
}
return null;
}
private void OpenSelectedFileInDefaultPlayer() private void OpenSelectedFileInDefaultPlayer()
{ {
if (FileQueueList.SelectedItem is not QueuedFileItem item) return; if (FileQueueList.SelectedItem is not QueuedFileItem item) return;