Browse Source

Add Module::getPanel().

tags/v2.0.0
Andrew Belt 3 years ago
parent
commit
6c9aebfbde
2 changed files with 5 additions and 1 deletions
  1. +1
    -1
      include/app/ModuleWidget.hpp
  2. +4
    -0
      src/app/ModuleWidget.cpp

+ 1
- 1
include/app/ModuleWidget.hpp View File

@@ -38,11 +38,11 @@ struct ModuleWidget : widget::OpaqueWidget {
*/
void setModule(engine::Module* module);

widget::Widget* getPanel();
/** Sets the panel and sets the size of the ModuleWidget from the panel.
Transfers ownership.
*/
void setPanel(widget::Widget* panel);
/** Use `setPanel(createPanel(svg))` instead. */
void setPanel(std::shared_ptr<Svg> svg);

/** Convenience functions for adding special widgets.


+ 4
- 0
src/app/ModuleWidget.cpp View File

@@ -81,6 +81,10 @@ void ModuleWidget::setModule(engine::Module* module) {
this->module = module;
}

widget::Widget* ModuleWidget::getPanel() {
return internal->panel;
}

void ModuleWidget::setPanel(widget::Widget* panel) {
// Remove existing panel
if (internal->panel) {


Loading…
Cancel
Save