pwvucontrol icon indicating copy to clipboard operation
pwvucontrol copied to clipboard

Zero height box shadow in page with empty list.

Open pjungkamp opened this issue 5 months ago • 0 comments

Description

If a the list of entries in a page (e.g. Playback) is empty, a strange shadow-like box is shown where the list would be.

Solution?

This could be fixed by making e.g. the playbacklist invisible if the selection model is empty. Connect to items_changed on the gtk::SelectionModel of e.g. playbacklist and if the list is empty set the list's visible property to false.

  • Get the SelectionModel for a ListView: https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/struct.ListView.html#method.model
  • The connect_items_changed function: https://gtk-rs.org/gtk-rs-core/stable/0.20/docs/gio/prelude/trait.ListModelExt.html#method.connect_items_changed
  • The set_visible function on a widget: https://gtk-rs.org/gtk4-rs/stable/latest/docs/gtk4/prelude/trait.WidgetExt.html#method.set_visible

Screenshots

image

Installation

NixOS unstable
pwvucontrol 0.4.5

pjungkamp avatar Sep 16 '24 14:09 pjungkamp