|
|
|
@ -11,6 +11,8 @@
@@ -11,6 +11,8 @@
|
|
|
|
|
#include <QDesktopServices> |
|
|
|
|
#include <QUrl> |
|
|
|
|
#include <QLineEdit> |
|
|
|
|
#include <QTabWidget> |
|
|
|
|
#include <iostream> |
|
|
|
|
|
|
|
|
|
Window::Window(QWidget *parent) : |
|
|
|
|
QWidget(parent) |
|
|
|
@ -25,16 +27,31 @@ Window::Window(QWidget *parent) :
@@ -25,16 +27,31 @@ Window::Window(QWidget *parent) :
|
|
|
|
|
navbar->addWidget(mPathBar); |
|
|
|
|
|
|
|
|
|
body->addLayout(navbar); |
|
|
|
|
auto pane = new hex::Pane; |
|
|
|
|
body->addWidget(pane); |
|
|
|
|
|
|
|
|
|
mTabWidget = new QTabWidget; |
|
|
|
|
body->addWidget(mTabWidget); |
|
|
|
|
mTabWidget->addTab(new hex::Pane, "1"); |
|
|
|
|
mTabWidget->addTab(new hex::Pane, "2"); |
|
|
|
|
mTabWidget->addTab(new hex::Pane, "3"); |
|
|
|
|
|
|
|
|
|
QObject::connect(mTabWidget, &QTabWidget::currentChanged, |
|
|
|
|
this, &Window::switchActiveTab); |
|
|
|
|
|
|
|
|
|
this->setLayout(body); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void Window::switchActivePane(hex::Pane* newPane) { |
|
|
|
|
mPathBar->setText(newPane->getPath()); |
|
|
|
|
QObject::connect(mButton, &QPushButton::clicked, |
|
|
|
|
pane, &hex::Pane::moveUp); |
|
|
|
|
QObject::connect(mPathBar, &QLineEdit::textChanged, |
|
|
|
|
pane, &hex::Pane::setPath); |
|
|
|
|
QObject::connect(pane, &hex::Pane::pathChanged, |
|
|
|
|
newPane, &hex::Pane::moveUp); |
|
|
|
|
//QObject::connect(mPathBar, &QLineEdit::textChanged,
|
|
|
|
|
// newPane, &hex::Pane::setPath);
|
|
|
|
|
QObject::connect(newPane, &hex::Pane::pathChanged, |
|
|
|
|
mPathBar, &QLineEdit::setText); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void Window::switchActiveTab(int newTab) { |
|
|
|
|
std::cout << newTab; |
|
|
|
|
switchActivePane(dynamic_cast<hex::Pane*>(mTabWidget->widget(newTab))); |
|
|
|
|
} |
|
|
|
|