summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/PatchBox.cpp14
-rw-r--r--src/gui/PatchBox.hpp2
-rw-r--r--src/gui/ingen_gui_lv2.cpp8
3 files changed, 20 insertions, 4 deletions
diff --git a/src/gui/PatchBox.cpp b/src/gui/PatchBox.cpp
index 1a38e027..cd3478c7 100644
--- a/src/gui/PatchBox.cpp
+++ b/src/gui/PatchBox.cpp
@@ -41,6 +41,7 @@
#include "PatchView.hpp"
#include "PatchWindow.hpp"
#include "ThreadedLoader.hpp"
+#include "WidgetFactory.hpp"
#include "WindowFactory.hpp"
#include "ingen_config.h"
@@ -160,6 +161,17 @@ PatchBox::~PatchBox()
delete _breadcrumbs;
}
+SharedPtr<PatchBox>
+PatchBox::create(App& app, SharedPtr<const PatchModel> patch)
+{
+ PatchBox* result = NULL;
+ Glib::RefPtr<Gtk::Builder> xml = WidgetFactory::create("patch_win");
+ xml->get_widget_derived("patch_win_vbox", result);
+ result->init_box(app);
+ result->set_patch(patch, SharedPtr<PatchView>());
+ return SharedPtr<PatchBox>(result);
+}
+
void
PatchBox::init_box(App& app)
{
@@ -258,6 +270,7 @@ PatchBox::set_patch(SharedPtr<const PatchModel> patch,
show();
_alignment->show_all();
+ hide_documentation();
_view->signal_object_entered.connect(
sigc::mem_fun(this, &PatchBox::object_entered));
@@ -318,6 +331,7 @@ PatchBox::hide_documentation()
{
_doc_scrolledwindow->remove();
_doc_scrolledwindow->hide();
+ _doc_paned->set_position(INT_MAX);
}
void
diff --git a/src/gui/PatchBox.hpp b/src/gui/PatchBox.hpp
index bd275cbb..d6d03829 100644
--- a/src/gui/PatchBox.hpp
+++ b/src/gui/PatchBox.hpp
@@ -58,6 +58,8 @@ public:
const Glib::RefPtr<Gtk::Builder>& xml);
~PatchBox();
+ static SharedPtr<PatchBox> create(App& app, SharedPtr<const PatchModel> patch);
+
void init_box(App& app);
void set_patch(SharedPtr<const PatchModel> pc, SharedPtr<PatchView> view);
void set_window(PatchWindow* win) { _window = win; }
diff --git a/src/gui/ingen_gui_lv2.cpp b/src/gui/ingen_gui_lv2.cpp
index 0004b935..6fde9f93 100644
--- a/src/gui/ingen_gui_lv2.cpp
+++ b/src/gui/ingen_gui_lv2.cpp
@@ -27,7 +27,7 @@
#include "lv2/lv2plug.in/ns/extensions/ui/ui.h"
#include "App.hpp"
-#include "PatchView.hpp"
+#include "PatchBox.hpp"
#define INGEN_LV2_UI_URI "http://drobilla.net/ns/ingen#ui"
@@ -68,7 +68,7 @@ struct IngenLV2UI {
Ingen::Shared::World* world;
IngenLV2AtomSink* sink;
SharedPtr<Ingen::GUI::App> app;
- SharedPtr<Ingen::GUI::PatchView> view;
+ SharedPtr<Ingen::GUI::PatchBox> view;
SharedPtr<Ingen::Interface> engine;
SharedPtr<Ingen::Shared::AtomReader> reader;
SharedPtr<Ingen::Client::SigClientInterface> client;
@@ -137,10 +137,10 @@ instantiate(const LV2UI_Descriptor* descriptor,
ui->app->uris().ingen_Patch));
ui->app->store()->put("path:/", props);
- // Create a PatchView for the root and set as the UI widget
+ // Create a PatchBox for the root and set as the UI widget
SharedPtr<const Ingen::Client::PatchModel> root = PtrCast<const Ingen::Client::PatchModel>(
ui->app->store()->object("path:/"));
- ui->view = Ingen::GUI::PatchView::create(*ui->app, root);
+ ui->view = Ingen::GUI::PatchBox::create(*ui->app, root);
ui->view->unparent();
*widget = ui->view->gobj();