diff options
author | Sampo Savolainen <v2@iki.fi> | 2009-05-08 17:21:17 +0000 |
---|---|---|
committer | Sampo Savolainen <v2@iki.fi> | 2009-05-08 17:21:17 +0000 |
commit | 764e6f919fe50692aae66855f457d4dbc515e125 (patch) | |
tree | 9af44395ca1680ef7a2f53d3284f94aeebe1ebe8 | |
parent | 05c597d0ee7b36fc4f8f8e524a761b20e954d0ac (diff) |
Use an expander properly to control the visibility of plugin analysis.
git-svn-id: svn://localhost/ardour2/branches/3.0@5067 d708f5d6-7413-0410-9779-e7cbd77b26cf
-rw-r--r-- | gtk2_ardour/generic_pluginui.cc | 5 | ||||
-rw-r--r-- | gtk2_ardour/plugin_ui.cc | 26 | ||||
-rw-r--r-- | gtk2_ardour/plugin_ui.h | 5 |
3 files changed, 17 insertions, 19 deletions
diff --git a/gtk2_ardour/generic_pluginui.cc b/gtk2_ardour/generic_pluginui.cc index 713fcfcc87..0184635b60 100644 --- a/gtk2_ardour/generic_pluginui.cc +++ b/gtk2_ardour/generic_pluginui.cc @@ -74,7 +74,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol set_border_width (10); //set_homogeneous (false); - pack1(main_contents); + pack_start(main_contents); settings_box.set_homogeneous (false); HBox* constraint_hbox = manage (new HBox); @@ -96,8 +96,7 @@ GenericPluginUI::GenericPluginUI (boost::shared_ptr<PluginInsert> pi, bool scrol VBox* v1_box = manage (new VBox); VBox* v2_box = manage (new VBox); - constraint_hbox->pack_start (eqgui_toggle, false, false); - add2(plugin_eq_bin); + pack_end(plugin_analysis_expander); v1_box->pack_start (*smaller_hbox, false, true); v2_box->pack_start (focus_button, false, true); diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc index 21f0a938d6..f398c23d7c 100644 --- a/gtk2_ardour/plugin_ui.cc +++ b/gtk2_ardour/plugin_ui.cc @@ -348,7 +348,7 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi) save_button(_("Add")), bypass_button (_("Bypass")), latency_gui (0), - eqgui_toggle (_("Freq Analysis")) + plugin_analysis_expander (_("Plugin analysis")) { //preset_combo.set_use_arrows_always(true); update_presets(); @@ -363,10 +363,6 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi) mem_fun(*this, &PlugUIBase::processor_active_changed), boost::weak_ptr<Processor>(insert))); - eqgui_toggle.set_active (false); - eqgui_toggle.signal_toggled().connect( mem_fun(*this, &PlugUIBase::toggle_plugin_analysis)); - - bypass_button.set_active (!pi->active()); bypass_button.set_name ("PluginBypassButton"); @@ -386,7 +382,9 @@ PlugUIBase::PlugUIBase (boost::shared_ptr<PluginInsert> pi) ARDOUR_UI::instance()->set_tip (&focus_button, _("Click to allow the plugin to receive keyboard events that Ardour would normally use as a shortcut"), ""); ARDOUR_UI::instance()->set_tip (&bypass_button, _("Click to enable/disable this plugin"), ""); - plugin_eq_bin.set_expanded(true); + plugin_analysis_expander.property_expanded().signal_changed().connect( mem_fun(*this, &PlugUIBase::toggle_plugin_analysis)); + + plugin_analysis_expander.set_expanded(false); } PlugUIBase::~PlugUIBase() @@ -510,24 +508,26 @@ PlugUIBase::focus_toggled (GdkEventButton* ev) void PlugUIBase::toggle_plugin_analysis() { - if (eqgui_toggle.get_active() && !plugin_eq_bin.get_child()) { + if (plugin_analysis_expander.get_expanded() && + !plugin_analysis_expander.get_child()) { // Create the GUI PluginEqGui *foo = new PluginEqGui(insert); - plugin_eq_bin.add( *foo ); - plugin_eq_bin.show_all(); + plugin_analysis_expander.add( *foo ); + plugin_analysis_expander.show_all(); } Gtk::Widget *gui; - if (!eqgui_toggle.get_active() && (gui = plugin_eq_bin.get_child())) { + if (!plugin_analysis_expander.get_expanded() && + (gui = plugin_analysis_expander.get_child())) { // Hide & remove gui->hide(); - //plugin_eq_bin.remove(*gui); - plugin_eq_bin.remove(); + //plugin_analysis_expander.remove(*gui); + plugin_analysis_expander.remove(); delete gui; - Gtk::Widget *toplevel = plugin_eq_bin.get_toplevel(); + Gtk::Widget *toplevel = plugin_analysis_expander.get_toplevel(); if (!toplevel) { std::cerr << "No toplevel widget?!?!" << std::endl; return; diff --git a/gtk2_ardour/plugin_ui.h b/gtk2_ardour/plugin_ui.h index e65abbac59..1e0498212c 100644 --- a/gtk2_ardour/plugin_ui.h +++ b/gtk2_ardour/plugin_ui.h @@ -101,8 +101,7 @@ class PlugUIBase : public virtual sigc::trackable LatencyGUI* latency_gui; ArdourDialog* latency_dialog; - Gtk::Expander plugin_eq_bin; - Gtk::ToggleButton eqgui_toggle; + Gtk::Expander plugin_analysis_expander; Gtk::Image* focus_out_image; Gtk::Image* focus_in_image; @@ -115,7 +114,7 @@ class PlugUIBase : public virtual sigc::trackable void processor_active_changed (boost::weak_ptr<ARDOUR::Processor> p); }; -class GenericPluginUI : public PlugUIBase, public Gtk::HPaned +class GenericPluginUI : public PlugUIBase, public Gtk::VBox { public: GenericPluginUI (boost::shared_ptr<ARDOUR::PluginInsert> plug, bool scrollable=false); |