13
0

Pack Pages using Tabbable constructs

This commit is contained in:
Ben Loftis 2024-10-17 15:48:58 -05:00 committed by Robin Gareus
parent 948b49d72d
commit 4b1e09f810
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
12 changed files with 90 additions and 102 deletions

View File

@ -229,7 +229,7 @@ static const gchar *_rb_opt_strings[] = {
#endif #endif
Editor::Editor () Editor::Editor ()
: PublicEditor (global_hpacker) : PublicEditor ()
, editor_mixer_strip_width (Wide) , editor_mixer_strip_width (Wide)
, constructed (false) , constructed (false)
, _properties_box (0) , _properties_box (0)
@ -660,23 +660,13 @@ Editor::Editor ()
_summary_hbox.pack_start (*summary_arrows_right, false, false); _summary_hbox.pack_start (*summary_arrows_right, false, false);
editor_summary_pane.add (_summary_hbox); editor_summary_pane.add (_summary_hbox);
edit_pane.set_check_divider_position (true);
edit_pane.add (editor_summary_pane);
_editor_list_vbox.pack_start (_the_notebook); _editor_list_vbox.pack_start (_the_notebook);
_editor_list_vbox.pack_start (*_properties_box, false, false, 0); _editor_list_vbox.pack_start (*_properties_box, false, false, 0);
edit_pane.add (_editor_list_vbox);
edit_pane.set_child_minsize (_editor_list_vbox, 30); /* rough guess at width of notebook tabs */
edit_pane.set_drag_cursor (*_cursors->expand_left_right); content_right_pane.set_drag_cursor (*_cursors->expand_left_right);
editor_summary_pane.set_drag_cursor (*_cursors->expand_up_down); editor_summary_pane.set_drag_cursor (*_cursors->expand_up_down);
float fract; float fract;
if (!settings || !settings->get_property ("edit-horizontal-pane-pos", fract) || fract > 1.0) {
/* initial allocation is 90% to canvas, 10% to notebook */
fract = 0.90;
}
edit_pane.set_divider (0, fract);
if (!settings || !settings->get_property ("edit-vertical-pane-pos", fract) || fract > 1.0) { if (!settings || !settings->get_property ("edit-vertical-pane-pos", fract) || fract > 1.0) {
/* initial allocation is 90% to canvas, 10% to summary */ /* initial allocation is 90% to canvas, 10% to summary */
fract = 0.90; fract = 0.90;
@ -686,20 +676,6 @@ Editor::Editor ()
global_vpacker.set_spacing (0); global_vpacker.set_spacing (0);
global_vpacker.set_border_width (0); global_vpacker.set_border_width (0);
/* the next three EventBoxes provide the ability for their child widgets to have a background color. That is all. */
Gtk::EventBox* ebox = manage (new Gtk::EventBox); // a themeable box
ebox->set_name("EditorWindow");
ebox->add (ebox_hpacker);
Gtk::EventBox* epane_box = manage (new EventBoxExt); // a themeable box
epane_box->set_name("EditorWindow");
epane_box->add (edit_pane);
Gtk::EventBox* epane_box2 = manage (new EventBoxExt); // a themeable box
epane_box2->set_name("EditorWindow");
epane_box2->add (global_vpacker);
ArdourWidgets::ArdourDropShadow *toolbar_shadow = manage (new (ArdourWidgets::ArdourDropShadow)); ArdourWidgets::ArdourDropShadow *toolbar_shadow = manage (new (ArdourWidgets::ArdourDropShadow));
toolbar_shadow->set_size_request (-1, 4); toolbar_shadow->set_size_request (-1, 4);
toolbar_shadow->set_mode(ArdourWidgets::ArdourDropShadow::DropShadowBoth); toolbar_shadow->set_mode(ArdourWidgets::ArdourDropShadow::DropShadowBoth);
@ -707,16 +683,21 @@ Editor::Editor ()
toolbar_shadow->show(); toolbar_shadow->show();
global_vpacker.pack_start (*toolbar_shadow, false, false); global_vpacker.pack_start (*toolbar_shadow, false, false);
global_vpacker.pack_start (*ebox, false, false); global_vpacker.pack_start (editor_summary_pane, true, true);
global_vpacker.pack_start (*epane_box, true, true);
global_hpacker.pack_start (*epane_box2, true, true); /* pack all the main pieces into appropriate containers from _tabbable
*/
content_app_bar.add (_application_bar);
content_att_right.add (_editor_list_vbox);
content_toolbar.add (ebox_hpacker);
content_innermost_hbox.add (global_vpacker);
/* need to show the "contents" widget so that notebook will show if tab is switched to /* need to show the "contents" widget so that notebook will show if tab is switched to
*/ */
global_hpacker.show (); content_hbox.show ();
ebox_hpacker.show(); ebox_hpacker.show();
ebox->show(); global_vpacker.show();
/* register actions now so that set_state() can find them and set toggles/checks etc */ /* register actions now so that set_state() can find them and set toggles/checks etc */
@ -2329,7 +2310,6 @@ Editor::get_state () const
node->add_child_nocopy (Tabbable::get_state()); node->add_child_nocopy (Tabbable::get_state());
node->set_property("edit-horizontal-pane-pos", edit_pane.get_divider ());
node->set_property("notebook-shrunk", _notebook_shrunk); node->set_property("notebook-shrunk", _notebook_shrunk);
node->set_property("edit-vertical-pane-pos", editor_summary_pane.get_divider()); node->set_property("edit-vertical-pane-pos", editor_summary_pane.get_divider());
@ -5511,7 +5491,7 @@ Editor::session_going_away ()
if (current_mixer_strip) { if (current_mixer_strip) {
if (current_mixer_strip->get_parent() != 0) { if (current_mixer_strip->get_parent() != 0) {
global_hpacker.remove (*current_mixer_strip); content_att_left.remove ();
} }
delete current_mixer_strip; delete current_mixer_strip;
current_mixer_strip = 0; current_mixer_strip = 0;
@ -5660,16 +5640,16 @@ Editor::notebook_tab_clicked (GdkEventButton* ev, Gtk::Widget* page)
if (_notebook_shrunk) { if (_notebook_shrunk) {
if (pre_notebook_shrink_pane_width) { if (pre_notebook_shrink_pane_width) {
edit_pane.set_divider (0, *pre_notebook_shrink_pane_width); content_right_pane.set_divider (0, *pre_notebook_shrink_pane_width);
} }
_notebook_shrunk = false; _notebook_shrunk = false;
} else { } else {
pre_notebook_shrink_pane_width = edit_pane.get_divider(); pre_notebook_shrink_pane_width = content_right_pane.get_divider();
/* this expands the LHS of the edit pane to cover the notebook /* this expands the LHS of the edit pane to cover the notebook
PAGE but leaves the tabs visible. PAGE but leaves the tabs visible.
*/ */
edit_pane.set_divider (0, edit_pane.get_divider() + page->get_width()); content_right_pane.set_divider (0, content_right_pane.get_divider() + page->get_width());
_notebook_shrunk = true; _notebook_shrunk = true;
} }
} }
@ -5709,7 +5689,7 @@ Editor::ui_parameter_changed (string parameter)
} }
_cursors->set_cursor_set (UIConfiguration::instance().get_icon_set()); _cursors->set_cursor_set (UIConfiguration::instance().get_icon_set());
_cursor_stack.push_back(_cursors->grabber); _cursor_stack.push_back(_cursors->grabber);
edit_pane.set_drag_cursor (*_cursors->expand_left_right); content_right_pane.set_drag_cursor (*PublicEditor::instance().cursors()->expand_left_right);
editor_summary_pane.set_drag_cursor (*_cursors->expand_up_down); editor_summary_pane.set_drag_cursor (*_cursors->expand_up_down);
} else if (parameter == "sensitize-playhead") { } else if (parameter == "sensitize-playhead") {

View File

@ -589,7 +589,6 @@ private:
void add_notebook_page (std::string const&, Gtk::Widget&); void add_notebook_page (std::string const&, Gtk::Widget&);
bool notebook_tab_clicked (GdkEventButton*, Gtk::Widget*); bool notebook_tab_clicked (GdkEventButton*, Gtk::Widget*);
ArdourWidgets::HPane edit_pane;
ArdourWidgets::VPane editor_summary_pane; ArdourWidgets::VPane editor_summary_pane;
Gtk::EventBox meter_base; Gtk::EventBox meter_base;
@ -766,7 +765,6 @@ private:
void timeaxisview_deleted (TimeAxisView*); void timeaxisview_deleted (TimeAxisView*);
void add_vcas (ARDOUR::VCAList&); void add_vcas (ARDOUR::VCAList&);
Gtk::HBox global_hpacker;
Gtk::VBox global_vpacker; Gtk::VBox global_vpacker;
Gdk::Cursor* which_track_cursor () const; Gdk::Cursor* which_track_cursor () const;

View File

@ -754,7 +754,7 @@ void
Editor::load_bindings () Editor::load_bindings ()
{ {
bindings = Bindings::get_bindings (editor_name()); bindings = Bindings::get_bindings (editor_name());
global_hpacker.set_data ("ardour-bindings", bindings); contents().set_data ("ardour-bindings", bindings);
/* This set of bindings may expand in the future to include things /* This set of bindings may expand in the future to include things
* other than MIDI editing, but for now this is all we've got as far as * other than MIDI editing, but for now this is all we've got as far as

View File

@ -151,8 +151,8 @@ Editor::show_editor_mixer (bool yn)
} }
if (current_mixer_strip && current_mixer_strip->get_parent() == 0) { if (current_mixer_strip && current_mixer_strip->get_parent() == 0) {
global_hpacker.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK ); content_hbox.pack_start (*current_mixer_strip, Gtk::PACK_SHRINK );
global_hpacker.reorder_child (*current_mixer_strip, 0); content_hbox.reorder_child (*current_mixer_strip, 0);
current_mixer_strip->show (); current_mixer_strip->show ();
} }
@ -165,7 +165,7 @@ Editor::show_editor_mixer (bool yn)
if (current_mixer_strip) { if (current_mixer_strip) {
if (current_mixer_strip->get_parent() != 0) { if (current_mixer_strip->get_parent() != 0) {
global_hpacker.remove (*current_mixer_strip); content_hbox.remove (*current_mixer_strip);
} }
} }
} }

View File

@ -55,6 +55,7 @@
#include "ardour/monitor_control.h" #include "ardour/monitor_control.h"
#include "ardour/panner_shell.h" #include "ardour/panner_shell.h"
#include "ardour/plugin_manager.h" #include "ardour/plugin_manager.h"
#include "ardour/profile.h"
#include "ardour/route_group.h" #include "ardour/route_group.h"
#include "ardour/selection.h" #include "ardour/selection.h"
#include "ardour/session.h" #include "ardour/session.h"
@ -132,7 +133,7 @@ Mixer_UI::instance ()
} }
Mixer_UI::Mixer_UI () Mixer_UI::Mixer_UI ()
: Tabbable (_("Mixer"), X_("mixer"), &_content) : Tabbable (_("Mixer"), X_("mixer"))
, plugin_search_clear_button (X_("Clear")) , plugin_search_clear_button (X_("Clear"))
, _mixer_scene_release (0) , _mixer_scene_release (0)
, no_track_list_redisplay (false) , no_track_list_redisplay (false)
@ -161,7 +162,7 @@ Mixer_UI::Mixer_UI ()
Glib::RefPtr<ToggleAction> fb_act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip"); Glib::RefPtr<ToggleAction> fb_act = ActionManager::get_toggle_action ("Mixer", "ToggleFoldbackStrip");
fb_act->set_sensitive (false); fb_act->set_sensitive (false);
_content.set_data ("ardour-bindings", bindings); contents().set_data ("ardour-bindings", bindings);
PresentationInfo::Change.connect (*this, invalidator (*this), std::bind (&Mixer_UI::presentation_info_changed, this, _1), gui_context()); PresentationInfo::Change.connect (*this, invalidator (*this), std::bind (&Mixer_UI::presentation_info_changed, this, _1), gui_context());
Route::FanOut.connect (*this, invalidator (*this), std::bind (&Mixer_UI::fan_out, this, _1, false, true), gui_context()); Route::FanOut.connect (*this, invalidator (*this), std::bind (&Mixer_UI::fan_out, this, _1, false, true), gui_context());
@ -375,27 +376,26 @@ Mixer_UI::Mixer_UI ()
global_hpacker.pack_start (inner_pane, true, true); global_hpacker.pack_start (inner_pane, true, true);
global_hpacker.pack_start (out_packer, false, false); global_hpacker.pack_start (out_packer, false, false);
list_hpane.set_check_divider_position (true);
list_hpane.add (list_vpacker);
list_hpane.add (global_hpacker);
list_hpane.set_child_minsize (list_vpacker, 30);
rhs_pane1.set_divider (0, .6); rhs_pane1.set_divider (0, .6);
rhs_pane2.set_divider (0, .7); rhs_pane2.set_divider (0, .7);
list_hpane.set_divider (0, .2);
inner_pane.set_divider (0, .8); inner_pane.set_divider (0, .8);
rhs_pane1.set_drag_cursor (*PublicEditor::instance().cursors()->expand_up_down); rhs_pane1.set_drag_cursor (*PublicEditor::instance().cursors()->expand_up_down);
rhs_pane2.set_drag_cursor (*PublicEditor::instance().cursors()->expand_up_down); rhs_pane2.set_drag_cursor (*PublicEditor::instance().cursors()->expand_up_down);
list_hpane.set_drag_cursor (*PublicEditor::instance().cursors()->expand_left_right);
inner_pane.set_drag_cursor (*PublicEditor::instance().cursors()->expand_left_right); inner_pane.set_drag_cursor (*PublicEditor::instance().cursors()->expand_left_right);
_content.pack_start (list_hpane, true, true); content_app_bar.add (_application_bar);
content_innermost_hbox.add (global_hpacker);
if (!Profile->get_mixbus ()) {
content_att_left.add (list_vpacker);
} else {
content_att_right.add (list_vpacker);
}
update_title (); update_title ();
_content.show (); contents().set_name ("MixerWindow");
_content.set_name ("MixerWindow");
global_hpacker.show(); global_hpacker.show();
scroller.show(); scroller.show();
@ -420,7 +420,6 @@ Mixer_UI::Mixer_UI ()
vca_label.show(); vca_label.show();
vca_scroller_base.show(); vca_scroller_base.show();
out_packer.show(); out_packer.show();
list_hpane.show();
group_display.show(); group_display.show();
favorite_plugins_display.show(); favorite_plugins_display.show();
@ -1483,7 +1482,7 @@ Mixer_UI::stop_updating ()
void void
Mixer_UI::fast_update_strips () Mixer_UI::fast_update_strips ()
{ {
if (!UIConfiguration::instance().get_no_strobe() && _content.get_mapped () && _session) { if (!UIConfiguration::instance().get_no_strobe() && contents().get_mapped () && _session) {
for (auto & s : strips) { for (auto & s : strips) {
s->fast_update (); s->fast_update ();
} }
@ -2648,11 +2647,6 @@ Mixer_UI::set_state (const XMLNode& node, int version)
} }
rhs_pane2.set_divider (0, fract); rhs_pane2.set_divider (0, fract);
if (!node.get_property ("mixer-list-hpane-pos", fract) || fract > 1.0) {
fract = 0.2f;
}
list_hpane.set_divider (0, fract);
if (!node.get_property ("mixer-inner-pane-pos", fract) || fract > 1.0) { if (!node.get_property ("mixer-inner-pane-pos", fract) || fract > 1.0) {
fract = 0.8f; fract = 0.8f;
} }
@ -2699,7 +2693,6 @@ Mixer_UI::get_state () const
node->set_property (X_("mixer-rhs-pane1-pos"), rhs_pane1.get_divider()); node->set_property (X_("mixer-rhs-pane1-pos"), rhs_pane1.get_divider());
node->set_property (X_("mixer-rhs_pane2-pos"), rhs_pane2.get_divider()); node->set_property (X_("mixer-rhs_pane2-pos"), rhs_pane2.get_divider());
node->set_property (X_("mixer-list-hpane-pos"), list_hpane.get_divider());
node->set_property (X_("mixer-inner-pane-pos"), inner_pane.get_divider()); node->set_property (X_("mixer-inner-pane-pos"), inner_pane.get_divider());
node->set_property ("narrow-strips", (_strip_width == Narrow)); node->set_property ("narrow-strips", (_strip_width == Narrow));
@ -3024,7 +3017,7 @@ Mixer_UI::strip_by_x (int x)
for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) { for (list<MixerStrip*>::iterator i = strips.begin(); i != strips.end(); ++i) {
int x1, x2, y; int x1, x2, y;
(*i)->translate_coordinates (_content, 0, 0, x1, y); (*i)->translate_coordinates (contents(), 0, 0, x1, y);
x2 = x1 + (*i)->get_width(); x2 = x1 + (*i)->get_width();
if (x >= x1 && x <= x2) { if (x >= x1 && x <= x2) {

View File

@ -177,7 +177,7 @@ protected:
private: private:
Mixer_UI (); Mixer_UI ();
static Mixer_UI* _instance; static Mixer_UI* _instance;
Gtk::VBox _content;
Gtk::HBox global_hpacker; Gtk::HBox global_hpacker;
Gtk::VBox global_vpacker; Gtk::VBox global_vpacker;
Gtk::ScrolledWindow scroller; Gtk::ScrolledWindow scroller;
@ -210,7 +210,6 @@ private:
Gtk::Label vca_label; Gtk::Label vca_label;
Gtk::EventBox vca_scroller_base; Gtk::EventBox vca_scroller_base;
Gtk::HBox out_packer; Gtk::HBox out_packer;
ArdourWidgets::HPane list_hpane;
Gtk::EventBox _mixer_scene_spacer; Gtk::EventBox _mixer_scene_spacer;
Gtk::Frame _mixer_scene_frame; Gtk::Frame _mixer_scene_frame;

View File

@ -31,9 +31,9 @@ const int PublicEditor::horizontal_spacing = 6;
ARDOUR::DataType PublicEditor::pbdid_dragged_dt = ARDOUR::DataType::NIL; ARDOUR::DataType PublicEditor::pbdid_dragged_dt = ARDOUR::DataType::NIL;
PublicEditor::PublicEditor (Gtk::Widget& content) PublicEditor::PublicEditor ()
: EditingContext (X_("Editor")) : EditingContext (X_("Editor"))
, Tabbable (_("Editor"), X_("editor"), &content) , Tabbable (_("Editor"), X_("editor"))
{ {
_suspend_route_redisplay_counter.store (0); _suspend_route_redisplay_counter.store (0);
} }

View File

@ -126,7 +126,7 @@ using ARDOUR::samplecnt_t;
class PublicEditor : public EditingContext, public ArdourWidgets::Tabbable class PublicEditor : public EditingContext, public ArdourWidgets::Tabbable
{ {
public: public:
PublicEditor (Gtk::Widget& content); PublicEditor ();
virtual ~PublicEditor (); virtual ~PublicEditor ();
/** @return Singleton PublicEditor instance */ /** @return Singleton PublicEditor instance */

View File

@ -78,7 +78,7 @@ using namespace Menu_Helpers;
#define PX_SCALE(px) std::max ((float)px, rintf ((float)px* UIConfiguration::instance ().get_ui_scale ())) #define PX_SCALE(px) std::max ((float)px, rintf ((float)px* UIConfiguration::instance ().get_ui_scale ()))
RecorderUI::RecorderUI () RecorderUI::RecorderUI ()
: Tabbable (_("Recorder"), X_("recorder"), &_content) : Tabbable (_("Recorder"), X_("recorder"))
, _toolbar_sep (1.0) , _toolbar_sep (1.0)
, _btn_rec_all (_("All")) , _btn_rec_all (_("All"))
, _btn_rec_none (_("None")) , _btn_rec_none (_("None"))
@ -193,9 +193,10 @@ RecorderUI::RecorderUI ()
_pane.add (_meter_scroller); _pane.add (_meter_scroller);
/* Top-level VBox */ /* Top-level VBox */
_content.pack_start (_toolbar_sep, false, false, 1); content_app_bar.add (_application_bar);
_content.pack_start (_toolbar, false, false, 2); //content_att_right.add (_editor_list_vbox); // TODO
_content.pack_start (_pane, true, true); content_toolbar.add(_toolbar);
content_innermost_hbox.add (_pane);
/* button_table setup is similar to transport_table in ardour_ui */ /* button_table setup is similar to transport_table in ardour_ui */
int vpadding = 1; int vpadding = 1;
@ -280,10 +281,9 @@ RecorderUI::RecorderUI ()
_meter_area.show (); _meter_area.show ();
_meter_scroller.show (); _meter_scroller.show ();
_pane.show (); _pane.show ();
_content.show ();
/* setup keybidings */ /* setup keybidings */
_content.set_data ("ardour-bindings", bindings); contents().set_data ("ardour-bindings", bindings);
/* subscribe to signals */ /* subscribe to signals */
AudioEngine::instance ()->Running.connect (_engine_connections, invalidator (*this), std::bind (&RecorderUI::start_updating, this), gui_context ()); AudioEngine::instance ()->Running.connect (_engine_connections, invalidator (*this), std::bind (&RecorderUI::start_updating, this), gui_context ());

View File

@ -126,7 +126,6 @@ private:
static int calc_columns (int child_width, int parent_width); static int calc_columns (int child_width, int parent_width);
Gtkmm2ext::Bindings* bindings; Gtkmm2ext::Bindings* bindings;
Gtk::VBox _content;
Gtk::HBox _toolbar; Gtk::HBox _toolbar;
Gtk::Table _button_table; Gtk::Table _button_table;
ArdourWidgets::VPane _pane; ArdourWidgets::VPane _pane;

View File

@ -66,11 +66,12 @@ using namespace Gtk;
using namespace std; using namespace std;
TriggerPage::TriggerPage () TriggerPage::TriggerPage ()
: Tabbable (_("Cues"), X_("trigger"), &_content) : Tabbable (_("Cues"), X_("trigger"))
, _cue_area_frame (0.5, 0, 1.0, 0) , _cue_area_frame (0.5, 0, 1.0, 0)
, _cue_box (16, 16 * TriggerBox::default_triggers_per_box) , _cue_box (16, 16 * TriggerBox::default_triggers_per_box)
, _master_widget (16, 16) , _master_widget (16, 16)
, _master (_master_widget.root ()) , _master (_master_widget.root ())
, _show_bottom_pane (false)
, _selection (*this, *this) , _selection (*this, *this)
{ {
load_bindings (); load_bindings ();
@ -126,16 +127,11 @@ TriggerPage::TriggerPage ()
_sidebar_notebook.popup_disable (); _sidebar_notebook.popup_disable ();
_sidebar_notebook.set_tab_pos (Gtk::POS_RIGHT); _sidebar_notebook.set_tab_pos (Gtk::POS_RIGHT);
_sidebar_vbox.pack_start (_sidebar_notebook);
add_sidebar_page (_("Clips"), _trigger_clip_picker); add_sidebar_page (_("Clips"), _trigger_clip_picker);
add_sidebar_page (_("Tracks"), _trigger_route_list.widget ()); add_sidebar_page (_("Tracks"), _trigger_route_list.widget ());
add_sidebar_page (_("Sources"), _trigger_source_list.widget ()); add_sidebar_page (_("Sources"), _trigger_source_list.widget ());
add_sidebar_page (_("Regions"), _trigger_region_list.widget ()); add_sidebar_page (_("Regions"), _trigger_region_list.widget ());
/* Upper pane ([slot | strips] | file browser) */
_pane_upper.add (_strip_group_box);
_pane_upper.add (_sidebar_vbox);
_midi_editor = new MidiCueEditor; _midi_editor = new MidiCueEditor;
/* Bottom -- Properties of selected Slot/Region */ /* Bottom -- Properties of selected Slot/Region */
@ -152,15 +148,25 @@ TriggerPage::TriggerPage ()
table->attach (_midi_editor->toolbox(), col, col + 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL); table->attach (_midi_editor->toolbox(), col, col + 1, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL);
++col; ++col;
table->show_all ();
_parameter_box.pack_start (*table); _parameter_box.pack_start (*table);
_parameter_box.set_no_show_all ();
/* Top-level Layout */ /* Top-level Layout */
_content.add (_pane_upper); content_app_bar.add (_application_bar);
_content.add (_parameter_box); content_innermost_hbox.add (_pane);
_content.show ();
_pane.add (_strip_group_box);
/* we cannot `content_midlevel_vbox.remove(_content_att_bottom)` and add it to the _pane
* because visibility updates are not propagated upward, and the pane will not collapse
* when the _parameter_box is hidden
*/
_pane.add (_parameter_box);
content_att_right.add (_sidebar_notebook);
/* Show all */ /* Show all */
_pane_upper.show ();
_strip_group_box.show (); _strip_group_box.show ();
_strip_scroller.show (); _strip_scroller.show ();
_strip_packer.show (); _strip_packer.show ();
@ -170,7 +176,7 @@ TriggerPage::TriggerPage ()
_sidebar_notebook.show_all (); _sidebar_notebook.show_all ();
/* setup keybidings */ /* setup keybidings */
_content.set_data ("ardour-bindings", bindings); contents().set_data ("ardour-bindings", bindings);
/* subscribe to signals */ /* subscribe to signals */
Config->ParameterChanged.connect (*this, invalidator (*this), std::bind (&TriggerPage::parameter_changed, this, _1), gui_context ()); Config->ParameterChanged.connect (*this, invalidator (*this), std::bind (&TriggerPage::parameter_changed, this, _1), gui_context ());
@ -178,14 +184,6 @@ TriggerPage::TriggerPage ()
/* init */ /* init */
update_title (); update_title ();
/* Restore pane state */
float fract;
XMLNode const* settings = ARDOUR_UI::instance ()->trigger_page_settings ();
if (!settings || !settings->get_property ("triggerpage-hpane-pos", fract) || fract > 1.0) {
fract = 0.75f;
}
_pane_upper.set_divider (0, fract);
} }
TriggerPage::~TriggerPage () TriggerPage::~TriggerPage ()
@ -216,13 +214,28 @@ TriggerPage::use_own_window (bool and_fill_it)
return win; return win;
} }
void
TriggerPage::showhide_att_bottom (bool yn)
{
if (_show_bottom_pane == yn) {
return;
}
_show_bottom_pane = yn;
if (!_show_bottom_pane) {
_parameter_box.hide ();
} else if (!Editor::instance ().get_selection ().triggers.empty ()) {
_parameter_box.show ();
}
}
XMLNode& XMLNode&
TriggerPage::get_state () const TriggerPage::get_state () const
{ {
XMLNode* node = new XMLNode (X_("TriggerPage")); XMLNode* node = new XMLNode (X_("TriggerPage"));
node->add_child_nocopy (Tabbable::get_state ()); node->add_child_nocopy (Tabbable::get_state ());
node->set_property (X_("triggerpage-hpane-pos"), _pane_upper.get_divider ());
node->set_property (X_("triggerpage-sidebar-page"), _sidebar_notebook.get_current_page ()); node->set_property (X_("triggerpage-sidebar-page"), _sidebar_notebook.get_current_page ());
node->add_child_nocopy (_midi_editor->get_state()); node->add_child_nocopy (_midi_editor->get_state());
@ -425,7 +438,9 @@ TriggerPage::rec_enable_changed (Trigger const * trigger)
_midi_editor->viewport().show (); _midi_editor->viewport().show ();
} }
_parameter_box.show (); if (_show_bottom_pane) {
_parameter_box.show ();
}
} }
void void
@ -465,7 +480,9 @@ TriggerPage::selection_changed ()
_midi_editor->viewport().show (); _midi_editor->viewport().show ();
} }
_parameter_box.show (); if (_show_bottom_pane) {
_parameter_box.show ();
}
} }
} }
@ -817,7 +834,7 @@ TriggerPage::stop_updating ()
void void
TriggerPage::fast_update_strips () TriggerPage::fast_update_strips ()
{ {
if (_content.get_mapped () && _session) { if (contents().get_mapped () && _session) {
for (list<TriggerStrip*>::iterator i = _strips.begin (); i != _strips.end (); ++i) { for (list<TriggerStrip*>::iterator i = _strips.begin (); i != _strips.end (); ++i) {
(*i)->fast_update (); (*i)->fast_update ();
} }

View File

@ -81,6 +81,8 @@ private:
void pi_property_changed (PBD::PropertyChange const&); void pi_property_changed (PBD::PropertyChange const&);
void stripable_property_changed (PBD::PropertyChange const&, std::weak_ptr<ARDOUR::Stripable>); void stripable_property_changed (PBD::PropertyChange const&, std::weak_ptr<ARDOUR::Stripable>);
void showhide_att_bottom (bool);
void rec_state_changed (); void rec_state_changed ();
void rec_state_clicked (); void rec_state_clicked ();
@ -108,9 +110,8 @@ private:
ApplicationBar _application_bar; ApplicationBar _application_bar;
Gtkmm2ext::Bindings* bindings; Gtkmm2ext::Bindings* bindings;
ArdourWidgets::VPane _content;
ArdourWidgets::HPane _pane_upper; ArdourWidgets::VPane _pane;
Gtk::HBox _strip_group_box; Gtk::HBox _strip_group_box;
Gtk::ScrolledWindow _strip_scroller; Gtk::ScrolledWindow _strip_scroller;
Gtk::HBox _strip_packer; Gtk::HBox _strip_packer;
@ -118,7 +119,6 @@ private:
Gtk::Alignment _cue_area_frame; Gtk::Alignment _cue_area_frame;
Gtk::VBox _cue_area_box; Gtk::VBox _cue_area_box;
Gtk::HBox _parameter_box; Gtk::HBox _parameter_box;
Gtk::VBox _sidebar_vbox;
Gtk::Notebook _sidebar_notebook; Gtk::Notebook _sidebar_notebook;
TriggerClipPicker _trigger_clip_picker; TriggerClipPicker _trigger_clip_picker;
TriggerSourceList _trigger_source_list; TriggerSourceList _trigger_source_list;
@ -129,6 +129,8 @@ private:
FittedCanvasWidget _master_widget; FittedCanvasWidget _master_widget;
CueMaster _master; CueMaster _master;
bool _show_bottom_pane;
SlotPropertiesBox _slot_prop_box; SlotPropertiesBox _slot_prop_box;
AudioTriggerPropertiesBox _audio_trig_box; AudioTriggerPropertiesBox _audio_trig_box;