+ Gtk::Requisition wr;
+ toplevel->get_size (wr.width, wr.height);
+ wr.height -= child_height;
+ toplevel->resize (wr.width, wr.height);
+ }
+ }
+}
+
+void
+PlugUIBase::toggle_cpuload_display()
+{
+ if (cpuload_expander.get_expanded() && !cpuload_expander.get_child()) {
+ if (stats_gui == 0) {
+ stats_gui = new PluginLoadStatsGui (insert);
+ }
+ cpuload_expander.add (*stats_gui);
+ cpuload_expander.show_all();
+ stats_gui->start_updating ();
+ }
+
+ if (!cpuload_expander.get_expanded()) {
+ const int child_height = cpuload_expander.get_child ()->get_height ();
+
+ stats_gui->hide ();
+ stats_gui->stop_updating ();
+ cpuload_expander.remove();
+
+ Gtk::Window *toplevel = (Gtk::Window*) cpuload_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);