diff --git a/gtk2_ardour/editor.cc b/gtk2_ardour/editor.cc index 8c49af3cf4..740e0cca35 100644 --- a/gtk2_ardour/editor.cc +++ b/gtk2_ardour/editor.cc @@ -265,6 +265,7 @@ Editor::Editor () , automation_mode_button (_("mode")) , global_automation_button (_("automation")) + , _toolbar_viewport (*manage (new Gtk::Adjustment (0, 0, 1e10)), *manage (new Gtk::Adjustment (0, 0, 1e10))) , midi_panic_button (_("Panic")) #ifdef WITH_CMT @@ -2860,11 +2861,13 @@ Editor::setup_toolbar () toolbar_base.set_name ("ToolBarBase"); toolbar_base.add (toolbar_hbox); - _toolbar_trimmer.add (toolbar_base); + _toolbar_viewport.add (toolbar_base); + /* stick to the required height but allow width to vary if there's not enough room */ + _toolbar_viewport.set_size_request (1, -1); toolbar_frame.set_shadow_type (SHADOW_OUT); toolbar_frame.set_name ("BaseFrame"); - toolbar_frame.add (_toolbar_trimmer); + toolbar_frame.add (_toolbar_viewport); DPIReset.connect (sigc::mem_fun (*this, &Editor::resize_text_widgets)); } diff --git a/gtk2_ardour/editor.h b/gtk2_ardour/editor.h index fb2361048b..8c4b132ec6 100644 --- a/gtk2_ardour/editor.h +++ b/gtk2_ardour/editor.h @@ -42,7 +42,6 @@ #include "gtkmm2ext/selector.h" #include "gtkmm2ext/click_box.h" #include "gtkmm2ext/dndtreeview.h" -#include "gtkmm2ext/trimming_bin.h" #include "pbd/stateful.h" #include "pbd/signals.h" @@ -1589,7 +1588,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD Gtk::HBox toolbar_hbox; Gtk::EventBox toolbar_base; Gtk::Frame toolbar_frame; - Gtkmm2ext::TrimmingBin _toolbar_trimmer; + Gtk::Viewport _toolbar_viewport; /* midi toolbar */ diff --git a/libs/gtkmm2ext/gtkmm2ext/trimming_bin.h b/libs/gtkmm2ext/gtkmm2ext/trimming_bin.h deleted file mode 100644 index 4566d71cba..0000000000 --- a/libs/gtkmm2ext/gtkmm2ext/trimming_bin.h +++ /dev/null @@ -1,24 +0,0 @@ -#include - -namespace Gtkmm2ext { - -/** A somewhat specialised adaption of Gtk::ScrolledWindow which is the same, - * except that the scrollbars are never visible. It is useful for long toolbars - * which may not fit horizontally on smaller screens; it lets them extend off the - * right-hand side of the screen without causing the parent window to jump around. - * - * It is not the same as a Gtk::ScrolledWindow with policies to never display - * scrollbars, as these do not behave as we require in this case. - * - * It is hard-wired to perform as if it were a Gtk::ScrolledWindow with a - * vertical scrollbar policy of POLICY_NEVER and a horizontal policy of - * POLICY_AUTOMATIC. This could be generalised. - */ -class TrimmingBin : public Gtk::ScrolledWindow -{ -public: - void on_size_request (Gtk::Requisition *); - void on_size_allocate (Gtk::Allocation &); -}; - -} diff --git a/libs/gtkmm2ext/trimming_bin.cc b/libs/gtkmm2ext/trimming_bin.cc deleted file mode 100644 index 0aba116870..0000000000 --- a/libs/gtkmm2ext/trimming_bin.cc +++ /dev/null @@ -1,38 +0,0 @@ -#include -#include "gtkmm2ext/trimming_bin.h" - -using namespace std; -using namespace Gtkmm2ext; - -void -TrimmingBin::on_size_request (Gtk::Requisition* r) -{ - Gtk::ScrolledWindow::on_size_request (r); - - /* Munge the height request so that it is that of the child; - the Gtk::ScrolledWindow's request may include space for - a horizontal scrollbar, which we will never show. - */ - - Gtk::Widget* c = get_child (); - if (c && c->is_visible ()) { - Gtk::Requisition cr; - c->size_request (cr); - r->height = cr.height; - } -} - -void -TrimmingBin::on_size_allocate (Gtk::Allocation& a) -{ - /* We replace Gtk::ScrolledWindow's on_size_allocate with this - which accepts what we are given and forces the child to use - the same allocation (which may result in it being shrunk). - */ - - set_allocation (a); - Widget* c = get_child (); - if (c && c->is_visible ()) { - c->size_allocate (a); - } -} diff --git a/libs/gtkmm2ext/wscript b/libs/gtkmm2ext/wscript index 40896ac3ad..0425b66149 100644 --- a/libs/gtkmm2ext/wscript +++ b/libs/gtkmm2ext/wscript @@ -51,7 +51,6 @@ gtkmm2ext_sources = [ 'tearoff.cc', 'textviewer.cc', 'treeutils.cc', - 'trimming_bin.cc', 'utils.cc', 'version.cc', 'window_title.cc'