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
+47
View File
@@ -0,0 +1,47 @@
#include "nodeviewtoolbar.h"
#include <QEvent>
#include <QHBoxLayout>
namespace olive {
#define super QWidget
NodeViewToolBar::NodeViewToolBar(QWidget *parent) :
QWidget(parent)
{
QHBoxLayout *layout = new QHBoxLayout(this);
layout->setMargin(0);
minimap_btn_ = new QPushButton();
minimap_btn_->setCheckable(true);
connect(minimap_btn_, &QPushButton::clicked, this, &NodeViewToolBar::MiniMapEnabledToggled);
layout->addWidget(minimap_btn_);
layout->addStretch();
Retranslate();
UpdateIcons();
}
void NodeViewToolBar::changeEvent(QEvent *e)
{
if (e->type() == QEvent::LanguageChange) {
Retranslate();
} else if (e->type() == QEvent::StyleChange) {
UpdateIcons();
}
super::changeEvent(e);
}
void NodeViewToolBar::Retranslate()
{
minimap_btn_->setText(tr("Mini-Map"));
minimap_btn_->setToolTip(tr("Toggle Mini-Map"));
}
void NodeViewToolBar::UpdateIcons()
{
}
}