Browse Source

- Add Row, Column (UI layout).

- Rename content view.
cl-refactor
yann300 10 years ago
committed by yann300
parent
commit
7091f201b1
  1. 16
      mix/CodeEditorExtensionManager.cpp
  2. 12
      mix/CodeEditorExtensionManager.h
  3. 2
      mix/ConstantCompilationControl.cpp
  4. 4
      mix/Extension.h
  5. 2
      mix/TransactionListView.cpp
  6. 61
      mix/qml/MainContent.qml

16
mix/CodeEditorExtensionManager.cpp

@ -80,10 +80,10 @@ void CodeEditorExtensionManager::initExtension(std::shared_ptr<Extension> _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;
}

12
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<std::shared_ptr<Extension>> m_features;
QQuickItem* m_tabView;
QQuickItem* m_rightTabView;
QQuickItem* m_headerView;
QQuickItem* m_rightView;
QTextDocument* m_doc;
AppContext* m_appContext;
void loadEditor(QQuickItem* _editor);

2
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);
}

4
mix/Extension.h

@ -33,8 +33,8 @@ class AppContext;
enum ExtensionDisplayBehavior
{
Tab,
RightTab,
HeaderView,
RightView,
ModalDialog
};

2
mix/TransactionListView.cpp

@ -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());

61
mix/qml/MainContent.qml

@ -17,24 +17,39 @@ Rectangle {
height: parent.height
width: parent.width;
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.Horizontal
anchors.fill: parent
SplitView {
//anchors.fill: parent
width: parent.width * 0.8
orientation: Qt.Vertical
orientation: Qt.Vertical;
anchors.fill: parent;
Rectangle {
anchors.top: parent.top
id: contentView
width: parent.width
height: parent.height * 0.7
id: editorRect;
height: parent.height;
width: parent.width /2;
TextArea {
id: codeEditor
height: parent.height
width: parent.width
font.family: "Monospace"
font.pointSize: 12
width: parent.width
anchors.centerIn: parent
tabChangesFocus: false
Keys.onPressed: {
@ -46,18 +61,11 @@ Rectangle {
}
}
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 {}
}
}
id: rightView;
height: parent.height;
width: parent.width /2;
Rectangle {
id: debugWindow;
}
Rectangle {
anchors.right: parent.right
@ -69,13 +77,10 @@ Rectangle {
id: rightPaneTabs
antialiasing: true
anchors.fill: parent
//style: TabStyle {}
}
}
CodeEditorExtensionManager {
tabView: contextualTabs
rightTabView: rightPaneTabs
editor: codeEditor
}
}
}
}
}

Loading…
Cancel
Save