make PluginUIWindow inherit from ArdourWindow not GtkWindow
This commit is contained in:
parent
f04c35cb1c
commit
7df1654947
@ -82,11 +82,10 @@ using namespace Gtkmm2ext;
|
||||
using namespace Gtk;
|
||||
|
||||
PluginUIWindow::PluginUIWindow (
|
||||
Gtk::Window* win,
|
||||
boost::shared_ptr<PluginInsert> insert,
|
||||
bool scrollable,
|
||||
bool editor)
|
||||
: parent (win)
|
||||
: ArdourWindow (string())
|
||||
, was_visible (false)
|
||||
, _keyboard_focused (false)
|
||||
#ifdef AUDIOUNIT_SUPPORT
|
||||
@ -96,7 +95,6 @@ PluginUIWindow::PluginUIWindow (
|
||||
|
||||
{
|
||||
bool have_gui = false;
|
||||
|
||||
Label* label = manage (new Label());
|
||||
label->set_markup ("<b>THIS IS THE PLUGIN UI</b>");
|
||||
|
||||
@ -147,7 +145,6 @@ PluginUIWindow::PluginUIWindow (
|
||||
signal_unmap_event().connect (sigc::mem_fun (*pu, &GenericPluginUI::stop_updating));
|
||||
}
|
||||
|
||||
// set_position (Gtk::WIN_POS_MOUSE);
|
||||
set_name ("PluginEditor");
|
||||
add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK|Gdk::BUTTON_PRESS_MASK|Gdk::BUTTON_RELEASE_MASK);
|
||||
|
||||
@ -163,6 +160,7 @@ PluginUIWindow::PluginUIWindow (
|
||||
|
||||
set_default_size (w, h);
|
||||
set_resizable (_pluginui->resizable());
|
||||
set_position (Gtk::WIN_POS_MOUSE);
|
||||
}
|
||||
|
||||
PluginUIWindow::~PluginUIWindow ()
|
||||
@ -170,19 +168,10 @@ PluginUIWindow::~PluginUIWindow ()
|
||||
delete _pluginui;
|
||||
}
|
||||
|
||||
void
|
||||
PluginUIWindow::set_parent (Gtk::Window* win)
|
||||
{
|
||||
parent = win;
|
||||
}
|
||||
|
||||
void
|
||||
PluginUIWindow::on_map ()
|
||||
{
|
||||
Window::on_map ();
|
||||
#ifdef __APPLE__
|
||||
set_keep_above (true);
|
||||
#endif // __APPLE__
|
||||
}
|
||||
|
||||
bool
|
||||
@ -236,10 +225,6 @@ PluginUIWindow::on_show ()
|
||||
Window::on_show ();
|
||||
}
|
||||
}
|
||||
|
||||
if (parent) {
|
||||
// set_transient_for (*parent);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -50,6 +50,7 @@
|
||||
|
||||
#include "automation_controller.h"
|
||||
#include "ardour_button.h"
|
||||
#include "ardour_window.h"
|
||||
|
||||
namespace ARDOUR {
|
||||
class PluginInsert;
|
||||
@ -278,11 +279,10 @@ class GenericPluginUI : public PlugUIBase, public Gtk::VBox
|
||||
bool integer_printer (char* buf, Gtk::Adjustment &, ControlUI *);
|
||||
};
|
||||
|
||||
class PluginUIWindow : public Gtk::Window
|
||||
class PluginUIWindow : public ArdourWindow
|
||||
{
|
||||
public:
|
||||
PluginUIWindow (Gtk::Window*,
|
||||
boost::shared_ptr<ARDOUR::PluginInsert> insert,
|
||||
PluginUIWindow (boost::shared_ptr<ARDOUR::PluginInsert> insert,
|
||||
bool scrollable=false,
|
||||
bool editor=true);
|
||||
~PluginUIWindow ();
|
||||
|
@ -2094,20 +2094,16 @@ ProcessorBox::toggle_edit_processor (boost::shared_ptr<Processor> processor)
|
||||
|
||||
/* these are both allowed to be null */
|
||||
|
||||
Container* toplevel = get_toplevel();
|
||||
Window* win = dynamic_cast<Gtk::Window*>(toplevel);
|
||||
|
||||
Window* w = get_processor_ui (plugin_insert);
|
||||
|
||||
if (w == 0) {
|
||||
|
||||
plugin_ui = new PluginUIWindow (win, plugin_insert);
|
||||
plugin_ui = new PluginUIWindow (plugin_insert);
|
||||
plugin_ui->set_title (generate_processor_title (plugin_insert));
|
||||
set_processor_ui (plugin_insert, plugin_ui);
|
||||
|
||||
} else {
|
||||
plugin_ui = dynamic_cast<PluginUIWindow *> (w);
|
||||
plugin_ui->set_parent (win);
|
||||
}
|
||||
|
||||
gidget = plugin_ui;
|
||||
@ -2155,9 +2151,7 @@ ProcessorBox::toggle_edit_generic_processor (boost::shared_ptr<Processor> proces
|
||||
return;
|
||||
}
|
||||
|
||||
Container* toplevel = get_toplevel();
|
||||
Window* win = dynamic_cast<Gtk::Window*>(toplevel);
|
||||
PluginUIWindow* plugin_ui = new PluginUIWindow(win, plugin_insert, true, false);
|
||||
PluginUIWindow* plugin_ui = new PluginUIWindow (plugin_insert, true, false);
|
||||
plugin_ui->set_title(generate_processor_title (plugin_insert));
|
||||
|
||||
if (plugin_ui->is_visible()) {
|
||||
|
Loading…
Reference in New Issue
Block a user