diff --git a/mix/CodeEditorExtensionManager.cpp b/mix/CodeEditorExtensionManager.cpp index 4a93352b1..2edec1d72 100644 --- a/mix/CodeEditorExtensionManager.cpp +++ b/mix/CodeEditorExtensionManager.cpp @@ -80,10 +80,10 @@ void CodeEditorExtensionManager::initExtension(std::shared_ptr _ext) { try { - if (_ext->getDisplayBehavior() == ExtensionDisplayBehavior::Tab) - _ext->addTabOn(m_tabView); - else if (_ext->getDisplayBehavior() == ExtensionDisplayBehavior::RightTab) - _ext->addTabOn(m_rightTabView); + if (_ext->getDisplayBehavior() == ExtensionDisplayBehavior::RightView) + _ext->addContentOn(m_rightView); + if (_ext->getDisplayBehavior() == ExtensionDisplayBehavior::HeaderView) + _ext->addContentOn(m_headerView); } catch (...) { @@ -110,12 +110,12 @@ void CodeEditorExtensionManager::setEditor(QQuickItem* _editor) } } -void CodeEditorExtensionManager::setRightTabView(QQuickItem* _tabView) +void CodeEditorExtensionManager::setRightView(QQuickItem* _rightView) { - m_rightTabView = _tabView; + m_rightView = _rightView; } -void CodeEditorExtensionManager::setTabView(QQuickItem* _tabView) +void CodeEditorExtensionManager::setHeaderView(QQuickItem* _headerView) { - m_tabView = _tabView; + m_headerView = _headerView; } diff --git a/mix/CodeEditorExtensionManager.h b/mix/CodeEditorExtensionManager.h index 22ba1acef..30ffc8d9d 100644 --- a/mix/CodeEditorExtensionManager.h +++ b/mix/CodeEditorExtensionManager.h @@ -44,8 +44,8 @@ class CodeEditorExtensionManager: public QObject Q_OBJECT Q_PROPERTY(QQuickItem* editor MEMBER m_editor WRITE setEditor) - Q_PROPERTY(QQuickItem* tabView MEMBER m_tabView WRITE setTabView) - Q_PROPERTY(QQuickItem* rightTabView MEMBER m_rightTabView WRITE setRightTabView) + Q_PROPERTY(QQuickItem* headerView MEMBER m_headerView WRITE setHeaderView) + Q_PROPERTY(QQuickItem* rightView MEMBER m_rightView WRITE setRightView) public: CodeEditorExtensionManager(); @@ -57,15 +57,15 @@ public: /// Set current text editor. void setEditor(QQuickItem*); /// Set current tab view - void setTabView(QQuickItem*); + void setHeaderView(QQuickItem*); /// Set current right tab view. - void setRightTabView(QQuickItem*); + void setRightView(QQuickItem*); private: QQuickItem* m_editor; QVector> m_features; - QQuickItem* m_tabView; - QQuickItem* m_rightTabView; + QQuickItem* m_headerView; + QQuickItem* m_rightView; QTextDocument* m_doc; AppContext* m_appContext; void loadEditor(QQuickItem* _editor); diff --git a/mix/ConstantCompilationControl.cpp b/mix/ConstantCompilationControl.cpp index 58f8df5f9..fb6fbc90e 100644 --- a/mix/ConstantCompilationControl.cpp +++ b/mix/ConstantCompilationControl.cpp @@ -34,7 +34,7 @@ using namespace dev::mix; -ConstantCompilationControl::ConstantCompilationControl(AppContext* _context): Extension(_context, ExtensionDisplayBehavior::Tab) +ConstantCompilationControl::ConstantCompilationControl(AppContext* _context): Extension(_context, ExtensionDisplayBehavior::HeaderView) { connect(_context->codeModel(), &CodeModel::compilationComplete, this, &ConstantCompilationControl::update); } diff --git a/mix/Extension.h b/mix/Extension.h index bbd2d206b..98daf2918 100644 --- a/mix/Extension.h +++ b/mix/Extension.h @@ -33,8 +33,8 @@ class AppContext; enum ExtensionDisplayBehavior { - Tab, - RightTab, + HeaderView, + RightView, ModalDialog }; diff --git a/mix/TransactionListView.cpp b/mix/TransactionListView.cpp index 55df90b8a..80b635243 100644 --- a/mix/TransactionListView.cpp +++ b/mix/TransactionListView.cpp @@ -1,18 +1,18 @@ /* - This file is part of cpp-ethereum. + This file is part of cpp-ethereum. - cpp-ethereum is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. + cpp-ethereum is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. - cpp-ethereum is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + cpp-ethereum is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. - You should have received a copy of the GNU General Public License - along with cpp-ethereum. If not, see . + You should have received a copy of the GNU General Public License + along with cpp-ethereum. If not, see . */ /** @file TransactionListView.cpp * @author Arkadiy Paronyan arkadiy@ethdev.com @@ -29,7 +29,7 @@ #include "TransactionListModel.h" using namespace dev::mix; -TransactionListView::TransactionListView(AppContext* _context): Extension(_context, ExtensionDisplayBehavior::RightTab) +TransactionListView::TransactionListView(AppContext* _context): Extension(_context, ExtensionDisplayBehavior::RightView) { m_model.reset(new TransactionListModel(this, _context)); m_appEngine->rootContext()->setContextProperty("transactionListModel", m_model.get()); diff --git a/mix/qml/MainContent.qml b/mix/qml/MainContent.qml index 794e5746d..8669f191e 100644 --- a/mix/qml/MainContent.qml +++ b/mix/qml/MainContent.qml @@ -16,66 +16,71 @@ Rectangle { anchors.fill: parent height: parent.height width: parent.width; - id:root - SplitView { - orientation: Qt.Horizontal - anchors.fill: parent - SplitView { - //anchors.fill: parent - width: parent.width * 0.8 - orientation: Qt.Vertical - Rectangle { - anchors.top: parent.top - id: contentView - width: parent.width - height: parent.height * 0.7 - TextArea { - id: codeEditor - height: parent.height - font.family: "Monospace" - font.pointSize: 12 - width: parent.width - anchors.centerIn: parent - tabChangesFocus: false - Keys.onPressed: { - if (event.key === Qt.Key_Tab) { - codeEditor.insert(codeEditor.cursorPosition, "\t"); - event.accepted = true; - } - } - } - } - Rectangle { - anchors.bottom: parent.bottom - id: contextualView - width: parent.width - Layout.minimumHeight: 20 - height: parent.height * 0.3 - TabView { - id: contextualTabs - antialiasing: true - anchors.fill: parent - style: TabStyle {} - } - } - } - Rectangle { - anchors.right: parent.right - id: rightPaneView - width: parent.width * 0.2 - height: parent.height - Layout.minimumWidth: 20 - TabView { - id: rightPaneTabs - antialiasing: true - anchors.fill: parent - //style: TabStyle {} - } - } - CodeEditorExtensionManager { - tabView: contextualTabs - rightTabView: rightPaneTabs - editor: codeEditor - } - } + id:root + + CodeEditorExtensionManager { + headerView: headerView; + rightView: rightView; + editor: codeEditor + } + + Column { + anchors.fill: parent; + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + Rectangle { + id: headerView + height: 50 + width: parent.width; + } + Row { + anchors.fill: parent; + anchors.horizontalCenter: parent.horizontalCenter + anchors.verticalCenter: parent.verticalCenter + SplitView { + orientation: Qt.Vertical; + anchors.fill: parent; + Rectangle { + id: editorRect; + height: parent.height; + width: parent.width /2; + TextArea { + id: codeEditor + height: parent.height + width: parent.width + font.family: "Monospace" + font.pointSize: 12 + anchors.centerIn: parent + tabChangesFocus: false + Keys.onPressed: { + if (event.key === Qt.Key_Tab) { + codeEditor.insert(codeEditor.cursorPosition, "\t"); + event.accepted = true; + } + } + } + } + Rectangle { + id: rightView; + height: parent.height; + width: parent.width /2; + Rectangle { + id: debugWindow; + } + Rectangle { + anchors.right: parent.right + id: rightPaneView + width: parent.width * 0.2 + height: parent.height + Layout.minimumWidth: 20 + TabView { + id: rightPaneTabs + antialiasing: true + anchors.fill: parent + } + } + } + } + } + } }