Add playlist tabs, a Now Playing column and close to tray, and restore the layout #3

Merged
GrumpyStraw merged 1 commit from playback-queue-tabs-tray into main 2026-10-10 23:32:24 +02:00
Owner

Playlist tabs

  • Each opened playlist gets a tab in the second column. Close it with its X or a middle click (src/qml/PlaylistTabs.qml).
  • Switching tabs keeps each playlist's scroll position. Remove songs turns off on every switch, as it does when a playlist opens.
  • A tab closes by itself when its playlist file is deleted, but not while the music folder cannot be read.

Sidebar and Now Playing

  • The library column can be hidden from its toolbar and shown again from the button before the next column's title. It comes back by itself when it would be the only column.
  • The new queue button in the player bar opens a Now Playing column with the songs in play order (src/queuemodel.cpp, src/qml/QueuePage.qml). After Shuffle this is the shuffled order, while the playlist file and its tab keep their own order. Double-click a song to jump to it.
  • Columns are 16 grid units wide, so all three fit the default window. This Kirigami version ignores per-column widths, so columns cannot be resized by dragging.

Layout restored on start

The window size, maximized state, open tabs, shown tab, sidebar, Now Playing and the column in view on a narrow window are saved in the layout and window groups of the settings file.

Close to the system tray

  • "Close to the system tray" in Settings hides the window instead of quitting, and the music keeps playing (src/tray.cpp). The tray icon shows or hides the window, and its menu has Play, Previous, Next and Quit.
  • The Flatpak may talk to org.kde.StatusNotifierWatcher. Qt 6.12 registers the icon under the app's unique bus name, so no --own-name is needed.
  • No minimize to tray: on Wayland the app only sees its window become unexposed, the same as when it is on another virtual desktop.

Wayland only

  • The app sets QT_QPA_PLATFORM=wayland unless the variable is already set, so it no longer falls back to X11.
  • The Flatpak drops --socket=fallback-x11 and --share=ipc.
  • Two lines that cleared a minimized state Qt never reports on Wayland are gone.

README

A "Why Strawly Music" section, plus the tabs, window layout, tray and permission changes. The queue and tray roadmap items are ticked.

Tested

  • ctest passes (2 of 2). The build and qmllint are clean.
  • In a nested KWin with a private D-Bus session:
    • tabs, hiding and showing the sidebar, Now Playing, and the sidebar coming back after the last tab closes
    • the layout restored after quitting with the window's close button, including a maximized window and a narrow one-column window
  • Close to tray under native Wayland, with a stand-in tray watcher on the test bus: closing hid the window, the app kept running, and the tray icon's Activate brought it back.
  • Without a Wayland display, the app exits with Qt's platform error instead of starting on X11.
  • The Flatpak was not rebuilt.

To check when reviewing

  • The tray icon and its menu in a real Plasma panel.
  • Kirigami prints a few warnings from its own toolbar code when the sidebar is hidden, and the desktop style's tab bar prints one when it is created. Both come from the libraries.
## Playlist tabs - Each opened playlist gets a tab in the second column. Close it with its X or a middle click (`src/qml/PlaylistTabs.qml`). - Switching tabs keeps each playlist's scroll position. Remove songs turns off on every switch, as it does when a playlist opens. - A tab closes by itself when its playlist file is deleted, but not while the music folder cannot be read. ## Sidebar and Now Playing - The library column can be hidden from its toolbar and shown again from the button before the next column's title. It comes back by itself when it would be the only column. - The new queue button in the player bar opens a Now Playing column with the songs in play order (`src/queuemodel.cpp`, `src/qml/QueuePage.qml`). After Shuffle this is the shuffled order, while the playlist file and its tab keep their own order. Double-click a song to jump to it. - Columns are 16 grid units wide, so all three fit the default window. This Kirigami version ignores per-column widths, so columns cannot be resized by dragging. ## Layout restored on start The window size, maximized state, open tabs, shown tab, sidebar, Now Playing and the column in view on a narrow window are saved in the `layout` and `window` groups of the settings file. ## Close to the system tray - "Close to the system tray" in Settings hides the window instead of quitting, and the music keeps playing (`src/tray.cpp`). The tray icon shows or hides the window, and its menu has Play, Previous, Next and Quit. - The Flatpak may talk to `org.kde.StatusNotifierWatcher`. Qt 6.12 registers the icon under the app's unique bus name, so no `--own-name` is needed. - No minimize to tray: on Wayland the app only sees its window become unexposed, the same as when it is on another virtual desktop. ## Wayland only - The app sets `QT_QPA_PLATFORM=wayland` unless the variable is already set, so it no longer falls back to X11. - The Flatpak drops `--socket=fallback-x11` and `--share=ipc`. - Two lines that cleared a minimized state Qt never reports on Wayland are gone. ## README A "Why Strawly Music" section, plus the tabs, window layout, tray and permission changes. The queue and tray roadmap items are ticked. ## Tested - `ctest` passes (2 of 2). The build and qmllint are clean. - In a nested KWin with a private D-Bus session: - tabs, hiding and showing the sidebar, Now Playing, and the sidebar coming back after the last tab closes - the layout restored after quitting with the window's close button, including a maximized window and a narrow one-column window - Close to tray under native Wayland, with a stand-in tray watcher on the test bus: closing hid the window, the app kept running, and the tray icon's Activate brought it back. - Without a Wayland display, the app exits with Qt's platform error instead of starting on X11. - The Flatpak was not rebuilt. ## To check when reviewing - The tray icon and its menu in a real Plasma panel. - Kirigami prints a few warnings from its own toolbar code when the sidebar is hidden, and the desktop style's tab bar prints one when it is created. Both come from the libraries.
- Each opened playlist gets a tab in the second column, with a close button and middle-click
  to close. Switching tabs keeps each playlist's scroll position.
- The library column is a sidebar that can be hidden. It comes back by itself when no other
  column is open.
- A Now Playing column, opened from the player bar, lists the songs in play order. After
  Shuffle this is the shuffled order, while the playlist keeps its own order.
- The window size, maximized state, open tabs, shown tab, sidebar, Now Playing and the column
  in view on a narrow window are saved and restored on the next start.
- "Close to the system tray" in Settings hides the window to a tray icon and keeps playing.
  The Flatpak may talk to org.kde.StatusNotifierWatcher for it. There is no minimize to tray,
  because a Wayland client cannot tell a minimized window from one on another virtual desktop.
- The app runs on Wayland only. It no longer falls back to X11, and the Flatpak drops the X11
  socket and the shared IPC namespace.
- The README explains why the app exists, and covers the layout and the tray.
GrumpyStraw deleted branch playback-queue-tabs-tray 2026-10-10 23:32:24 +02:00
Sign in to join this conversation.
No description provided.