mirror of
https://github.com/Ardour/ardour.git
synced 2025-12-10 00:34:59 +01:00
git-svn-id: svn://localhost/ardour2/branches/3.0@8412 d708f5d6-7413-0410-9779-e7cbd77b26cf
38 lines
891 B
C++
38 lines
891 B
C++
#include <iostream>
|
|
#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);
|
|
}
|
|
}
|