-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.
-
- See comments in mixer_ui.cc about how this works.
- */
-
- float pos;
- XMLProperty* prop;
- XMLNode* geometry = ARDOUR_UI::instance()->editor_settings();
-
- enum Pane {
- Horizontal = 0x1,
- Vertical = 0x2
- };
-
- static Pane done;
-
- 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);
- } else {
- pos = atof (prop->value());
- }
-
- if (pos > 1.0f) {
- /* older versions of Ardour stored absolute position */
- if (alloc.get_width() > pos) {
- edit_pane.set_position (pos);
- done = (Pane) (done | Horizontal);
- }
- } else {
- if (alloc.get_width() > 1.0/pos) {
- paned_set_position_as_fraction (edit_pane, pos, false);
- 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);
- } else {
-
- pos = atof (prop->value());
- }
-
- if (pos > 1.0f) {
- /* older versions of Ardour stored absolute position */
- if (alloc.get_height() > pos) {
- editor_summary_pane.set_position (pos);
- done = (Pane) (done | Vertical);
- }
- } else {
- if (alloc.get_height() > 1.0/pos) {
- paned_set_position_as_fraction (editor_summary_pane, pos, true);
- done = (Pane) (done | Vertical);
- }
- }
- }
-}
-