diff --git a/Source/LibationAvalonia/Assets/LibationStyles.xaml b/Source/LibationAvalonia/Assets/LibationStyles.xaml index 02ab0277..7b3ae474 100644 --- a/Source/LibationAvalonia/Assets/LibationStyles.xaml +++ b/Source/LibationAvalonia/Assets/LibationStyles.xaml @@ -1,8 +1,8 @@ - #FFE6FFE6 + #cdffcd - + diff --git a/Source/LibationAvalonia/Controls/DataGridTemplateColumnExt.axaml.cs b/Source/LibationAvalonia/Controls/DataGridTemplateColumnExt.axaml.cs index 5eddd4bc..b46fac89 100644 --- a/Source/LibationAvalonia/Controls/DataGridTemplateColumnExt.axaml.cs +++ b/Source/LibationAvalonia/Controls/DataGridTemplateColumnExt.axaml.cs @@ -7,10 +7,10 @@ using System.Reflection; namespace LibationAvalonia.Controls { - public class DataGridViewCellContextMenuStripNeededEventArgs + public class DataGridCellContextMenuStripNeededEventArgs { private static readonly MethodInfo GetCellValueMethod; - static DataGridViewCellContextMenuStripNeededEventArgs() + static DataGridCellContextMenuStripNeededEventArgs() { GetCellValueMethod = typeof(DataGridColumn).GetMethod("GetCellValue", BindingFlags.NonPublic | BindingFlags.Instance); } @@ -28,7 +28,7 @@ namespace LibationAvalonia.Controls public partial class DataGridTemplateColumnExt : DataGridTemplateColumn { - public event EventHandler CellContextMenuStripNeeded; + public event EventHandler CellContextMenuStripNeeded; private static readonly ContextMenu ContextMenu = new(); private static readonly AvaloniaList MenuItems = new(); @@ -43,7 +43,7 @@ namespace LibationAvalonia.Controls { if (sender is DataGridCell cell && cell.DataContext is GridEntry entry) { - var args = new DataGridViewCellContextMenuStripNeededEventArgs + var args = new DataGridCellContextMenuStripNeededEventArgs { Column = this, GridEntry = entry, diff --git a/Source/LibationAvalonia/ViewModels/GridEntry.cs b/Source/LibationAvalonia/ViewModels/GridEntry.cs index 4f055750..ec30d49f 100644 --- a/Source/LibationAvalonia/ViewModels/GridEntry.cs +++ b/Source/LibationAvalonia/ViewModels/GridEntry.cs @@ -51,7 +51,8 @@ namespace LibationAvalonia.ViewModels public abstract bool IsSeries { get; } public abstract bool IsEpisode { get; } public abstract bool IsBook { get; } - public IBrush BackgroundBrush => IsEpisode ? App.SeriesEntryGridBackgroundBrush : null; + public abstract double Opacity { get; } + public IBrush BackgroundBrush => IsEpisode ? App.SeriesEntryGridBackgroundBrush : Brushes.Transparent; #endregion diff --git a/Source/LibationAvalonia/ViewModels/LibraryBookEntry.cs b/Source/LibationAvalonia/ViewModels/LibraryBookEntry.cs index 54dc7fb8..5a2423e7 100644 --- a/Source/LibationAvalonia/ViewModels/LibraryBookEntry.cs +++ b/Source/LibationAvalonia/ViewModels/LibraryBookEntry.cs @@ -53,6 +53,7 @@ namespace LibationAvalonia.ViewModels public override bool IsSeries => false; public override bool IsEpisode => Parent is not null; public override bool IsBook => Parent is null; + public override double Opacity => Book.UserDefinedItem.Tags.ToLower().Contains("hidden") ? 0.4 : 1; #endregion @@ -99,6 +100,7 @@ namespace LibationAvalonia.ViewModels case nameof(udi.Tags): Book.UserDefinedItem.Tags = udi.Tags; this.RaisePropertyChanged(nameof(BookTags)); + this.RaisePropertyChanged(nameof(Opacity)); break; case nameof(udi.BookStatus): Book.UserDefinedItem.BookStatus = udi.BookStatus; diff --git a/Source/LibationAvalonia/ViewModels/SeriesEntry.cs b/Source/LibationAvalonia/ViewModels/SeriesEntry.cs index bd457171..eb82a99b 100644 --- a/Source/LibationAvalonia/ViewModels/SeriesEntry.cs +++ b/Source/LibationAvalonia/ViewModels/SeriesEntry.cs @@ -50,6 +50,7 @@ namespace LibationAvalonia.ViewModels public override bool IsSeries => true; public override bool IsEpisode => false; public override bool IsBook => false; + public override double Opacity => 1; #endregion diff --git a/Source/LibationAvalonia/Views/ProductsDisplay.axaml b/Source/LibationAvalonia/Views/ProductsDisplay.axaml index 8fda75af..a4a7fbae 100644 --- a/Source/LibationAvalonia/Views/ProductsDisplay.axaml +++ b/Source/LibationAvalonia/Views/ProductsDisplay.axaml @@ -15,9 +15,22 @@ GridLinesVisibility="All" AutoGenerateColumns="False" Items="{Binding GridEntries}" - CanUserSortColumns="True" + CanUserSortColumns="True" BorderThickness="3" CanUserReorderColumns="True"> + + + + + - @@ -52,7 +65,7 @@ - + @@ -60,10 +73,8 @@ - - - - + + @@ -72,10 +83,8 @@ - - - - + + @@ -84,10 +93,8 @@ - - - - + + @@ -96,10 +103,8 @@ - - - - + + @@ -108,10 +113,8 @@ - - - - + + @@ -120,10 +123,8 @@ - - - - + + @@ -132,10 +133,8 @@ - - - - + + @@ -144,10 +143,8 @@ - - - - + + @@ -156,10 +153,8 @@ - - - - + + @@ -168,10 +163,8 @@ - - - - + + @@ -180,10 +173,8 @@ - - - - + + @@ -192,14 +183,12 @@ - - - + diff --git a/Source/LibationAvalonia/Views/ProductsDisplay.axaml.cs b/Source/LibationAvalonia/Views/ProductsDisplay.axaml.cs index 3cac4a9e..ac57d42b 100644 --- a/Source/LibationAvalonia/Views/ProductsDisplay.axaml.cs +++ b/Source/LibationAvalonia/Views/ProductsDisplay.axaml.cs @@ -73,7 +73,7 @@ namespace LibationAvalonia.Views #region Cell Context Menu - public void ProductsGrid_CellContextMenuStripNeeded(object sender, DataGridViewCellContextMenuStripNeededEventArgs args) + public void ProductsGrid_CellContextMenuStripNeeded(object sender, DataGridCellContextMenuStripNeededEventArgs args) { if (args.Column.SortMemberPath == "Liberate") { @@ -277,9 +277,9 @@ namespace LibationAvalonia.Views public void Description_Click(object sender, Avalonia.Input.TappedEventArgs args) { - if (sender is TextBlock tblock && tblock.DataContext is GridEntry gEntry) + if (sender is Control tblock && tblock.DataContext is GridEntry gEntry) { - var pt = tblock.Parent.PointToScreen(tblock.Parent.Bounds.TopRight); + var pt = tblock.PointToScreen(tblock.Bounds.TopRight); var displayWindow = new DescriptionDisplayDialog { SpawnLocation = new Point(pt.X, pt.Y),