From 26527ba608f0e2b7da29cdd8311adeeb09e61223 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Mon, 13 Jan 2025 22:45:34 +0100 Subject: [PATCH] Update Top-Level Layout * Right sidebar extends to the bottom * Add additional full height right-side box for monitor-section --- libs/widgets/tabbable.cc | 51 ++++++++------- libs/widgets/widgets/tabbable.h | 107 +++++++++++++++++--------------- 2 files changed, 83 insertions(+), 75 deletions(-) diff --git a/libs/widgets/tabbable.cc b/libs/widgets/tabbable.cc index c9b6660f45..2082332a84 100644 --- a/libs/widgets/tabbable.cc +++ b/libs/widgets/tabbable.cc @@ -112,43 +112,46 @@ Tabbable::default_layout () content_header_hbox.pack_start (content_attachments, false, false); content_header_hbox.pack_start (content_tabbables, false, false); - //wrap the header eboxen in a themeable frame - Gtk::Frame *toolbar_frame = manage(new Gtk::Frame); + /* wrap the header eboxes in a themeable frame */ + Gtk::Frame *toolbar_frame = manage (new Gtk::Frame); toolbar_frame->set_name ("TransportFrame"); toolbar_frame->set_shadow_type (Gtk::SHADOW_NONE); toolbar_frame->add (content_header_hbox); _content_vbox.pack_start (*toolbar_frame, false, false); - Widget* midlevel = 0 == (_panelayout & PaneBottom) ? (Widget*)&content_midlevel_vbox : (Widget*)&content_midlevel_vpane; - if (_panelayout & PaneLeft) { _content_vbox.pack_start (content_left_pane, true, true); content_left_pane.add (content_att_left); - content_left_pane.add (*midlevel); + content_left_pane.add (content_midlevel_vbox); } else { - _content_vbox.pack_start (content_hbox, true, true); - content_hbox.pack_start (content_att_left, false, false); - content_hbox.pack_start (*midlevel, true, true); + _content_vbox.pack_start (content_midlevel_vbox, true, true); + } + + if (_panelayout & PaneRight) { + content_midlevel_vbox.pack_start (content_right_pane, true, true); + content_right_pane.add (content_inner_hbox); + content_right_pane.add (content_right_vbox); + content_right_vbox.pack_start (content_att_right, true, true); + } else { + content_midlevel_vbox.pack_start (content_inner_hbox, true, true); } if (_panelayout & PaneBottom) { - content_midlevel_vpane.add (content_right_pane); - content_midlevel_vpane.add (content_att_bottom); + content_inner_hbox.pack_start (content_bottom_pane, true, true); + content_bottom_pane.add (content_main_vbox); + content_bottom_pane.add (content_att_bottom); } else { - content_midlevel_vbox.pack_start (content_right_pane, true, true); - content_midlevel_vbox.pack_start (content_att_bottom, false, false); + content_inner_hbox.pack_start (content_main_vbox, true, true); } - content_right_pane.add (content_inner_vbox); + content_inner_hbox.pack_start (content_bus_vbox, false, false); + content_bus_vbox.pack_start (content_bus, true, true); - if (_panelayout & PaneRight) { - content_right_pane.add (content_right_vbox); - content_right_vbox.pack_start (content_att_right, true, true); - } + content_main_vbox.pack_start (content_main_top, false, false); + content_main_vbox.pack_start (content_main, true, true); - content_inner_vbox.pack_start (content_main_top, false, false); - content_inner_vbox.pack_start (content_main, true, true); + /* set pane min. sizes */ if (_panelayout & PaneRight) { content_right_pane.set_child_minsize (content_att_right, 160); /* rough guess at width of notebook tabs */ @@ -163,10 +166,10 @@ Tabbable::default_layout () content_left_pane.set_divider (0, 0.15); if (_panelayout & PaneBottom) { - content_midlevel_vpane.set_child_minsize (content_right_pane, 300); + content_bottom_pane.set_child_minsize (content_right_pane, 300); } - content_midlevel_vpane.set_check_divider_position (true); - content_midlevel_vpane.set_divider (0, 0.85); + content_bottom_pane.set_check_divider_position (true); + content_bottom_pane.set_divider (0, 0.85); _content_vbox.show_all(); } @@ -467,7 +470,7 @@ Tabbable::get_state() const node.set_property (string_compose("%1%2", _menu_name, X_("-leftpane-pos")).c_str(), content_left_pane.get_divider ()); } if (_panelayout & PaneBottom) { - node.set_property (string_compose("%1%2", _menu_name, X_("-bottompane-pos")).c_str(), content_midlevel_vpane.get_divider ()); + node.set_property (string_compose("%1%2", _menu_name, X_("-bottompane-pos")).c_str(), content_bottom_pane.get_divider ()); } return node; @@ -502,7 +505,7 @@ Tabbable::set_state (const XMLNode& node, int version) } if ( window_node->get_property (string_compose("%1%2", _menu_name, X_("-bottompane-pos")).c_str(), fract) ) { fract = std::max (.05f, std::min (.95f, fract)); - content_midlevel_vpane.set_divider (0, fract); + content_bottom_pane.set_divider (0, fract); } } diff --git a/libs/widgets/widgets/tabbable.h b/libs/widgets/widgets/tabbable.h index 027c966a86..30d8f24d49 100644 --- a/libs/widgets/widgets/tabbable.h +++ b/libs/widgets/widgets/tabbable.h @@ -117,50 +117,53 @@ protected: * * The end result is to provide 7 event-boxes (marked with a $) where the tab can put its contents. * - * +--_content_vbox----------------------------------------------------------------------------------+ - * | | - * | /--toolbar_frame------------------------------------------------------------------------------\ | - * | | +--content_header_hbox--------------------------------------------------------------------+ | | - * | | | | | | - * | | | +--content_app_bar--------------------+ +--attachment_hbox--+ +--content_tabbables--+ | | | - * | | | $ (EBOX) | | (internal) | $ (EBOX) | | | | - * | | | | MAIN APPLICATION BAR | | (attachment btns) | | PAGE SWITCHER BTN | | | | - * | | | | | | | | | | | | - * | | | +-------------------------------------+ +-------------------+ +---------------------+ | | | - * | | | | | | - * | | +-----------------------------------------------------------------------------------------+ | | - * | \---------------------------------------------------------------------------------------------/ | - * | | - * | +--content_hbox--OR--content_left_pane--(EXPAND|FILL)-----------------------------------------+ | - * | | | | - * | | +--att_left--+ +--content_midlevel_vbox--OR-content_midlevel_vpane--(EXPAND|FILL)-------+ | | - * | | $ (EBOX) | | +--content_right_pane--(EXPAND|FILL)---------------------------------+ | | | - * | | | | | | +--content_inner_vbox-----------------+ +--content_right_vbox--+ | | | | - * | | | O | | | | | | | | | | | - * | | | P S | | | | +--content_main_top---------------+ | | +--att_right-------+ | | | | | - * | | | T I | | | | $ OPTIONAL TOOLBAR (EBOX) | | | $ (EBOX) | | | | | | - * | | | I D | | | | +---------------------------------+ |<->| | | | | | | | - * | | | O E |<->| | | | P | | OPTIONAL | | | | | | - * | | | N B | O | | | +--content_main--(EXPAND|FILL)----+ | A | | SIDEBAR | | | | | | - * | | | A A | P | | | $ (EBOX) | | N | | | | | | | | - * | | | L R | T | | | | | | E | | | | | | | | - * | | | | . | | | | !! MAIN PAGE CONTENT !! | |<->| | (LIST) | | | | | | - * | | | | P | | | | | | | | | | | | | | - * | | | | A | | | | | | | | | | | | | | - * | | | | N | | | +---------------------------------+ | | +------------------+ | | | | | - * | | | (STRIP) | E | | +-------------------------------------+ +----------------------+ | | | | - * | | | |<->| +--------------------------------------------------------------------+ | | | - * | | | | | 🡅 OPTIONAL 🡅 | | | - * | | | | | 🡇 PANE 🡇 | | | - * | | | | | +-content_att_bottom-------------------------------------------------+ | | | - * | | | | | $ (EBOX) | | | | - * | | | | | | OPTIONAL BOTTOM (PROPERTIES) | | | | - * | | | | | | | | | | - * | | | | | +--------------------------------------------------------------------+ | | | - * | | +------------+ +------------------------------------------------------------------------+ | | - * | +---------------------------------------------------------------------------------------------+ | - * | | - * +-------------------------------------------------------------------------------------------------+ + * +--_content_vbox---------------------------------------------------------------------------------------------------------------+ + * | | + * | /--toolbar_frame-----------------------------------------------------------------------------------------------------------\ | + * | | +--content_header_hbox-------------------------------------------------------------------------------------------------+ | | + * | | | | | | + * | | | +--content_app_bar-------------------------------------------------+ +--attachment_hbox--+ +--content_tabbables--+ | | | + * | | | $ (EBOX) | | (internal) | $ (EBOX) | | | | + * | | | | MAIN APPLICATION BAR | | (attachment btns) | | PAGE SWITCHER BTN | | | | + * | | | | | | | | | | | | + * | | | +------------------------------------------------------------------+ +-------------------+ +---------------------+ | | | + * | | | | | | + * | | +----------------------------------------------------------------------------------------------------------------------+ | | + * | \--------------------------------------------------------------------------------------------------------------------------/ | + * | | + * | +--content_left_pane-(OPTIONAL)--------------------------------------------------------------------------------------------+ | + * | | | | + * | | +--att_left--+ +--content_midlevel_vbox------------------------------------------------------------------------------+ | | + * | | $ (EBOX) | | +--content_right_pane--(EXPAND|FILL)--------------------------------------------------------------+ | | | + * | | | | | | +--content_inner_hbox----------------------------------------------+ +--content_right_vbox--+ | | | | + * | | | O | | | | +--content_bottom_pane (OPT)------------+ +--content_bus_vbox-+ | | | | | | | + * | | | P S | | | | | +--content_main_vbox----------------+ | $ | | | +--att_right-------+ | | | | | + * | | | T I | | | | | | | | | +--content_bus--+ | | | $ (EBOX) | | | | | | + * | | | I D | | | | | | +--content_main_top-------------+ | | | | (EBOX) | | | | | | | | | | | + * | | | O E |<->| | | | | $ OPTIONAL TOOLBAR (EBOX) | | | | | M | | | | | OPTIONAL | | | | | | + * | | | N B | O | | | | | +-------------------------------+ | | | | O | | | | | | | | | | | + * | | | A A | P | | | | | | | | | N | | |<->| | | | | | | | + * | | | L R | T | | | | | +--content_main-----------------+ | | | | I | | | P | | | | | | | | + * | | | | . | | | | | $ (EBOX) | | | | | T | | | A | | (LIST) | | | | | | + * | | | | P | | | | | | !! MAIN PAGE CONTENT !! | | | | | O | | | N | | | | | | | | + * | | | | A | | | | | | | | | | R | | | E | | | | | | | | + * | | | | N | | | | | +-------------------------------+ | | | | | | |<->| | | | | | | | + * | | | (STRIP) | E | | | | | | | | | S | | | | | | | | | | | + * | | | |<->| | | | +-----------------------------------+ | | | E | | | | | | | | | | | + * | | | | | | | | 🡅 OPTIONAL 🡅 | | | C | | | | | | | | | | | + * | | | | | | | | 🡇 PANE 🡇 | | | T | | | | | | | | | | | + * | | | | | | | | +-content_att_bottom----------------+ | | | I | | | | | | | | | | | + * | | | | | | | | $ (EBOX) | | | | O | | | | | | | | | | | + * | | | | | | | | | OPTIONAL BOTTOM (PROPERTIES) | | | | N | | | | | | | | | | | + * | | | | | | | | | | | | | | | | | | | | | | | | + * | | | | | | | | +-----------------------------------+ | | +---------------+ | | | | | | | | | | + * | | | | | | | +---------------------------------------+ +-------------------+ | | +------------------+ | | | | | + * | | | | | | +------------------------------------------------------------------+ +----------------------+ | | | | + * | | | | | +-------------------------------------------------------------------------------------------------+ | | | + * | | +------------+ +-----------------------------------------------------------------------------------------------------+ | | + * | +--------------------------------------------------------------------------------------------------------------------------+ | + * | | + * +------------------------------------------------------------------------------------------------------------------------------+ * */ @@ -173,17 +176,19 @@ protected: Gtk::HBox content_attachment_hbox; EventBoxExt content_tabbables; /* a placeholder for the tabbable switching buttons (used by ArdourUI) */ HPane content_left_pane; - Gtk::HBox content_hbox; EventBoxExt content_att_left; /* a placeholder for the mixer strip, if you want one */ - VPane content_midlevel_vpane; Gtk::VBox content_midlevel_vbox; HPane content_right_pane; - Gtk::VBox content_inner_vbox; - EventBoxExt content_main_top; /* a placeholder for the content-specific toolbar, if you want one */ - EventBoxExt content_main; /* a placeholder for the innermost content (recorder, cues, editor, mixer) */ + Gtk::HBox content_inner_hbox; + VPane content_bottom_pane; /* optional, replaced by content_main_vbox when no bottom att is present */ + Gtk::VBox content_main_vbox; + EventBoxExt content_main_top; /* a placeholder for the content-specific toolbar, if you want one */ + EventBoxExt content_main; /* a placeholder for the innermost content (recorder, cues, editor, mixer) */ + EventBoxExt content_att_bottom; /* a placeholder for the property box, if you want one */ + Gtk::VBox content_bus_vbox; + EventBoxExt content_bus; /* a placeholder for the monitor section */ Gtk::VBox content_right_vbox; - EventBoxExt content_att_right; /* a placeholder for the sidebar list, if you want one */ - EventBoxExt content_att_bottom; /* a placeholder for the property box, if you want one */ + EventBoxExt content_att_right; /* a placeholder for the sidebar list, if you want one */ /* clang-format on */ /* visibility controls */