feat(slint): search box for the favorites Labels tab
Add an ExpandableSearch to the Labels toolbar (mirrors tracks/albums), wired to labels-search + the new derive_labels controller fn, which forks a name-filtered clone of the loaded labels and shares the full model when the query is empty (artwork stays live). apply_favorites now derives the visible set on load. cc
This commit is contained in:
4 files changed
+52
-2
No files matched your search
@@ -614,6 +614,21 @@ export component FavoritesView inherits Rectangle {
|
||||
ViewToggle { }
|
||||
}
|
||||
}
|
||||
if FavoritesState.active-tab == "labels"
|
||||
&& FavoritesState.labels.length > 0: HorizontalLayout {
|
||||
spacing: 8px;
|
||||
VerticalLayout {
|
||||
alignment: center;
|
||||
ExpandableSearch {
|
||||
placeholder: @tr("Search");
|
||||
sm: true;
|
||||
query <=> FavoritesState.labels-search;
|
||||
edited(q) => {
|
||||
FavoritesActions.search-labels(q);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle { height: 14px; }
|
||||
|
||||
@@ -1489,6 +1489,7 @@ export global FavoritesState {
|
||||
in property <[FavoritePlaylistItem]> playlists: [];
|
||||
in property <[FavoriteLabelItem]> labels: [];
|
||||
in property <[FavoriteLabelItem]> labels-visible: []; // after search filter (rendered)
|
||||
in-out property <string> labels-search: "";
|
||||
in property <int> tracks-total: 0;
|
||||
in property <int> albums-total: 0;
|
||||
in property <int> artists-total: 0;
|
||||
@@ -1516,6 +1517,7 @@ export global FavoritesActions {
|
||||
callback bulk-action(string /* select-all | remove-selected | clear */);
|
||||
callback album-action(string /* album id */, string /* action */);
|
||||
callback albums-search(string /* query */);
|
||||
callback search-labels(string /* query */);
|
||||
callback albums-set-view(string /* grid | list */);
|
||||
callback albums-set-sort(string /* sort key */);
|
||||
callback albums-set-group(string /* off | alpha | artist */);
|
||||
|
||||
Reference in new issue
Block a user