mirror of
https://github.com/muskit/MercuryConverter.git
synced 2026-06-02 20:24:26 -07:00
add filtering
This commit is contained in:
@@ -22,6 +22,7 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
|
|
||||||
<Menu Name="MenuBar" DockPanel.Dock="Top">
|
<Menu Name="MenuBar" DockPanel.Dock="Top">
|
||||||
<MenuItem Header="File">
|
<MenuItem Header="File">
|
||||||
<MenuItem Header="Open Data Folder..." />
|
<MenuItem Header="Open Data Folder..." />
|
||||||
@@ -32,6 +33,7 @@
|
|||||||
<TabItem Header="selection">
|
<TabItem Header="selection">
|
||||||
<UserControl Name="SelectionControl"/>
|
<UserControl Name="SelectionControl"/>
|
||||||
</TabItem>
|
</TabItem>
|
||||||
|
|
||||||
<TabItem Header="export">
|
<TabItem Header="export">
|
||||||
</TabItem>
|
</TabItem>
|
||||||
</TabControl>
|
</TabControl>
|
||||||
|
|||||||
@@ -6,21 +6,39 @@
|
|||||||
x:Class="MercuryConverter.Views.Selection"
|
x:Class="MercuryConverter.Views.Selection"
|
||||||
>
|
>
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<ContentControl Name="SelectionInfo" DockPanel.Dock="Right" Width="250">
|
<!-- Sidebar -->
|
||||||
<StackPanel Margin="12">
|
<TabControl Margin="8 8 0 0" Width="250" DockPanel.Dock="Right">
|
||||||
|
<TabControl.Resources>
|
||||||
|
<ResourceDictionary>
|
||||||
|
<Thickness x:Key="TabItemHeaderMargin">12 0 12 15</Thickness>
|
||||||
|
<Thickness x:Key="TabItemMargin">0 0 0 0</Thickness>
|
||||||
|
</ResourceDictionary>
|
||||||
|
</TabControl.Resources>
|
||||||
|
|
||||||
|
<TabItem Header="Info" FontSize="16">
|
||||||
|
<StackPanel Name="SelectionInfo">
|
||||||
<Image Name="InfoImageJacket" Margin="24 0 24 0" Source="/Assets/imgs/jacket-placeholder.png"/>
|
<Image Name="InfoImageJacket" Margin="24 0 24 0" Source="/Assets/imgs/jacket-placeholder.png"/>
|
||||||
<TextBlock Name="InfoNameText" Text="Name" FontWeight="Bold" HorizontalAlignment="Center" Margin="0 10 0 0"/>
|
<TextBlock Name="InfoNameText" Text="Name" FontWeight="Bold" HorizontalAlignment="Center" Margin="0 10 0 0"/>
|
||||||
<TextBlock Name="InfoArtistText" Text="Artist" HorizontalAlignment="Center"/>
|
<TextBlock Name="InfoArtistText" Text="Artist" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Name="InfoSourceText" Text="Source" HorizontalAlignment="Center"/>
|
<TextBlock Name="InfoSourceText" Text="Source" HorizontalAlignment="Center"/>
|
||||||
<UserControl Margin="0 24 0 0">
|
|
||||||
|
|
||||||
</UserControl>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</ContentControl>
|
</TabItem>
|
||||||
<DockPanel Margin="0 0 8 0">
|
<TabItem Header="Filters" FontSize="16">
|
||||||
|
<StackPanel>
|
||||||
|
<!-- Sources Filter -->
|
||||||
|
<TextBlock Text="Sources" FontWeight="Bold" Margin="0 0 0 4"/>
|
||||||
|
<StackPanel Margin="10 0 0 0" Name="FilterSourceContainer"/>
|
||||||
|
<!-- Categories Filter -->
|
||||||
|
<TextBlock Text="Categories" FontWeight="Bold" Margin="0 20 0 4"/>
|
||||||
|
<StackPanel Margin="10 0 0 0" Name="FilterCategoryContainer"/>
|
||||||
|
</StackPanel>
|
||||||
|
</TabItem>
|
||||||
|
</TabControl>
|
||||||
|
<!-- Song Listing Table -->
|
||||||
|
<DockPanel>
|
||||||
<DockPanel Margin="0 4 0 8" DockPanel.Dock="Top">
|
<DockPanel Margin="0 4 0 8" DockPanel.Dock="Top">
|
||||||
<ComboBox DockPanel.Dock="Right" Width="160" PlaceholderText="Source filter" Name="SourceFilter"/>
|
<!-- <ComboBox DockPanel.Dock="Right" Width="160" PlaceholderText="Source filter" Name="SourceFilter"/> -->
|
||||||
<TextBox Margin="0 0 8 0" Watermark="Search for title, artist, designer..."/>
|
<TextBox Watermark="Search for title, artist, designer..."/>
|
||||||
</DockPanel>
|
</DockPanel>
|
||||||
<UserControl Background="{DynamicResource DataGridContentBackground}">
|
<UserControl Background="{DynamicResource DataGridContentBackground}">
|
||||||
<DataGrid Name="ListingTable" IsReadOnly="True" SelectionMode="Extended" ItemsSource="{Binding SongCollection}">
|
<DataGrid Name="ListingTable" IsReadOnly="True" SelectionMode="Extended" ItemsSource="{Binding SongCollection}">
|
||||||
|
|||||||
@@ -1,8 +1,11 @@
|
|||||||
|
using Microsoft.VisualBasic;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.ObjectModel;
|
using System.Collections.ObjectModel;
|
||||||
using System.Collections.Specialized;
|
using System.Collections.Specialized;
|
||||||
|
using System.Threading.Tasks;
|
||||||
using Avalonia.Controls;
|
using Avalonia.Controls;
|
||||||
using MercuryConverter.Data;
|
using MercuryConverter.Data;
|
||||||
|
using Avalonia;
|
||||||
|
|
||||||
namespace MercuryConverter.Views;
|
namespace MercuryConverter.Views;
|
||||||
|
|
||||||
@@ -13,19 +16,35 @@ public partial class Selection : Panel
|
|||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
ListingTable.SelectionMode = DataGridSelectionMode.Extended;
|
ListingTable.SelectionMode = DataGridSelectionMode.Extended;
|
||||||
SourceFilter.ItemsSource = new string[]{
|
|
||||||
"",
|
foreach (var (k, v) in Consts.NUM_SOURCE)
|
||||||
Consts.NUM_SOURCE[1],
|
{
|
||||||
Consts.NUM_SOURCE[2],
|
FilterSourceContainer.Children.Add(
|
||||||
Consts.NUM_SOURCE[3],
|
new CheckBox
|
||||||
Consts.NUM_SOURCE[4],
|
{
|
||||||
Consts.NUM_SOURCE[5],
|
Name = $"FilterSourceCheckbox{k}",
|
||||||
};
|
Content = v,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
foreach (var (k, v) in Consts.CATEGORY_INDEX)
|
||||||
|
{
|
||||||
|
if (k == -1)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
FilterCategoryContainer.Children.Add(
|
||||||
|
new CheckBox
|
||||||
|
{
|
||||||
|
Name = $"FilterCategoryCheckbox{k}",
|
||||||
|
Content = v,
|
||||||
|
}
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
SongCollection.CollectionChanged += OnSongsChg;
|
SongCollection.CollectionChanged += OnSongsChg;
|
||||||
DataContext = this;
|
DataContext = this;
|
||||||
|
|
||||||
// test data
|
// placeholder data
|
||||||
if (SongCollection.Count == 0)
|
if (SongCollection.Count == 0)
|
||||||
{
|
{
|
||||||
SongCollection.Add(
|
SongCollection.Add(
|
||||||
|
|||||||
Reference in New Issue
Block a user