From f858132a25292dce24d722eda7f9e7de50a93c1a Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Wed, 5 Oct 2022 10:46:50 -0600 Subject: [PATCH] more appropriate sizeing and scrolling for library downloader Without this it just grows to be tall enough to show all downloaded descriptions --- gtk2_ardour/library_download_dialog.cc | 12 ++++++++++-- gtk2_ardour/library_download_dialog.h | 2 ++ 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/gtk2_ardour/library_download_dialog.cc b/gtk2_ardour/library_download_dialog.cc index ac71f9de0d..f32b90d981 100644 --- a/gtk2_ardour/library_download_dialog.cc +++ b/gtk2_ardour/library_download_dialog.cc @@ -42,6 +42,11 @@ LibraryDownloadDialog::LibraryDownloadDialog () : ArdourDialog (_("Loop Download Manager"), true) /* modal */ , inflater(0) { + /* pick some vaguely reasonable window size so that we do not just + * grow to show all available rows in the listview + */ + set_size_request (-1, 600); + _model = Gtk::ListStore::create (_columns); _display.set_model (_model); @@ -58,10 +63,13 @@ LibraryDownloadDialog::LibraryDownloadDialog () _display.signal_button_press_event().connect (sigc::mem_fun (*this, &LibraryDownloadDialog::display_button_press), false); + scroller.set_policy (Gtk::POLICY_NEVER, Gtk::POLICY_AUTOMATIC); + scroller.add (_display); + Gtk::HBox* h = new Gtk::HBox; h->set_spacing (8); h->set_border_width (8); - h->pack_start (_display); + h->pack_start (scroller); get_vbox()->set_spacing (8); get_vbox()->set_border_width (12); @@ -72,7 +80,7 @@ LibraryDownloadDialog::LibraryDownloadDialog () description_view.set_size_request (-1, 80); description_view.set_wrap_mode (Gtk::WRAP_WORD); - get_vbox()->pack_start (description_view); + get_vbox()->pack_start (description_view, Gtk::PACK_SHRINK); } diff --git a/gtk2_ardour/library_download_dialog.h b/gtk2_ardour/library_download_dialog.h index 0b27eefe3e..afe7444b2b 100644 --- a/gtk2_ardour/library_download_dialog.h +++ b/gtk2_ardour/library_download_dialog.h @@ -25,6 +25,7 @@ #include #include #include +#include #include #include @@ -82,6 +83,7 @@ class LibraryDownloadDialog : public ArdourDialog }; Gtk::TreeView _display; + Gtk::ScrolledWindow scroller; Glib::RefPtr _model; LibraryColumns _columns;