-void
-Editor::pane_allocation_handler (Allocation &alloc, Paned* which)
-{
- /* recover or initialize pane positions. do this here rather than earlier because
- we don't want the positions to change the child allocations, which they seem to do.
- */
-
- int pos;
- XMLProperty const * prop;
- char buf[32];
- XMLNode* node = ARDOUR_UI::instance()->editor_settings();
-
- enum Pane {
- Horizontal = 0x1,
- Vertical = 0x2
- };
-
- static Pane done;
-
- XMLNode* geometry = find_named_node (*node, "geometry");
-
- if (which == static_cast<Paned*> (&edit_pane)) {
-
- if (done & Horizontal) {
- return;
- }
-
- if (geometry && (prop = geometry->property ("notebook-shrunk"))) {
- _notebook_shrunk = string_is_affirmative (prop->value ());
- }
-
- if (!geometry || (prop = geometry->property ("edit-horizontal-pane-pos")) == 0) {
- /* initial allocation is 90% to canvas, 10% to notebook */
- pos = (int) floor (alloc.get_width() * 0.90f);
- snprintf (buf, sizeof(buf), "%d", pos);
- } else {
- pos = atoi (prop->value());
- }
-
- if (GTK_WIDGET(edit_pane.gobj())->allocation.width > pos) {
- edit_pane.set_position (pos);
- }
-
- done = (Pane) (done | Horizontal);
-
- } else if (which == static_cast<Paned*> (&editor_summary_pane)) {
-
- if (done & Vertical) {
- return;
- }
-
- if (!geometry || (prop = geometry->property ("edit-vertical-pane-pos")) == 0) {
- /* initial allocation is 90% to canvas, 10% to summary */
- pos = (int) floor (alloc.get_height() * 0.90f);
- snprintf (buf, sizeof(buf), "%d", pos);
- } else {
-
- pos = atoi (prop->value());
- }
-
- if (GTK_WIDGET(editor_summary_pane.gobj())->allocation.height > pos) {
- editor_summary_pane.set_position (pos);
- }
-
- done = (Pane) (done | Vertical);
- }
-}
-