summaryrefslogtreecommitdiff
path: root/gtk2_ardour/plugin_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2016-07-16 00:12:19 +0200
committerRobin Gareus <robin@gareus.org>2016-07-16 02:12:16 +0200
commitd0f594ffd01de8ba0e0dce1e211c6ee5485615b0 (patch)
tree93ca52c5367615430e167ec3a84825c3f7165f0e /gtk2_ardour/plugin_ui.cc
parentdade1f39b7809df0013561fd8f7a342928970d56 (diff)
adjust plugin-UI height when toggling expanders
Diffstat (limited to 'gtk2_ardour/plugin_ui.cc')
-rw-r--r--gtk2_ardour/plugin_ui.cc24
1 files changed, 17 insertions, 7 deletions
diff --git a/gtk2_ardour/plugin_ui.cc b/gtk2_ardour/plugin_ui.cc
index 711b1f555f..1f70537a41 100644
--- a/gtk2_ardour/plugin_ui.cc
+++ b/gtk2_ardour/plugin_ui.cc
@@ -710,7 +710,19 @@ PlugUIBase::toggle_description()
}
if (!description_expander.get_expanded()) {
+ const int child_height = description_expander.get_child ()->get_height ();
+
description_expander.remove();
+
+ Gtk::Window *toplevel = (Gtk::Window*) description_expander.get_ancestor (GTK_TYPE_WINDOW);
+
+ if (toplevel) {
+ Gtk::Requisition wr;
+ toplevel->get_size (wr.width, wr.height);
+ wr.height -= child_height;
+ toplevel->resize (wr.width, wr.height);
+ }
+
}
}
@@ -725,12 +737,6 @@ PlugUIBase::toggle_plugin_analysis()
eqgui = new PluginEqGui (insert);
}
- Gtk::Window *toplevel = (Gtk::Window*) plugin_analysis_expander.get_ancestor (GTK_TYPE_WINDOW);
-
- if (toplevel) {
- toplevel->get_size (pre_eq_size.width, pre_eq_size.height);
- }
-
plugin_analysis_expander.add (*eqgui);
plugin_analysis_expander.show_all ();
eqgui->start_listening ();
@@ -738,6 +744,7 @@ PlugUIBase::toggle_plugin_analysis()
if (!plugin_analysis_expander.get_expanded()) {
// Hide & remove from expander
+ const int child_height = plugin_analysis_expander.get_child ()->get_height ();
eqgui->hide ();
eqgui->stop_listening ();
@@ -746,7 +753,10 @@ PlugUIBase::toggle_plugin_analysis()
Gtk::Window *toplevel = (Gtk::Window*) plugin_analysis_expander.get_ancestor (GTK_TYPE_WINDOW);
if (toplevel) {
- toplevel->resize (pre_eq_size.width, pre_eq_size.height);
+ Gtk::Requisition wr;
+ toplevel->get_size (wr.width, wr.height);
+ wr.height -= child_height;
+ toplevel->resize (wr.width, wr.height);
}
}
}