Somewhat experimental fix to try to stop the editor window jumping around on small screens.
git-svn-id: svn://localhost/ardour2/branches/3.0@8412 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
parent
6ea84edab2
commit
cf45b07f73
|
@ -612,7 +612,7 @@ Editor::Editor ()
|
||||||
Glib::PropertyProxy<int> proxy = edit_pane.property_position();
|
Glib::PropertyProxy<int> proxy = edit_pane.property_position();
|
||||||
proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&edit_pane)));
|
proxy.signal_changed().connect (bind (sigc::ptr_fun (pane_size_watcher), static_cast<Paned*> (&edit_pane)));
|
||||||
#endif
|
#endif
|
||||||
top_hbox.pack_start (toolbar_frame, false, true);
|
top_hbox.pack_start (toolbar_frame);
|
||||||
|
|
||||||
HBox *hbox = manage (new HBox);
|
HBox *hbox = manage (new HBox);
|
||||||
hbox->pack_start (edit_pane, true, true);
|
hbox->pack_start (edit_pane, true, true);
|
||||||
|
@ -2862,9 +2862,11 @@ Editor::setup_toolbar ()
|
||||||
toolbar_base.set_name ("ToolBarBase");
|
toolbar_base.set_name ("ToolBarBase");
|
||||||
toolbar_base.add (toolbar_hbox);
|
toolbar_base.add (toolbar_hbox);
|
||||||
|
|
||||||
|
_toolbar_trimmer.add (toolbar_base);
|
||||||
|
|
||||||
toolbar_frame.set_shadow_type (SHADOW_OUT);
|
toolbar_frame.set_shadow_type (SHADOW_OUT);
|
||||||
toolbar_frame.set_name ("BaseFrame");
|
toolbar_frame.set_name ("BaseFrame");
|
||||||
toolbar_frame.add (toolbar_base);
|
toolbar_frame.add (_toolbar_trimmer);
|
||||||
|
|
||||||
DPIReset.connect (sigc::mem_fun (*this, &Editor::resize_text_widgets));
|
DPIReset.connect (sigc::mem_fun (*this, &Editor::resize_text_widgets));
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,9 +39,10 @@
|
||||||
#include <gtkmm/comboboxtext.h>
|
#include <gtkmm/comboboxtext.h>
|
||||||
#include <gtkmm/layout.h>
|
#include <gtkmm/layout.h>
|
||||||
|
|
||||||
#include <gtkmm2ext/selector.h>
|
#include "gtkmm2ext/selector.h"
|
||||||
#include <gtkmm2ext/click_box.h>
|
#include "gtkmm2ext/click_box.h"
|
||||||
#include <gtkmm2ext/dndtreeview.h>
|
#include "gtkmm2ext/dndtreeview.h"
|
||||||
|
#include "gtkmm2ext/trimming_bin.h"
|
||||||
|
|
||||||
#include "pbd/stateful.h"
|
#include "pbd/stateful.h"
|
||||||
#include "pbd/signals.h"
|
#include "pbd/signals.h"
|
||||||
|
@ -1588,6 +1589,7 @@ class Editor : public PublicEditor, public PBD::ScopedConnectionList, public ARD
|
||||||
Gtk::HBox toolbar_hbox;
|
Gtk::HBox toolbar_hbox;
|
||||||
Gtk::EventBox toolbar_base;
|
Gtk::EventBox toolbar_base;
|
||||||
Gtk::Frame toolbar_frame;
|
Gtk::Frame toolbar_frame;
|
||||||
|
Gtkmm2ext::TrimmingBin _toolbar_trimmer;
|
||||||
|
|
||||||
/* midi toolbar */
|
/* midi toolbar */
|
||||||
|
|
||||||
|
|
24
libs/gtkmm2ext/gtkmm2ext/trimming_bin.h
Normal file
24
libs/gtkmm2ext/gtkmm2ext/trimming_bin.h
Normal file
|
@ -0,0 +1,24 @@
|
||||||
|
#include <gtkmm/scrolledwindow.h>
|
||||||
|
|
||||||
|
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 &);
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
38
libs/gtkmm2ext/trimming_bin.cc
Normal file
38
libs/gtkmm2ext/trimming_bin.cc
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
#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);
|
||||||
|
}
|
||||||
|
}
|
|
@ -51,6 +51,7 @@ gtkmm2ext_sources = [
|
||||||
'tearoff.cc',
|
'tearoff.cc',
|
||||||
'textviewer.cc',
|
'textviewer.cc',
|
||||||
'treeutils.cc',
|
'treeutils.cc',
|
||||||
|
'trimming_bin.cc',
|
||||||
'utils.cc',
|
'utils.cc',
|
||||||
'version.cc',
|
'version.cc',
|
||||||
'window_title.cc'
|
'window_title.cc'
|
||||||
|
|
Loading…
Reference in New Issue
Block a user