Skip to content

Commit

Permalink
Work on ExampleActionsPlugin and ExampleProxyAction
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasKroes committed Jun 20, 2024
1 parent 0a06d7d commit a159191
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
5 changes: 4 additions & 1 deletion ExampleActions/src/ExampleActionsPlugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ ExampleActionsPlugin::ExampleActionsPlugin(const PluginFactory* factory) :

verticalGroupAction->setDefaultWidgetFlag(VerticalGroupAction::WidgetFlag::NoMargins);
verticalGroupAction->setShowLabels(false);
verticalGroupAction->addAction(new ExampleProxyAction(this, "", action));
verticalGroupAction->addAction(new ExampleProxyAction(verticalGroupAction, "", action));

_examplesGroupsAction.addGroupAction(verticalGroupAction);
}
Expand All @@ -77,6 +77,9 @@ void ExampleActionsPlugin::init()
splitter->addWidget(_examplesTreeAction.createWidget(&getWidget()));
splitter->addWidget(_examplesGroupsAction.createWidget(&getWidget()));

splitter->setStretchFactor(0, 1);
splitter->setStretchFactor(1, 3);

layout->addWidget(splitter);

getWidget().setLayout(layout);
Expand Down
13 changes: 10 additions & 3 deletions ExampleActions/src/ExampleProxyAction.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
#include "ExampleProxyAction.h"

#include <QHBoxLayout>
#include <QLabel>

using namespace mv::gui;

Expand All @@ -19,10 +20,16 @@ QWidget* ExampleProxyAction::getWidget(QWidget* parent, const std::int32_t& widg
auto widget = new WidgetActionWidget(parent, this);
auto layout = new QHBoxLayout();

layout->setContentsMargins(0, 0, 0, 0);
//layout->setContentsMargins(0, 0, 0, 0);

if (_action)
layout->addWidget(_action->createExampleWidget(widget));
if (_action) {
auto exampleActionWidget = _action->createExampleWidget(widget);

if (exampleActionWidget)
layout->addWidget(exampleActionWidget);
else
layout->addWidget(new QLabel("Coming soon..."));
}

widget->setLayout(layout);

Expand Down

0 comments on commit a159191

Please sign in to comment.