You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

181 lines
3.4 KiB

import QtQuick 2.2
import QtQuick.Controls 1.1
10 years ago
import QtQuick.Layouts 1.0
import QtQuick.Controls.Styles 1.1
10 years ago
import CodeEditorExtensionManager 1.0
Rectangle {
10 years ago
objectName: "mainContent"
signal keyPressed(variant event)
focus: true
Keys.enabled: true
Keys.onPressed:
{
root.keyPressed(event.key);
}
anchors.fill: parent
10 years ago
id: root
property alias rightViewVisible : rightView.visible
property alias webViewVisible : webPreview.visible
function toggleRightView() {
if (!rightView.visible)
rightView.show();
else
rightView.hide();
}
function ensureRightView() {
10 years ago
if (!rightView.visible)
rightView.show();
}
function hideRightView() {
10 years ago
if (rightView.visible)
rightView.hide();
}
function toggleWebPreview() {
webPreview.visible = !webPreview.visible;
}
CodeEditorExtensionManager {
10 years ago
headerView: headerPaneTabs;
rightView: rightPaneTabs;
}
10 years ago
GridLayout
{
anchors.fill: parent
rows: 2
flow: GridLayout.TopToBottom
columnSpacing: 0
rowSpacing: 0
Rectangle {
width: parent.width
height: 50
10 years ago
Layout.row: 0
Layout.fillWidth: true
Layout.preferredHeight: 50
id: headerView
Rectangle
{
gradient: Gradient {
GradientStop { position: 0.0; color: "#f1f1f1" }
GradientStop { position: 1.0; color: "#d9d7da" }
}
id: headerPaneContainer
10 years ago
anchors.fill: parent
TabView {
id: headerPaneTabs
tabsVisible: false
antialiasing: true
anchors.fill: parent
style: TabViewStyle {
frameOverlap: 1
tab: Rectangle {}
frame: Rectangle { color: "transparent" }
}
}
}
}
10 years ago
SplitView {
resizing: false
Layout.row: 1
orientation: Qt.Horizontal;
Layout.fillWidth: true
Layout.preferredHeight: root.height - headerView.height;
ProjectList {
id: projectList
width: 200
height: parent.height
Layout.minimumWidth: 200
}
10 years ago
Rectangle {
id: contentView
width: parent.width - projectList.width
height: parent.height
SplitView {
anchors.fill: parent
orientation: Qt.Vertical
CodeEditorView {
height: parent.height * 0.6
anchors.top: parent.top
Layout.fillWidth: true
Layout.fillHeight: true
}
WebPreview {
id: webPreview
height: parent.height * 0.4
Layout.fillWidth: true
}
}
10 years ago
}
Rectangle {
10 years ago
visible: false;
id: rightView;
10 years ago
Keys.onEscapePressed:
{
hide();
}
10 years ago
10 years ago
function show() {
visible = true;
contentView.width = parent.width - projectList.width - rightView.width;
}
10 years ago
function hide() {
visible = false;
contentView.width = parent.width - projectList.width;
10 years ago
}
10 years ago
height: parent.height;
width: 450
Layout.minimumWidth: 450
Rectangle {
10 years ago
anchors.fill: parent;
id: rightPaneView
TabView {
id: rightPaneTabs
tabsVisible: true
10 years ago
antialiasing: true
anchors.fill: parent
style: TabViewStyle {
frameOverlap: 1
tabBar:
Rectangle {
color: "#ededed"
id: background
}
tab: Rectangle {
color: "#ededed"
implicitWidth: 80
implicitHeight: 20
radius: 2
Text {
anchors.centerIn: parent
text: styleData.title
color: styleData.selected ? "#7da4cd" : "#202020"
}
}
frame: Rectangle {
}
}
}
}
}
}
}
10 years ago
}