13
0

more appropriate sizeing and scrolling for library downloader

Without this it just grows to be tall enough to show all downloaded descriptions
This commit is contained in:
Paul Davis 2022-10-05 10:46:50 -06:00
parent 908bcf3150
commit f858132a25
2 changed files with 12 additions and 2 deletions

View File

@ -42,6 +42,11 @@ LibraryDownloadDialog::LibraryDownloadDialog ()
: ArdourDialog (_("Loop Download Manager"), true) /* modal */ : ArdourDialog (_("Loop Download Manager"), true) /* modal */
, inflater(0) , 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); _model = Gtk::ListStore::create (_columns);
_display.set_model (_model); _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); _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; Gtk::HBox* h = new Gtk::HBox;
h->set_spacing (8); h->set_spacing (8);
h->set_border_width (8); h->set_border_width (8);
h->pack_start (_display); h->pack_start (scroller);
get_vbox()->set_spacing (8); get_vbox()->set_spacing (8);
get_vbox()->set_border_width (12); get_vbox()->set_border_width (12);
@ -72,7 +80,7 @@ LibraryDownloadDialog::LibraryDownloadDialog ()
description_view.set_size_request (-1, 80); description_view.set_size_request (-1, 80);
description_view.set_wrap_mode (Gtk::WRAP_WORD); description_view.set_wrap_mode (Gtk::WRAP_WORD);
get_vbox()->pack_start (description_view); get_vbox()->pack_start (description_view, Gtk::PACK_SHRINK);
} }

View File

@ -25,6 +25,7 @@
#include <gtkmm/cellrenderertext.h> #include <gtkmm/cellrenderertext.h>
#include <gtkmm/entry.h> #include <gtkmm/entry.h>
#include <gtkmm/liststore.h> #include <gtkmm/liststore.h>
#include <gtkmm/scrolledwindow.h>
#include <gtkmm/treeview.h> #include <gtkmm/treeview.h>
#include <gtkmm/textview.h> #include <gtkmm/textview.h>
@ -82,6 +83,7 @@ class LibraryDownloadDialog : public ArdourDialog
}; };
Gtk::TreeView _display; Gtk::TreeView _display;
Gtk::ScrolledWindow scroller;
Glib::RefPtr<Gtk::ListStore> _model; Glib::RefPtr<Gtk::ListStore> _model;
LibraryColumns _columns; LibraryColumns _columns;