diff --git a/crates/qbz-i18n/translations/de/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/de/LC_MESSAGES/qbz-ui.po index 0d0f4a39a..841d2cb01 100644 --- a/crates/qbz-i18n/translations/de/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/de/LC_MESSAGES/qbz-ui.po @@ -6251,3 +6251,9 @@ msgstr "Mixerregler ändern" msgid "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." msgstr "Qobuz Connect konnte nicht sicher beendet werden. Beenden und öffnen Sie QBZ erneut und versuchen Sie dann noch einmal, sich abzumelden." + +msgid "Show filter panels" +msgstr "Filterbereiche anzeigen" + +msgid "Hide filter panels" +msgstr "Filterbereiche ausblenden" diff --git a/crates/qbz-i18n/translations/en/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/en/LC_MESSAGES/qbz-ui.po index d1126c532..f7fefdba6 100644 --- a/crates/qbz-i18n/translations/en/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/en/LC_MESSAGES/qbz-ui.po @@ -1871,3 +1871,9 @@ msgstr "Change mixer control" msgid "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." msgstr "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." + +msgid "Show filter panels" +msgstr "Show filter panels" + +msgid "Hide filter panels" +msgstr "Hide filter panels" diff --git a/crates/qbz-i18n/translations/es/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/es/LC_MESSAGES/qbz-ui.po index cfd540efe..df49dd9ee 100644 --- a/crates/qbz-i18n/translations/es/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/es/LC_MESSAGES/qbz-ui.po @@ -6257,3 +6257,9 @@ msgstr "Cambiar control de mezclador" msgid "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." msgstr "Qobuz Connect no pudo cerrarse de forma segura. Cierra y vuelve a abrir QBZ, y luego intenta cerrar sesión de nuevo." + +msgid "Show filter panels" +msgstr "Mostrar los paneles de filtros" + +msgid "Hide filter panels" +msgstr "Ocultar los paneles de filtros" diff --git a/crates/qbz-i18n/translations/fr/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/fr/LC_MESSAGES/qbz-ui.po index 43e0b8460..ed71d73d5 100644 --- a/crates/qbz-i18n/translations/fr/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/fr/LC_MESSAGES/qbz-ui.po @@ -6249,3 +6249,9 @@ msgstr "Changer la commande de mixage" msgid "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." msgstr "Qobuz Connect n’a pas pu s’arrêter en toute sécurité. Quittez et rouvrez QBZ, puis réessayez de vous déconnecter." + +msgid "Show filter panels" +msgstr "Afficher les panneaux de filtres" + +msgid "Hide filter panels" +msgstr "Masquer les panneaux de filtres" diff --git a/crates/qbz-i18n/translations/ja/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/ja/LC_MESSAGES/qbz-ui.po index 195373eb6..dd4a8c1bf 100644 --- a/crates/qbz-i18n/translations/ja/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/ja/LC_MESSAGES/qbz-ui.po @@ -6233,3 +6233,9 @@ msgstr "ミキサーコントロールを変更" msgid "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." msgstr "Qobuz Connect を安全に終了できませんでした。QBZ を終了して再度開き、もう一度ログアウトしてください。" + +msgid "Show filter panels" +msgstr "フィルターパネルを表示" + +msgid "Hide filter panels" +msgstr "フィルターパネルを非表示" diff --git a/crates/qbz-i18n/translations/nl/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/nl/LC_MESSAGES/qbz-ui.po index 67ac61e47..2579b2563 100644 --- a/crates/qbz-i18n/translations/nl/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/nl/LC_MESSAGES/qbz-ui.po @@ -6239,3 +6239,9 @@ msgstr "Mixerregelaar wijzigen" msgid "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." msgstr "Qobuz Connect kon niet veilig worden afgesloten. Sluit QBZ af, open het opnieuw en probeer daarna nogmaals uit te loggen." + +msgid "Show filter panels" +msgstr "Filterpanelen tonen" + +msgid "Hide filter panels" +msgstr "Filterpanelen verbergen" diff --git a/crates/qbz-i18n/translations/pt/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/pt/LC_MESSAGES/qbz-ui.po index 5ea6be8b5..ebf1dde2c 100644 --- a/crates/qbz-i18n/translations/pt/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/pt/LC_MESSAGES/qbz-ui.po @@ -6249,3 +6249,9 @@ msgstr "Alterar controlo do misturador" msgid "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." msgstr "Não foi possível encerrar o Qobuz Connect com segurança. Feche e reabra o QBZ e tente terminar sessão novamente." + +msgid "Show filter panels" +msgstr "Mostrar os painéis de filtros" + +msgid "Hide filter panels" +msgstr "Ocultar os painéis de filtros" diff --git a/crates/qbz-i18n/translations/ru/LC_MESSAGES/qbz-ui.po b/crates/qbz-i18n/translations/ru/LC_MESSAGES/qbz-ui.po index 42b033491..c40b34774 100644 --- a/crates/qbz-i18n/translations/ru/LC_MESSAGES/qbz-ui.po +++ b/crates/qbz-i18n/translations/ru/LC_MESSAGES/qbz-ui.po @@ -6269,3 +6269,9 @@ msgstr "Изменить регулятор микшера" msgid "Qobuz Connect could not shut down safely. Quit and reopen QBZ, then try logging out again." msgstr "Не удалось безопасно завершить работу Qobuz Connect. Закройте и снова откройте QBZ, затем повторите выход из учётной записи." + +msgid "Show filter panels" +msgstr "Показать панели фильтров" + +msgid "Hide filter panels" +msgstr "Скрыть панели фильтров" diff --git a/crates/qbz-qt/qml/views/local/LocalGenresTab.qml b/crates/qbz-qt/qml/views/local/LocalGenresTab.qml index 3cda1c7c5..e4ef280ca 100644 --- a/crates/qbz-qt/qml/views/local/LocalGenresTab.qml +++ b/crates/qbz-qt/qml/views/local/LocalGenresTab.qml @@ -157,6 +157,12 @@ Item { root.view.clearFilter() } readonly property var activeFilterChips: buildActiveFilterChips() + // The collapsed strip keeps one line of the applied filters visible, so + // hiding the panels never hides WHAT is currently filtering the results. + readonly property bool collapsedChipsActive: + (root.view ? root.view.genresBrowserCollapsed : false) + && activeFilterChips.length > 0 + readonly property int chipRowThickness: 36 function caretName() { var collapsed = root.view && root.view.genresBrowserCollapsed if (filterPosition === "bottom") return collapsed ? "chevron-up" : "chevron-down" @@ -182,6 +188,48 @@ Item { onToggled: function(key, modifiers) { root.toggleFacet(facetIndex, key, modifiers) } } + // One removable applied-filter chip — shared between the collapsed strip + // and the "no albums match" empty state. + component ActiveFilterChip: Rectangle { + id: chip + required property var modelData + width: chipContent.implicitWidth + 18 + height: 28 + radius: 6 + color: chipMouse.containsMouse + ? theme.surfaceHover + : (theme.ambientOn ? theme.surfaceElevatedA50 + : theme.surfaceElevated) + border.width: 1 + border.color: theme.ambientOn ? theme.frostBorder : theme.borderSubtle + + Row { + id: chipContent + anchors.centerIn: parent + spacing: 7 + Text { + text: chip.modelData.label + color: theme.textPrimary + font.pixelSize: theme.fontLegal + elide: Text.ElideRight + } + QbzIcon { + name: "x" + width: 11 + height: 11 + anchors.verticalCenter: parent.verticalCenter + tintName: chipMouse.containsMouse ? "textPrimary" : "muted" + } + } + MouseArea { + id: chipMouse + anchors.fill: parent + hoverEnabled: true + cursorShape: Qt.PointingHandCursor + onClicked: root.clearFilterChip(chip.modelData) + } + } + Component { id: horizontalBrowser Row { @@ -230,7 +278,11 @@ Item { : Math.max(0, root.width - 64) height: root.verticalFilters ? Math.max(0, root.height - 20) - : (collapsed ? root.collapsedThickness : root.horizontalHeight) + : (collapsed + ? (root.collapsedChipsActive + ? root.collapsedThickness + root.chipRowThickness + : root.collapsedThickness) + : root.horizontalHeight) Loader { visible: !browser.collapsed @@ -274,9 +326,64 @@ Item { anchors.fill: parent hoverEnabled: true cursorShape: Qt.PointingHandCursor - onClicked: root.view.genresBrowserCollapsed = !root.view.genresBrowserCollapsed + onContainsMouseChanged: tips.hover( + containsMouse, parent, "explorer-collapse", + browser.collapsed + ? QbzSession.tr("Show filter panels", QbzSession.trRev) + : QbzSession.tr("Hide filter panels", QbzSession.trRev)) + onClicked: { + // The label flips with the state; a bubble captured before + // the click would keep lying until the pointer re-enters. + tips.hide("explorer-collapse") + root.view.genresBrowserCollapsed = !root.view.genresBrowserCollapsed + } } } + + // Applied filters, one line, while the panels are hidden. Each chip + // removes its filter immediately; overflow stays on this line and + // wheel-scrolls, it never wraps into the reclaimed space. + Item { + visible: !root.verticalFilters && root.collapsedChipsActive + x: 0 + y: root.filterPosition === "bottom" ? parent.height - 28 : 0 + width: parent.width + height: 28 + + ListView { + anchors.horizontalCenter: parent.horizontalCenter + width: Math.min(contentWidth, parent.width) + height: parent.height + orientation: ListView.Horizontal + spacing: 8 + clip: true + boundsBehavior: Flickable.StopAtBounds + model: root.activeFilterChips + delegate: ActiveFilterChip { } + } + } + } + + // The vertical rail is 24px wide — no room for a readable line there, so + // left/right layouts put the same strip across the top of the results. + Item { + visible: root.verticalFilters && root.collapsedChipsActive + x: results.x + y: 10 + width: results.width + height: 28 + + ListView { + anchors.horizontalCenter: parent.horizontalCenter + width: Math.min(contentWidth, parent.width) + height: parent.height + orientation: ListView.Horizontal + spacing: 8 + clip: true + boundsBehavior: Flickable.StopAtBounds + model: root.activeFilterChips + delegate: ActiveFilterChip { } + } } Item { @@ -288,14 +395,16 @@ Item { x: root.verticalFilters && root.filterPosition === "left" ? browser.x + browser.width + 8 : 32 y: !root.verticalFilters && root.filterPosition === "top" - ? browser.y + browser.height + 8 : 10 + ? browser.y + browser.height + 8 + : (root.verticalFilters && root.collapsedChipsActive + ? 10 + root.chipRowThickness : 10) width: root.verticalFilters ? (root.filterPosition === "left" ? Math.max(0, root.width - x - 32) : Math.max(0, browser.x - x - 8)) : Math.max(0, root.width - 64) height: root.verticalFilters - ? Math.max(0, root.height - 20) + ? Math.max(0, root.height - y - 10) : (root.filterPosition === "bottom" ? Math.max(0, browser.y - y - 8) : Math.max(0, root.height - y - 10)) @@ -342,44 +451,7 @@ Item { Repeater { model: root.activeFilterChips - delegate: Rectangle { - required property var modelData - width: chipRow.implicitWidth + 18 - height: 28 - radius: 6 - color: chipArea.containsMouse - ? theme.surfaceHover - : (theme.ambientOn ? theme.surfaceElevatedA50 - : theme.surfaceElevated) - border.width: 1 - border.color: theme.ambientOn ? theme.frostBorder : theme.borderSubtle - - Row { - id: chipRow - anchors.centerIn: parent - spacing: 7 - Text { - text: parent.parent.modelData.label - color: theme.textPrimary - font.pixelSize: theme.fontLegal - elide: Text.ElideRight - } - QbzIcon { - name: "x" - width: 11 - height: 11 - anchors.verticalCenter: parent.verticalCenter - tintName: chipArea.containsMouse ? "textPrimary" : "muted" - } - } - MouseArea { - id: chipArea - anchors.fill: parent - hoverEnabled: true - cursorShape: Qt.PointingHandCursor - onClicked: root.clearFilterChip(parent.modelData) - } - } + delegate: ActiveFilterChip { } } } @@ -429,4 +501,13 @@ Item { albums: root.view.genreAlbumsVisible } } + + // Hover tooltip for the collapse caret. The overlay takes no pointer and + // owns no animator, so an idle one costs nothing (LocalChrome.qml does the + // same for the header's controls; this tab body is outside its bounds). + QbzTooltip { + id: tips + anchors.fill: parent + z: 900 + } }