feat: add group by, theme-specific placement and matching section titles
- Add a per-collection Group by option to the collection page, saved with the collection. Games with several values appear in each group, and games with no value go in a "Not set" group at the end. - Turn off manual reordering while a grouping is active. - Add an optional theme-specific placement for Stardust, Nova X, Helium and Harmony, off by default. - Copy the Collections title and separator from the neighbouring section in the game details view so they match the theme. - Add top margin to the Collections page so Create Collection no longer overlaps the window controls. - Bump the version to 1.2.0 and update the docs, changelog and manifest.
This commit is contained in:
1 parent
690a79b014
commit
b9a6bf891d
20 files changed
+680
-59
No files matched your search
+21
-2
@@ -125,14 +125,22 @@ The order is simply the order of `GameCollection.GameIds`, which is also what th
|
||||
`CollectionManager.MoveGames(collectionId, gameIds, anchorId, after)` is the single move operation. Selected games keep
|
||||
their relative order.
|
||||
|
||||
On the page, `CollectionDetailsViewModel.CanReorder` requires the *Collection order, ascending* sort, because a moved
|
||||
game wouldn't stay put in any other. Moves relate to *visible* games, so with a filter active, "move earlier" passes the
|
||||
On the page, `CollectionDetailsViewModel.CanReorder` requires the *Collection order, ascending* sort with no grouping,
|
||||
because a moved game wouldn't stay put otherwise. Moves relate to *visible* games, so with a filter active, "move earlier" passes the
|
||||
previous visible game.
|
||||
|
||||
Dragging is in `CollectionDetailsView.xaml.cs`. A click on an already selected game in a multi-selection delays
|
||||
collapsing the selection until the mouse button is released, otherwise several games couldn't be dragged.
|
||||
`FindDropTarget` picks the closest tile on the pointer's row and which side of it to use.
|
||||
|
||||
## Grouping
|
||||
|
||||
`GameCollection.GroupBy` holds the choice, set through `CollectionManager.SetGroupBy`. It has a safe default, so old
|
||||
files need no migration. `GameGroupDescription` returns a list of names for a multi-value field, which makes WPF put
|
||||
the same tile in several groups. That's why `RequestVisibleCovers` reads tiles from the visual tree: with groups,
|
||||
`ContainerFromItem` doesn't reach them. To add a grouping, add it to the end of `GameGroupField`, then to
|
||||
`GroupNameFromItem` and `GroupOptions`.
|
||||
|
||||
## Dynamic collections
|
||||
|
||||
A collection is dynamic when `Rules` is not null. `GameIds` stores the latest matches, so no page has to search the
|
||||
@@ -215,6 +223,17 @@ The integration's safeguards:
|
||||
`ListBoxItem`s, which hold most of the tree. A 1 second timer only compares `ActiveDesktopView`.
|
||||
- Every error is caught and logged, and stops further searching until the next trigger.
|
||||
|
||||
Behind the `UseThemeSpecificPlacement` setting (off by default), and only when `ApplicationSettings.DesktopTheme` is in
|
||||
`ThemesUsingGameRelationsSection`, it instead goes next to the element whose `Visibility` binding names
|
||||
`GameRelationsVisibilityProxy`, in that element's form: a new `TabItem` beside a tab, a new row in a `Grid`, a copy of a
|
||||
`Border`'s style, or a plain sibling in a panel. It only needs that element's parent to be visible, so it works without
|
||||
Game Relations installed. This is a temporary workaround that depends on these themes' XAML. The injected control stays
|
||||
subscribed to events because a control in an unselected tab never loads.
|
||||
|
||||
The section title is copied from the theme, not defined here: `FindTitle` and `FindSeparator` look in the neighbouring
|
||||
section (the anchor or Game Relations section), and `CloneTitle` copies its current style values. A section that's an
|
||||
`Expander` gets an `Expander` of its own with the title in its header.
|
||||
|
||||
**This relies on Playnite's internal part names.** Check it after Playnite updates. The default layouts are
|
||||
`Themes/Desktop/Default/Views/DetailsViewGameOverview.xaml` and `GridViewGameOverview.xaml` in Playnite's repository.
|
||||
|
||||
|
||||
Reference in new issue
Block a user