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.

170 lines
3.0 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
function toggleRightView()
{
if (!rightView.visible)
rightView.show();
else
rightView.hide();
}
10 years ago
function ensureRightView()
{
if (!rightView.visible)
rightView.show();
}
function hideRightView()
{
if (rightView.visible)
rightView.hide();
}
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 {
width: parent.width * 0.2
height: parent.height
Layout.minimumWidth: 200
}
10 years ago
Rectangle {
anchors.top: parent.top
id: contentView
width: parent.width
height: parent.height
CodeEditorView {
height: parent.height
anchors.top: parent.top
width: parent.width
}
10 years ago
}
Rectangle {
10 years ago
visible: false;
id: rightView;
10 years ago
Keys.onEscapePressed:
{
hide();
}
10 years ago
10 years ago
property real panelRelWidth: 0.38
10 years ago
10 years ago
function show() {
visible = true;
contentView.width = parent.width * (1 - 0.38)
}
10 years ago
function hide() {
visible = false;
contentView.width = parent.width;
10 years ago
}
10 years ago
height: parent.height;
width: Layout.minimumWidth
Layout.minimumWidth: parent.width * 0.38
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
}