nodeview: added rudimentary toolbar

Only button there is a toggle for the mini-map.
This commit is contained in:
itsmattkc
2021-07-09 21:57:53 -07:00
parent 94e6fa843c
commit 652a53c18e
6 changed files with 113 additions and 1 deletions
+19 -1
View File
@@ -20,20 +20,38 @@
#include "node.h"
#include <QVBoxLayout>
namespace olive {
NodePanel::NodePanel(QWidget *parent) :
PanelWidget(QStringLiteral("NodePanel"), parent)
{
QWidget *outer_widget = new QWidget(this);
QVBoxLayout *outer_layout = new QVBoxLayout(outer_widget);
outer_layout->setMargin(0);
NodeViewToolBar *toolbar = new NodeViewToolBar();
outer_layout->addWidget(toolbar);
// Create NodeView widget
node_view_ = new NodeView(this);
outer_layout->addWidget(node_view_);
// Connect toolbar to NodeView
connect(toolbar, &NodeViewToolBar::MiniMapEnabledToggled, node_view_, &NodeView::SetMiniMapEnabled);
// Set defaults
toolbar->SetMiniMapEnabled(true);
node_view_->SetMiniMapEnabled(true);
// Connect node view signals to this panel
connect(node_view_, &NodeView::NodesSelected, this, &NodePanel::NodesSelected);
connect(node_view_, &NodeView::NodesDeselected, this, &NodePanel::NodesDeselected);
// Set it as the main widget of this panel
SetWidgetWithPadding(node_view_);
SetWidgetWithPadding(outer_widget);
// Set strings
Retranslate();