diff --git a/src/kdefrontend/ExampleGrid.qml b/src/kdefrontend/ExampleGrid.qml new file mode 100644 index 000000000..ab8e2b9f6 --- /dev/null +++ b/src/kdefrontend/ExampleGrid.qml @@ -0,0 +1,87 @@ +import QtQuick 2.11 +import QtQuick.XmlListModel 2.0 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.5 + +GridView { + id: exampleGrid + Layout.fillHeight: true + Layout.fillWidth: true + cellWidth: width/4 + cellHeight: Math.min(height*0.9, 160) + ScrollBar.vertical: ScrollBar{} + clip: true + + model: helper.getExampleProjects(); + delegate: Rectangle { + id: exampleDelegate + property string name : modelData + width: exampleGrid.cellWidth - 5 + height: exampleGrid.cellHeight - 5 + + onHeightChanged: { + console.log("Example rect height changed: " + height) + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + //onEntered: {exampleDelegate.color = '#fdffbf'} + //onExited: {exampleDelegate.color = '#ffffff'} + onClicked: {mainWindow.openExampleProject(exampleDelegate.name)} + } + + ColumnLayout { + onHeightChanged: { + console.log("Example column height changed: " + height) + } + anchors.fill: parent + //Layout.fillHeight: true + //Layout.fillWidth: true + spacing: 5 + Image { + id: exampleImage + source: helper.getExampleProjectThumbnail(name) + fillMode: Image.Stretch + sourceSize.width: Math.min(120, exampleDelegate.width) + sourceSize.height: Math.min(100, exampleDelegate.height * 0.6) + Layout.alignment: Qt.AlignHCenter + } + + Text { + Layout.preferredWidth: parent.width + Layout.minimumWidth: parent.width + width: parent.width + Layout.preferredHeight: exampleDelegate.height * 0.15 + Layout.minimumHeight: exampleDelegate.height * 0.15 + height: exampleDelegate.height * 0.15 + wrapMode: Text.WordWrap + text: exampleDelegate.name + font.pixelSize: 14 + minimumPixelSize: 10 + fontSizeMode: Text.Fit + font.bold: true + Layout.fillWidth: true + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + + Text { + Layout.preferredWidth: parent.width + Layout.minimumWidth: parent.width + width: parent.width + Layout.preferredHeight: exampleDelegate.height * 0.25 + Layout.minimumHeight: exampleDelegate.height * 0.25 + height: exampleDelegate.height * 0.25 + wrapMode: Text.WordWrap + text: helper.getExampleProjectTags(exampleDelegate.name) + minimumPixelSize: 6 + font.pixelSize: 12 + fontSizeMode: Text.Fit + Layout.fillWidth: true + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + } + } + } +} diff --git a/src/kdefrontend/HelpList.qml b/src/kdefrontend/HelpList.qml new file mode 100644 index 000000000..827b93891 --- /dev/null +++ b/src/kdefrontend/HelpList.qml @@ -0,0 +1,75 @@ +import QtQuick 2.11 +import QtQuick.XmlListModel 2.0 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.5 + +ListView { + id: listView2 + width: parent.width + Layout.fillHeight: true + Layout.fillWidth: true + clip: true + ScrollBar.vertical: ScrollBar { } + model: ListModel { + ListElement { + name: "Documentation" + link: "https://docs.kde.org/trunk5/en/extragear-edu/labplot2/index.html" + } + + ListElement { + name: "FAQ" + link: "https://docs.kde.org/trunk5/en/extragear-edu/labplot2/faq.html" + } + + ListElement { + name: "Features" + link: "https://labplot.kde.org/features/" + } + + ListElement { + name: "Support" + link: "https://labplot.kde.org/support/" + } + } + delegate: Rectangle { + width: parent.width + height: 25 + RowLayout { + id: row3 + width: parent.width + height: parent.height + spacing: 10 + + Rectangle { + anchors.verticalCenter: parent.verticalCenter + width: 5 + height: 5 + color: "#7a7d82" + } + + Label { + height: parent.height + width: parent.width - 5 - parent.spacing + Layout.minimumWidth: parent.width - 5 - parent.spacing + Layout.preferredWidth: parent.width - 5 - parent.spacing + text: name + font.bold: true + font.pixelSize: 18 + minimumPixelSize: 1 + fontSizeMode: Text.Fit + + verticalAlignment: Text.AlignVCenter + horizontalAlignment: Text.AlignHCenter + //wrapMode: Text.WordWrap + } + } + + MouseArea { + anchors.fill: parent + hoverEnabled: true + onEntered: {parent.color = '#fdffbf' } + onExited: {parent.color = '#ffffff'} + onClicked: {Qt.openUrlExternally(link)} + } + } + }