diff --git a/applications/gui2/src/views/addsource.cpp b/applications/gui2/src/views/addsource.cpp index 0fe514d7d3fceff0ecf7dbaabe11716310f146df..13b77f005957f9a40e98f2c0501c0d3689f4333f 100644 --- a/applications/gui2/src/views/addsource.cpp +++ b/applications/gui2/src/views/addsource.cpp @@ -112,7 +112,7 @@ AddSourceWindow::~AddSourceWindow() { } -nanogui::Button *AddSourceWindow::_addButton(const std::string &s, nanogui::Widget *parent) { +nanogui::Button *AddSourceWindow::_addButton(const std::string &s, nanogui::Widget *parent, bool hide) { using namespace nanogui; ftl::URI uri(s); @@ -137,9 +137,9 @@ nanogui::Button *AddSourceWindow::_addButton(const std::string &s, nanogui::Widg button->setFontSize(18); button->setTooltip(s); - button->setCallback([this, uri = s]() { + button->setCallback([this, uri = s, hide]() { ctrl_->add(uri); - close(); + if (hide) close(); }); return button; @@ -205,7 +205,7 @@ void AddSourceWindow::rebuild() { auto hostsrcs = ctrl_->getHosts(); for (auto &s : hostsrcs) { - _addButton(s, tab_items_[3]); + _addButton(s, tab_items_[3], false); } auto streamsrcs = ctrl_->getNetSources(); diff --git a/applications/gui2/src/views/addsource.hpp b/applications/gui2/src/views/addsource.hpp index da075fbab3fc4ac93cc4aee96f70c3301b20c69a..7e6ca31938b57ce063be81c8d0b77dc73e3b92da 100644 --- a/applications/gui2/src/views/addsource.hpp +++ b/applications/gui2/src/views/addsource.hpp @@ -25,7 +25,7 @@ private: void close(); void rebuild(); - nanogui::Button *_addButton(const std::string &s, nanogui::Widget *parent); + nanogui::Button *_addButton(const std::string &s, nanogui::Widget *parent, bool hide=true); ftl::Handle new_source_handle_; MUTEX mutex_; diff --git a/components/renderers/cpp/src/overlay.cpp b/components/renderers/cpp/src/overlay.cpp index 64dfaa2fa8c60448c233010f4650e3aa4a006c49..ef755170e6b2f0b737a0cd9cf081249783c5f68a 100644 --- a/components/renderers/cpp/src/overlay.cpp +++ b/components/renderers/cpp/src/overlay.cpp @@ -166,8 +166,8 @@ void Overlay::_createShapes() { shapes_[Shape::XZPLANE] = {88, 2*3, 94, 40*2}; shapes_[Shape::AXIS] = {0, 0, 82, 2*3}; - oShader.uploadAttrib("vertex", sizeof(float3)*shape_verts_.size(), 3, sizeof(float), GL_FLOAT, false, shape_verts_.data()); - oShader.uploadAttrib ("indices", sizeof(int)*shape_tri_indices_.size(), 1, sizeof(int), GL_UNSIGNED_INT, true, shape_tri_indices_.data()); + oShader.uploadAttrib("vertex", 3*shape_verts_.size(), 3, sizeof(float), GL_FLOAT, false, shape_verts_.data()); + oShader.uploadAttrib ("indices", 1*shape_tri_indices_.size(), 1, sizeof(int), GL_UNSIGNED_INT, true, shape_tri_indices_.data()); } void Overlay::_drawFilledShape(Shape shape, const Eigen::Matrix4d &pose, float scale, uchar4 c) {