Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

option to hide library nav sidebar when it isn't in use #14393

Open
mxmilkiib opened this issue Feb 22, 2025 · 7 comments
Open

option to hide library nav sidebar when it isn't in use #14393

mxmilkiib opened this issue Feb 22, 2025 · 7 comments
Labels

Comments

@mxmilkiib
Copy link
Contributor

mxmilkiib commented Feb 22, 2025

Feature Description

access/show the sidebar with the same control or keyboard hotkey switch action as usual, just display it away when the user finishes navigation

Image

edit: can this be done in a skin?

@acolombier
Copy link
Member

This should already possible with a skin only change. Here is a patch for the Deere skin

diff --git a/res/skins/Deere/library.xml b/res/skins/Deere/library.xml
index 1f08cc1134..50f5459b84 100644
--- a/res/skins/Deere/library.xml
+++ b/res/skins/Deere/library.xml
@@ -28,6 +28,10 @@
             <Children>
               <WidgetGroup>
                 <Layout>vertical</Layout>
+                <Connection>
+                  <ConfigKey>[Skin],show_library_navbar</ConfigKey>
+                  <BindProperty>visible</BindProperty>
+                </Connection>
                 <Children>
                   <Template src="skin:preview_deck.xml"/>
                   <WidgetGroup>
diff --git a/res/skins/Deere/skin_settings.xml b/res/skins/Deere/skin_settings.xml
index ab9dceaab7..cbd5383c97 100644
--- a/res/skins/Deere/skin_settings.xml
+++ b/res/skins/Deere/skin_settings.xml
@@ -275,6 +275,12 @@
             <SetVariable name="skinsetting">[Skin],show_preview_decks</SetVariable>
           </Template>
 
+          <Template src="skins:Deere/skinsettings_button.xml">
+            <SetVariable name="TooltipId">show_library_navbar</SetVariable>
+            <SetVariable name="text">Library Navbar</SetVariable>
+            <SetVariable name="skinsetting">[Skin],show_library_navbar</SetVariable>
+          </Template>
+
           <Template src="skins:Deere/skinsettings_button.xml">
             <SetVariable name="TooltipId">show_coverart</SetVariable>
             <SetVariable name="text">Cover Art</SetVariable>

You should be able to bind [Skin],show_library_navbar to the keyboard or controller button you want to show or hide the navbar

@mxmilkiib
Copy link
Contributor Author

I'm meaning like, when turned on in the prefs, one would only see the track list in the lower half, then you'd hit tab and the sidebar appears/unminimises and is made the active view thing.

@acolombier
Copy link
Member

Yep, this snippet should do it. You only need to bind tab to the CO above

@mxmilkiib
Copy link
Contributor Author

Ah, I realise I'm getting;

warning [Main] Skin parsing failed at skins:Deere/skinsettings_button.xml:12 <PushButton>: Invalid <TooltipId> in skin.xml: show_library_navbar | ./src/skin/legacy/legacyskinparser.cpp:2357
info [Main] Creating skin control object: "[Skin],show_library_navbar"

@acolombier
Copy link
Member

Yeah, that a limitation, as tooltips are hardcoded in C++. This warning message can be safely ignored.

@mxmilkiib
Copy link
Contributor Author

mxmilkiib commented Feb 24, 2025

hmm, unless I'm mistaken, I think I've done the changes right, but I'm not seeing that here

@ronso0
Copy link
Member

ronso0 commented Feb 24, 2025

I think @mxmilkiib is looking for auto-hide the sidebar when the tracks table gets focus?
If yes, the proposed xml patch will work but I suspect that binding that CO to Tab key will not work as expected:

  • Tab'ing to Tracks will hide the sidebar (incl. Search)
  • hit Tab again will focus the Search + treeview
  • hit Tab for going to the treeview will hide the sidebar
    = treeview focused but hidden (will it automatically move focus to Tracks?)

I think a complete, usable treeview hide function (hack) can be implemented either in c++ (probably in LibraryControl::slotFocusedWidgetChanged or LibraryControl::updateFocusedWidgetControls
or with a script callback for [Library],focused_widget (set [Skin],show_library_navbar 1 when Tracks get focus, set 0 when Search or treeview get focus (again: only if that's possible while it's not visible)).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants