Warning, /education/labplot/src/kdefrontend/welcomescreen/main.qml is written in an unsupported language. File is not indexed.

0001 import QtQuick.Window 2.12
0002 import QtQuick 2.6
0003 import QtQuick.Controls 2.4
0004 import QtQuick.Scene2D 2.9
0005 import QtQuick.Controls.Universal 2.0
0006 import QtQuick.Extras 1.4
0007 import QtQuick.Layouts 1.3
0008 import QtWebView 1.1
0009 import QtWebEngine 1.8
0010 
0011 Rectangle {
0012     id: mainWindow
0013     width: 1920
0014     height: 1080
0015     property int spacing: 10
0016     visible: true
0017     property string currentCategory: ''
0018     property string currentSubcategory: ''
0019     property string currentDataset: ''
0020     property string initialUrl : "https://labplot.kde.org/2019/04/19/labplot-2-6-released/"
0021     property alias mainWindow: mainWindow
0022     signal  recentProjectClicked(url path)
0023     signal datasetClicked(string category, string subcategory, string dataset)
0024     signal openDataset()
0025     signal openExampleProject(string name)
0026 
0027     function restoreOriginalLayout() {
0028         console.log("Restore widget dimensions")
0029         recentProjectsFrame.widthRate = (mainWindow.width / 5 - 4*mainWindow.spacing)/ mainWindow.width
0030         recentProjectsFrame.heightRate = (mainWindow.height / 4 - 4*mainWindow.spacing)/ mainWindow.height
0031         exampleProjects.widthRate = (3 * mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width
0032         exampleProjects.heightRate =(mainWindow.height / 4 - 4*mainWindow.spacing) / mainWindow.height
0033         newsSection.widthRate = (mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width
0034         newsSection.heightRate = (mainWindow.height- 4*mainWindow.spacing) / mainWindow.height
0035         helpFrame.widthRate = (mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width
0036         helpFrame.heightRate = (mainWindow.height / 4 - 4*mainWindow.spacing) / mainWindow.height
0037         datasetFrame.widthRate = (3 * mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width
0038         datasetFrame.heightRate = (mainWindow.height / 4 - 4*mainWindow.spacing) / mainWindow.height
0039         releaseSection.widthRate = (4 * mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width
0040         releaseSection.heightRate = (2*mainWindow.height / 4 - 4*mainWindow.spacing) / mainWindow.height
0041     }
0042 
0043     function saveWidgetDimensions() {
0044         console.log("Save welcome screen widget dimensions")
0045 
0046         if(recentProjectsFrame.fullScreen)
0047             recentProjectsFrame.minimize()
0048 
0049         if(exampleProjects.fullScreen)
0050             exampleProjects.minimize()
0051 
0052         if(newsSection.fullScreen)
0053             newsSection.minimize()
0054 
0055         if(helpFrame.fullScreen)
0056             helpFrame.minimize()
0057 
0058         if(datasetFrame.fullScreen)
0059             datasetFrame.minimize()
0060 
0061         if(releaseSection.fullScreen)
0062             releaseSection.minimize()
0063 
0064         helper.setHeightScale(recentProjectsFrame.sectionName, recentProjectsFrame.heightRate)
0065         helper.setWidthScale(recentProjectsFrame.sectionName, recentProjectsFrame.widthRate)
0066         helper.setHeightScale(exampleProjects.sectionName, exampleProjects.heightRate)
0067         helper.setWidthScale(exampleProjects.sectionName, exampleProjects.widthRate)
0068         helper.setHeightScale(newsSection.sectionName, newsSection.heightRate)
0069         helper.setWidthScale(newsSection.sectionName, newsSection.widthRate)
0070         helper.setHeightScale(helpFrame.sectionName, helpFrame.heightRate)
0071         helper.setWidthScale(helpFrame.sectionName, helpFrame.widthRate)
0072         helper.setHeightScale(datasetFrame.sectionName, datasetFrame.heightRate)
0073         helper.setWidthScale(datasetFrame.sectionName, datasetFrame.widthRate)
0074         helper.setHeightScale(releaseSection.sectionName, releaseSection.heightRate)
0075         helper.setWidthScale(releaseSection.sectionName, releaseSection.widthRate)
0076     }
0077 
0078     function hideTiles() {
0079         recentProjectsFrame.visible = false
0080         recentProjectsFrame.z = 0
0081         exampleProjects.visible = false
0082         exampleProjects.z = 0
0083         newsSection.visible = false
0084         newsSection.z = 0
0085         helpFrame.visible = false
0086         helpFrame.z = 0
0087         datasetFrame.visible = false
0088         datasetFrame.z = 0
0089         releaseSection.visible = false
0090         releaseSection.z = 0
0091     }
0092 
0093     function showTiles() {
0094         recentProjectsFrame.visible = true
0095         recentProjectsFrame.z = 0
0096         exampleProjects.visible = true
0097         exampleProjects.z = 0
0098         newsSection.visible = true
0099         newsSection.z = 0
0100         helpFrame.visible = true
0101         helpFrame.z = 0
0102         datasetFrame.visible = true
0103         datasetFrame.z = 0
0104         releaseSection.visible = true
0105         releaseSection.z = 0
0106     }
0107 
0108     Connections {
0109         target: helper
0110         onDatasetFound:{
0111             datasetTitle.text = helper.datasetName()
0112             datasetDescription.text = helper.datasetDescription()
0113             datasetRows.text = helper.datasetRows()
0114             datasetColumns.text = helper.datasetColumns()
0115         }
0116         onDatasetNotFound:{
0117             datasetTitle.text = "-"
0118             datasetDescription.text = "-"
0119             datasetRows.text = "-"
0120             datasetColumns.text = "-";
0121         }
0122         onShowFirstDataset:{
0123             datasetClicked(mainWindow.currentCategory, mainWindow.currentSubcategory, mainWindow.currentDataset)
0124         }
0125     }
0126 
0127     Frame {
0128         id: recentProjectsFrame
0129         property string sectionName: "recentProjectsFrame"
0130         property double widthRate : helper.getWidthScale(sectionName) === -1 ? (mainWindow.width / 5 - 4*mainWindow.spacing) /  mainWindow.width : helper.getWidthScale(sectionName)
0131         property double heightRate : helper.getHeightScale(sectionName) === -1 ? (mainWindow.height / 4 - 4*mainWindow.spacing) /  mainWindow.height : helper.getHeightScale(sectionName)
0132         width: mainWindow.width * widthRate
0133         height: mainWindow.height * heightRate
0134         anchors.top: parent.top
0135         anchors.topMargin: mainWindow.spacing
0136         anchors.left: parent.left
0137         anchors.leftMargin: mainWindow.spacing
0138         visible: true
0139         opacity: 1
0140         padding: 5
0141         property bool fullScreen: false
0142         property double prevWidth: 0
0143         property double prevHeight: 0
0144 
0145         Component.onCompleted: {
0146             if(helper.getWidthScale(sectionName) === -1 || helper.getHeightScale(sectionName) === -1)
0147                 mainWindow.restoreOriginalLayout()
0148         }
0149 
0150         function maximize() {
0151             hideTiles()
0152             recentProjectsFrame.prevWidth = recentProjectsFrame.widthRate
0153             recentProjectsFrame.prevHeight = recentProjectsFrame.heightRate
0154             recentProjectsFrame.visible = true
0155             recentProjectsFrame.z = 1
0156             recentProjectsFrame.anchors.fill = undefined
0157             recentProjectsFrame.anchors.right = undefined
0158             recentProjectsFrame.anchors.bottom = undefined
0159             recentProjectsFrame.anchors.centerIn = undefined
0160             recentProjectsFrame.anchors.top = undefined
0161             recentProjectsFrame.anchors.left = undefined
0162             recentProjectsFrame.widthRate = 1
0163             recentProjectsFrame.heightRate = 1
0164             recentProjectsFrame.anchors.fill = mainWindow
0165         }
0166         function minimize() {
0167             recentProjectsFrame.anchors.fill = undefined
0168             recentProjectsFrame.anchors.right = undefined
0169             recentProjectsFrame.anchors.bottom = undefined
0170             recentProjectsFrame.anchors.centerIn = undefined
0171             recentProjectsFrame.anchors.top = undefined
0172             recentProjectsFrame.anchors.left = undefined
0173             recentProjectsFrame.anchors.top = mainWindow.top
0174             recentProjectsFrame.anchors.topMargin = mainWindow.spacing
0175             recentProjectsFrame.anchors.left = mainWindow.left
0176             recentProjectsFrame.anchors.leftMargin = mainWindow.spacing
0177             recentProjectsFrame.widthRate = recentProjectsFrame.prevWidth
0178             recentProjectsFrame.heightRate = recentProjectsFrame.prevHeight
0179 
0180             showTiles();
0181         }
0182 
0183         Rectangle {
0184             width: 3
0185             height: parent.height
0186             color: "gray"
0187             anchors.left: parent.right
0188             anchors.rightMargin: 0
0189             opacity: 0
0190 
0191             MouseArea {
0192                 anchors.fill: parent
0193                 hoverEnabled: true
0194                 onEntered: {parent.opacity = 1}
0195                 onExited: {
0196                     if(!drag.active && !pressed)
0197                         parent.opacity = 0
0198                 }
0199                 onPressed:parent.opacity = 1
0200                 onPressAndHold:parent.opacity = 1
0201                 onReleased: parent.opacity = 0
0202                 drag{ target: parent; axis: Drag.XAxis;}
0203                 onMouseXChanged: {
0204                     if(drag.active){
0205                         recentProjectsFrame.widthRate = (recentProjectsFrame.width + mouseX) / mainWindow.width
0206                         exampleProjects.widthRate = (exampleProjects.width - mouseX) / mainWindow.width
0207                         if(recentProjectsFrame.width < 150){
0208                             recentProjectsFrame.widthRate = 150 / mainWindow.width
0209                             exampleProjects.widthRate = (mainWindow.width - newsSection.width - 150 - 4*mainWindow.spacing) / mainWindow.width
0210                         }
0211                         if(exampleProjects.width < 300) {
0212                             exampleProjects.widthRate = 300 / mainWindow.width
0213                             recentProjectsFrame.widthRate = (mainWindow.width - newsSection.width - 300 - 4*mainWindow.spacing) / mainWindow.width
0214                         }
0215 
0216                     }
0217                 }
0218             }
0219         }
0220 
0221         Rectangle {
0222             height: 3
0223             width : parent.width
0224             color: "gray"
0225             anchors.top: parent.bottom
0226             anchors.bottomMargin: 0
0227             opacity: 0
0228 
0229             MouseArea {
0230                 anchors.fill: parent
0231                 hoverEnabled: true
0232                 onEntered: {parent.opacity = 1}
0233                 onExited: {
0234                     if(!drag.active && !pressed)
0235                         parent.opacity = 0
0236                 }
0237                 onPressed:parent.opacity = 1
0238                 onPressAndHold:parent.opacity = 1
0239                 onReleased: parent.opacity = 0
0240                 drag{ target: parent; axis: Drag.YAxis }
0241                 onMouseYChanged: {
0242                     if(drag.active){
0243                         recentProjectsFrame.heightRate = (recentProjectsFrame.height + mouseY) / mainWindow.height
0244                         exampleProjects.heightRate = (exampleProjects.height + mouseY) / mainWindow.height
0245                         helpFrame.heightRate = (helpFrame.height - mouseY) / mainWindow.height
0246                         datasetFrame.heightRate = (datasetFrame.height - mouseY) / mainWindow.height
0247                         if(recentProjectsFrame.height < 100 || exampleProjects.height < 100) {
0248                             recentProjectsFrame.heightRate = 100 / mainWindow.height
0249                             exampleProjects.heightRate = 100 / mainWindow.height
0250                             helpFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0251                             datasetFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0252                         }
0253                         if(helpFrame.height < 100 || datasetFrame.height < 100) {
0254                             helpFrame.heightRate = 100 / mainWindow.height
0255                             datasetFrame.heightRate = 100 / mainWindow.height
0256                             recentProjectsFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0257                             exampleProjects.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0258                         }
0259                     }
0260                 }
0261             }
0262 
0263         }
0264 
0265         ColumnLayout {
0266             anchors.fill: parent
0267             spacing: 20
0268             clip: true
0269 
0270             RowLayout {
0271                 Layout.fillWidth: true
0272                 Layout.minimumHeight: Math.min(parent.height*0.2, 100)
0273                 Layout.preferredHeight: Math.min(parent.height*0.2, 100)
0274 
0275                 Image {
0276                     Layout.preferredHeight: recentProjectsFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0277                     Layout.minimumHeight: recentProjectsFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0278                     Layout.preferredWidth: recentProjectsFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0279                     Layout.minimumWidth: recentProjectsFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0280                     Layout.alignment: Qt.AlignVCenter
0281 
0282                     source: recentProjectsFrame.fullScreen ? helper.getMinIcon() : helper.getMaxIcon()
0283                     sourceSize.width: recentProjectsFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0284                     sourceSize.height: recentProjectsFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0285 
0286 
0287                     MouseArea {
0288                         anchors.fill: parent
0289 
0290                         onClicked: {
0291                             if(!recentProjectsFrame.fullScreen)
0292                                 recentProjectsFrame.maximize()
0293                             else
0294                                 recentProjectsFrame.minimize()
0295 
0296                             recentProjectsFrame.fullScreen = !recentProjectsFrame.fullScreen
0297                         }
0298                     }
0299                 }
0300 
0301 
0302                 Label {
0303                     color: "#000000"
0304                     text: qsTr("Recent Projects")
0305                     styleColor: "#979191"
0306                     opacity: 1
0307                     visible: true
0308                     font.underline: false
0309                     font.italic: false
0310                     font.bold: false
0311                     verticalAlignment: Text.AlignVCenter
0312                     horizontalAlignment: Text.AlignHCenter
0313                     font.pointSize: recentProjectsFrame.fullScreen ? 60 : 24
0314                     minimumPointSize: 10
0315                     fontSizeMode: Text.Fit
0316                     Layout.fillWidth: true
0317                     Layout.fillHeight: true
0318                     wrapMode: Text.WordWrap
0319                 }
0320             }
0321 
0322             RecentProjects {
0323                 id: recentProjectsList
0324                 model:recentProjects
0325                 Layout.fillHeight: true
0326                 Layout.fillWidth: true
0327                 Layout.minimumHeight: parent.height*0.8
0328                 Layout.preferredHeight: parent.height*0.8
0329                 clip: true
0330             }
0331         }
0332     }
0333 
0334     Frame {
0335         id: exampleProjects
0336         property string sectionName: "exampleProjects"
0337         property double widthRate : helper.getWidthScale(sectionName) === -1 ? (3 * mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width : helper.getWidthScale(sectionName)
0338         property double heightRate : helper.getHeightScale(sectionName) === -1 ? (mainWindow.height / 4 - 4*mainWindow.spacing) / mainWindow.height : helper.getHeightScale(sectionName)
0339         width: mainWindow.width * widthRate
0340         height: mainWindow.height * heightRate
0341         anchors.top: parent.top
0342         anchors.topMargin: mainWindow.spacing
0343         anchors.left: recentProjectsFrame.right
0344         anchors.leftMargin: mainWindow.spacing
0345         anchors.right: newsSection.left
0346         anchors.rightMargin: mainWindow.spacing
0347         visible: true
0348         clip: true
0349         opacity: 1
0350         padding: 5
0351 
0352         property bool fullScreen: false
0353         property double prevWidth: 0
0354         property double prevHeight: 0
0355 
0356         Component.onCompleted: {
0357             if(helper.getWidthScale(sectionName) === -1 || helper.getHeightScale(sectionName) === -1)
0358                 mainWindow.restoreOriginalLayout()
0359         }
0360 
0361         function maximize() {
0362             hideTiles()
0363             exampleProjects.prevWidth = exampleProjects.widthRate
0364             exampleProjects.prevHeight = exampleProjects.heightRate
0365             exampleProjects.visible = true
0366             exampleProjects.z = 1
0367             exampleProjects.anchors.fill = undefined
0368             exampleProjects.anchors.right = undefined
0369             exampleProjects.anchors.bottom = undefined
0370             exampleProjects.anchors.centerIn = undefined
0371             exampleProjects.anchors.top = undefined
0372             exampleProjects.anchors.left = undefined
0373 
0374             exampleProjects.widthRate = 1
0375             exampleProjects.heightRate = 1
0376 
0377             exampleProjects.anchors.fill = mainWindow
0378         }
0379 
0380         function minimize() {
0381             exampleProjects.anchors.fill = undefined
0382             exampleProjects.anchors.right = undefined
0383             exampleProjects.anchors.bottom = undefined
0384             exampleProjects.anchors.centerIn = undefined
0385             exampleProjects.anchors.top = undefined
0386             exampleProjects.anchors.left = undefined
0387 
0388             exampleProjects.anchors.top = mainWindow.top
0389             exampleProjects.anchors.topMargin = mainWindow.spacing
0390             exampleProjects.anchors.left = recentProjectsFrame.right
0391             exampleProjects.anchors.leftMargin = mainWindow.spacing
0392             exampleProjects.anchors.right = newsSection.left
0393             exampleProjects.anchors.rightMargin = mainWindow.spacing
0394             exampleProjects.widthRate = exampleProjects.prevWidth
0395             exampleProjects.heightRate = exampleProjects.prevHeight
0396 
0397             showTiles();
0398         }
0399 
0400         Rectangle {
0401             width: 3
0402             height: parent.height
0403             color: "gray"
0404             anchors.left: parent.right
0405             anchors.rightMargin: 0
0406             opacity: 0
0407 
0408             MouseArea {
0409                 anchors.fill: parent
0410                 hoverEnabled: true
0411                 onEntered: {parent.opacity = 1}
0412                 onExited: {
0413                     if(!drag.active && !pressed)
0414                         parent.opacity = 0
0415                 }
0416                 onPressed:parent.opacity = 1
0417                 onPressAndHold:parent.opacity = 1
0418                 onReleased: parent.opacity = 0
0419                 drag{ target: parent; axis: Drag.XAxis }
0420                 onMouseXChanged: {
0421                     if(drag.active){
0422                         newsSection.widthRate = (newsSection.width - mouseX) / mainWindow.width
0423                         exampleProjects.widthRate = (exampleProjects.width + mouseX) / mainWindow.width
0424                         datasetFrame.widthRate = (datasetFrame.width + mouseX) / mainWindow.width
0425                         releaseSection.widthRate = (releaseSection.width + mouseX) / mainWindow.width
0426                         if(exampleProjects.width < 300
0427                                 || datasetFrame.width < 300){
0428 
0429 
0430                             newsSection.widthRate = (mainWindow.width - Math.max(recentProjectsFrame.width, helpFrame.width) - 300 - 4*mainWindow.spacing) / mainWindow.width
0431                             exampleProjects.widthRate = (mainWindow.width - newsSection.width - recentProjectsFrame.width - 4*mainWindow.spacing) / mainWindow.width
0432                             datasetFrame.widthRate = (mainWindow.width - newsSection.width - helpFrame.width - 4*mainWindow.spacing) / mainWindow.width
0433                             releaseSection.widthRate = (Math.max(recentProjectsFrame.width, helpFrame.width) + mainWindow.spacing + 300) / mainWindow.width
0434 
0435                         }
0436                         if(newsSection.width < 150) {
0437                             newsSection.widthRate = 150 / mainWindow.width
0438                             exampleProjects.widthRate = (mainWindow.width - recentProjectsFrame.width - 150 - 4*mainWindow.spacing) / mainWindow.width
0439                             datasetFrame.widthRate =(mainWindow.width - helpFrame.width - 150 - 4*mainWindow.spacing) / mainWindow.width
0440                             releaseSection.widthRate = (mainWindow.width - newsSection.width - 3*mainWindow.spacing) / mainWindow.width
0441                         }
0442 
0443                     }
0444                 }
0445             }
0446         }
0447 
0448         Rectangle {
0449             height: 3
0450             width : parent.width
0451             color: "gray"
0452             anchors.top: parent.bottom
0453             anchors.bottomMargin: 0
0454             opacity: 0
0455 
0456             MouseArea {
0457                 anchors.fill: parent
0458                 hoverEnabled: true
0459                 onEntered: {parent.opacity = 1}
0460                 onExited: {
0461                     if(!drag.active && !pressed)
0462                         parent.opacity = 0
0463                 }
0464                 onPressed:parent.opacity = 1
0465                 onPressAndHold:parent.opacity = 1
0466                 onReleased: parent.opacity = 0
0467                 drag{ target: parent; axis: Drag.YAxis }
0468                 onMouseYChanged: {
0469                     if(drag.active){
0470                         recentProjectsFrame.heightRate = (recentProjectsFrame.height + mouseY) / mainWindow.height
0471                         exampleProjects.heightRate = (exampleProjects.height + mouseY) / mainWindow.height
0472                         helpFrame.heightRate = (helpFrame.height - mouseY) / mainWindow.height
0473                         datasetFrame.heightRate = (datasetFrame.height - mouseY) / mainWindow.height
0474                         if(recentProjectsFrame.height < 100 || exampleProjects.height < 100) {
0475                             recentProjectsFrame.heightRate = 100 / mainWindow.height
0476                             exampleProjects.heightRate = 100/ mainWindow.height
0477                             helpFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0478                             datasetFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0479                         }
0480                         if(helpFrame.height < 100 || datasetFrame.height < 100) {
0481                             helpFrame.heightRate = 100 / mainWindow.height
0482                             datasetFrame.heightRate = 100 / mainWindow.height
0483                             recentProjectsFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0484                             exampleProjects.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing)/ mainWindow.height
0485                         }
0486                     }
0487                 }
0488             }
0489         }
0490 
0491         Rectangle {
0492             width: 3
0493             height: parent.height
0494             color: "gray"
0495             anchors.right: parent.left
0496             anchors.leftMargin: 0
0497             opacity: 0
0498 
0499             MouseArea {
0500                 anchors.fill: parent
0501                 hoverEnabled: true
0502                 onEntered: {parent.opacity = 1}
0503                 onExited: {
0504                     if(!drag.active && !pressed)
0505                         parent.opacity = 0
0506                 }
0507                 onPressed:parent.opacity = 1
0508                 onPressAndHold:parent.opacity = 1
0509                 onReleased: parent.opacity = 0
0510                 drag{ target: parent; axis: Drag.XAxis }
0511                 onMouseXChanged: {
0512                     if(drag.active){
0513                         exampleProjects.widthRate = (exampleProjects.width - mouseX)/ mainWindow.width
0514                         recentProjectsFrame.widthRate = (recentProjectsFrame.width + mouseX) / mainWindow.width
0515                         if(recentProjectsFrame.width < 150){
0516                             recentProjectsFrame.widthRate = 150 / mainWindow.width
0517                             exampleProjects.widthRate = (mainWindow.width - newsSection.width - 150 - 4*mainWindow.spacing) / mainWindow.width
0518                         }
0519                         if(exampleProjects.width < 300) {
0520                             exampleProjects.widthRate = 300/ mainWindow.width
0521                             recentProjectsFrame.widthRate = (mainWindow.width - newsSection.width - 300 - 4*mainWindow.spacing) / mainWindow.width
0522                         }
0523 
0524                     }
0525                 }
0526             }
0527         }
0528 
0529         ColumnLayout {
0530             anchors.fill: parent
0531             clip: true
0532             spacing: 5
0533 
0534             RowLayout {
0535                 Layout.fillWidth: true
0536                 Layout.minimumHeight: Math.min((parent.height - 25 - 2*parent.spacing)*0.2, 100)
0537                 Layout.preferredHeight: Math.min((parent.height - 25 - 2*parent.spacing)*0.2, 100)
0538 
0539                 Image {
0540                     Layout.preferredHeight: exampleProjects.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0541                     Layout.minimumHeight: exampleProjects.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0542                     Layout.preferredWidth: exampleProjects.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0543                     Layout.minimumWidth: exampleProjects.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0544                     Layout.alignment: Qt.AlignVCenter
0545 
0546                     source: exampleProjects.fullScreen ? helper.getMinIcon() : helper.getMaxIcon()
0547                     sourceSize.width: exampleProjects.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0548                     sourceSize.height: exampleProjects.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0549 
0550 
0551                     MouseArea {
0552                         anchors.fill: parent
0553 
0554                         onClicked: {
0555                             if(!exampleProjects.fullScreen) {
0556                                 exampleProjects.maximize()
0557                             } else {
0558                                 exampleProjects.minimize()
0559                             }
0560 
0561                             exampleProjects.fullScreen = !exampleProjects.fullScreen
0562                         }
0563                     }
0564                 }
0565 
0566 
0567                 Label {
0568                     text: qsTr("Examples")
0569                     styleColor: "#d41919"
0570 
0571                     verticalAlignment: Text.AlignVCenter
0572                     horizontalAlignment: Text.AlignHCenter
0573                     font.pointSize: exampleProjects.fullScreen ? 60 : 24
0574                     minimumPointSize: 10
0575                     fontSizeMode: Text.Fit
0576                     Layout.fillWidth: true
0577                     Layout.fillHeight: true
0578                     wrapMode: Text.WordWrap
0579                 }
0580             }
0581 
0582             TextField {
0583                 id: searchText
0584                 placeholderText: "Search among example projects"
0585                 Layout.fillWidth: true;
0586                 onTextChanged: {exampleGrid.model = helper.searchExampleProjects(searchText.text)}
0587                 height: 25
0588                 Layout.minimumHeight: 25
0589                 Layout.preferredHeight: 25
0590             }
0591 
0592             ExampleGrid {
0593                 id: exampleGrid
0594                 Layout.fillHeight: true
0595                 Layout.fillWidth: true
0596                 clip:true
0597 
0598                 Layout.minimumHeight: Math.max((parent.height - 25 - 2*parent.spacing)*0.8, parent.height - 25 - 100  - 2*parent.spacing)
0599                 Layout.preferredHeight: Math.max((parent.height - 25 - 2*parent.spacing)*0.8, parent.height - 25 - 100  - 2*parent.spacing)
0600             }
0601         }
0602     }
0603 
0604     Frame {
0605         id: newsSection
0606         property string sectionName: "newsSection"
0607         property double widthRate : helper.getWidthScale(sectionName) === -1 ? (mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width : helper.getWidthScale(sectionName)
0608         property double heightRate : helper.getHeightScale(sectionName) === -1 ? (mainWindow.height- 4*mainWindow.spacing) / mainWindow.height : helper.getHeightScale(sectionName)
0609         width: mainWindow.width * widthRate
0610         height: mainWindow.height * heightRate
0611 
0612         anchors.bottom: parent.bottom
0613         anchors.bottomMargin: mainWindow.spacing
0614         anchors.right: parent.right
0615         anchors.rightMargin: mainWindow.spacing
0616         anchors.top: parent.top
0617         anchors.topMargin: mainWindow.spacing
0618         visible: true
0619         opacity: 1
0620         padding: 5
0621         clip: true
0622 
0623         property bool fullScreen: false
0624         property double prevWidth: 0
0625         property double prevHeight: 0
0626 
0627         Component.onCompleted: {
0628             if(helper.getWidthScale(sectionName) === -1 || helper.getHeightScale(sectionName) === -1)
0629                 mainWindow.restoreOriginalLayout()
0630         }
0631 
0632         function maximize() {
0633             hideTiles()
0634             newsSection.prevWidth = newsSection.widthRate
0635             newsSection.prevHeight = newsSection.heightRate
0636             newsSection.visible = true
0637             newsSection.z = 1
0638             newsSection.anchors.fill = undefined
0639             newsSection.anchors.right = undefined
0640             newsSection.anchors.bottom = undefined
0641             newsSection.anchors.centerIn = undefined
0642             newsSection.anchors.top = undefined
0643             newsSection.anchors.left = undefined
0644             newsSection.widthRate = 1
0645             newsSection.heightRate = 1
0646 
0647             newsSection.anchors.fill = mainWindow
0648         }
0649 
0650         function minimize() {
0651             newsSection.anchors.fill = undefined
0652             newsSection.anchors.right = undefined
0653             newsSection.anchors.bottom = undefined
0654             newsSection.anchors.centerIn = undefined
0655             newsSection.anchors.top = undefined
0656             newsSection.anchors.left = undefined
0657 
0658             newsSection.anchors.top = mainWindow.top
0659             newsSection.anchors.topMargin = mainWindow.spacing
0660             newsSection.anchors.right = mainWindow.right
0661             newsSection.anchors.rightMargin = mainWindow.spacing
0662             newsSection.anchors.bottom = mainWindow.bottom
0663             newsSection.anchors.bottomMargin = mainWindow.spacing
0664             newsSection.widthRate = newsSection.prevWidth
0665             newsSection.heightRate = newsSection.prevHeight
0666 
0667             showTiles();
0668         }
0669 
0670         Rectangle {
0671             width: 3
0672             height: parent.height
0673             color: "gray"
0674             anchors.right: parent.left
0675             anchors.leftMargin: 0
0676             opacity: 0
0677 
0678             MouseArea {
0679                 anchors.fill: parent
0680                 hoverEnabled: true
0681                 onEntered: {parent.opacity = 1}
0682                 onExited: {
0683                     if(!drag.active && !pressed)
0684                         parent.opacity = 0
0685                 }
0686                 onPressed:parent.opacity = 1
0687                 onPressAndHold:parent.opacity = 1
0688                 onReleased: parent.opacity = 0
0689                 drag{ target: parent; axis: Drag.XAxis }
0690                 onMouseXChanged: {
0691                     if(drag.active){
0692                         newsSection.widthRate = (newsSection.width - mouseX) / mainWindow.width
0693                         exampleProjects.widthRate = (exampleProjects.width + mouseX) / mainWindow.width
0694                         datasetFrame.widthRate = (datasetFrame.width + mouseX) / mainWindow.width
0695                         releaseSection.widthRate = (releaseSection.width + mouseX) / mainWindow.width
0696                         if(exampleProjects.width < 300
0697                                 || datasetFrame.width < 300){
0698                             newsSection.widthRate = (mainWindow.width - Math.max(recentProjectsFrame.width, helpFrame.width) - 300 - 4*mainWindow.spacing) / mainWindow.width
0699                             exampleProjects.widthRate = (mainWindow.width - newsSection.width - recentProjectsFrame.width - 4*mainWindow.spacing)/ mainWindow.width
0700                             datasetFrame.widthRate = (mainWindow.width - newsSection.width - helpFrame.width - 4*mainWindow.spacing) / mainWindow.width
0701                             releaseSection.widthRate = (Math.max(recentProjectsFrame.width, helpFrame.width) + mainWindow.spacing + 300) / mainWindow.width
0702 
0703                         }
0704                         if(newsSection.width < 150) {
0705                             newsSection.widthRate = 150 / mainWindow.width
0706                             exampleProjects.widthRate = (mainWindow.width - recentProjectsFrame.width - 150 - 4*mainWindow.spacing) / mainWindow.width
0707                             datasetFrame.widthRate = (mainWindow.width - helpFrame.width - 150 - 4*mainWindow.spacing) / mainWindow.width
0708                             releaseSection.widthRate = (mainWindow.width - newsSection.width - 3*mainWindow.spacing) / mainWindow.width
0709                         }
0710 
0711                     }
0712                 }
0713             }
0714         }
0715 
0716         ColumnLayout {
0717             anchors.fill: parent
0718 
0719             RowLayout {
0720                 Layout.fillWidth: true
0721                 Layout.minimumHeight: Math.min(parent.height*0.2, 100)
0722                 Layout.preferredHeight: Math.min(parent.height*0.2, 100)
0723 
0724                 Image {
0725                     Layout.preferredHeight: newsSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0726                     Layout.minimumHeight: newsSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0727                     Layout.preferredWidth: newsSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0728                     Layout.minimumWidth:newsSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0729                     Layout.alignment: Qt.AlignVCenter
0730 
0731                     source: newsSection.fullScreen ? helper.getMinIcon() : helper.getMaxIcon()
0732                     sourceSize.width: newsSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0733                     sourceSize.height: newsSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0734 
0735 
0736                     MouseArea {
0737                         anchors.fill: parent
0738 
0739                         onClicked: {
0740                             if(!newsSection.fullScreen)
0741                                 newsSection.maximize()
0742                             else
0743                                 newsSection.minimize()
0744 
0745                             newsSection.fullScreen = !newsSection.fullScreen
0746                         }
0747                     }
0748                 }
0749 
0750                 Label {
0751                     id: label2
0752                     text: qsTr("News")
0753 
0754                     verticalAlignment: Text.AlignVCenter
0755                     horizontalAlignment: Text.AlignHCenter
0756                     font.pointSize: newsSection.fullScreen ? 60 : 24
0757                     minimumPointSize: 10
0758                     fontSizeMode: Text.Fit
0759                     Layout.fillWidth: true
0760                     Layout.fillHeight: true
0761                     wrapMode: Text.WordWrap
0762                 }
0763             }
0764 
0765             RssNews{
0766                 id:newsFeed
0767                 Layout.fillHeight: true
0768                 Layout.minimumHeight: Math.min(parent.height * 0.8, parent.height - 100)
0769             }
0770 
0771         }
0772 
0773     }
0774 
0775     Frame {
0776         id: helpFrame
0777         property string sectionName: "helpFrame"
0778         property double widthRate : helper.getWidthScale(sectionName) === -1 ? (mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width : helper.getWidthScale(sectionName)
0779         property double heightRate : helper.getHeightScale(sectionName) === -1 ? (mainWindow.height / 4 - 4*mainWindow.spacing) / mainWindow.height : helper.getHeightScale(sectionName)
0780         width: mainWindow.width * widthRate
0781         height: mainWindow.height * heightRate
0782 
0783         anchors.top: recentProjectsFrame.bottom
0784         anchors.topMargin: mainWindow.spacing
0785         anchors.left: parent.left
0786         anchors.leftMargin: mainWindow.spacing
0787         anchors.bottom: releaseSection.top
0788         anchors.bottomMargin: mainWindow.spacing
0789         visible: true
0790         opacity: 1
0791         padding: 5
0792         clip: true
0793 
0794         property bool fullScreen: false
0795         property double prevWidth: 0
0796         property double prevHeight: 0
0797 
0798         Component.onCompleted: {
0799             if(helper.getWidthScale(sectionName) === -1 || helper.getHeightScale(sectionName) === -1)
0800                 mainWindow.restoreOriginalLayout()
0801         }
0802 
0803         function maximize() {
0804             hideTiles()
0805             helpFrame.prevWidth = helpFrame.widthRate
0806             helpFrame.prevHeight = helpFrame.heightRate
0807             helpFrame.visible = true
0808             helpFrame.z = 1
0809             helpFrame.anchors.fill = undefined
0810             helpFrame.anchors.right = undefined
0811             helpFrame.anchors.bottom = undefined
0812             helpFrame.anchors.centerIn = undefined
0813             helpFrame.anchors.top = undefined
0814             helpFrame.anchors.left = undefined
0815 
0816             helpFrame.heightRate = 1
0817             helpFrame.widthRate = 1
0818             helpFrame.anchors.fill = mainWindow
0819         }
0820 
0821         function minimize(){
0822             helpFrame.anchors.fill = undefined
0823             helpFrame.anchors.right = undefined
0824             helpFrame.anchors.bottom = undefined
0825             helpFrame.anchors.centerIn = undefined
0826             helpFrame.anchors.top = undefined
0827             helpFrame.anchors.left = undefined
0828 
0829             helpFrame.anchors.top = recentProjectsFrame.bottom
0830             helpFrame.anchors.topMargin = mainWindow.spacing
0831             helpFrame.anchors.left = mainWindow.left
0832             helpFrame.anchors.leftMargin = mainWindow.spacing
0833             helpFrame.anchors.bottom = releaseSection.top
0834             helpFrame.anchors.bottomMargin = mainWindow.spacing
0835             helpFrame.widthRate = helpFrame.prevWidth
0836             helpFrame.heightRate = helpFrame.prevHeight
0837 
0838             showTiles();
0839         }
0840 
0841         Rectangle {
0842             width: 3
0843             height: parent.height
0844             color: "gray"
0845             anchors.left: parent.right
0846             anchors.rightMargin: 0
0847             opacity: 0
0848 
0849             MouseArea {
0850                 anchors.fill: parent
0851                 hoverEnabled: true
0852                 onEntered: {parent.opacity = 1}
0853                 onExited: {
0854                     if(!drag.active && !pressed)
0855                         parent.opacity = 0
0856                 }
0857                 onPressed:parent.opacity = 1
0858                 onPressAndHold:parent.opacity = 1
0859                 onReleased: parent.opacity = 0
0860                 drag{ target: parent; axis: Drag.XAxis }
0861                 onMouseXChanged: {
0862                     if(drag.active){
0863                         helpFrame.widthRate = (helpFrame.width + mouseX) / mainWindow.width
0864                         datasetFrame.widthRate = (datasetFrame.width - mouseX) / mainWindow.width
0865                         if(helpFrame.width < 150){
0866                             helpFrame.widthRate = 150 / mainWindow.width
0867                             datasetFrame.widthRate = (mainWindow.width - newsSection.width - 150 - 4*mainWindow.spacing) / mainWindow.width
0868                         }
0869                         if(datasetFrame.width < 150) {
0870                             datasetFrame.widthRate = 150 / mainWindow.width
0871                             helpFrame.widthRate = (mainWindow.width - newsSection.width - 150 - 4*mainWindow.spacing) / mainWindow.width
0872                         }
0873                     }
0874                 }
0875             }
0876 
0877         }
0878 
0879         Rectangle {
0880             height: 3
0881             width : parent.width
0882             color: "gray"
0883             anchors.top: parent.bottom
0884             anchors.bottomMargin: 0
0885             opacity: 0
0886 
0887             MouseArea {
0888                 anchors.fill: parent
0889                 hoverEnabled: true
0890                 onEntered: {parent.opacity = 1}
0891                 onExited: {
0892                     if(!drag.active && !pressed)
0893                         parent.opacity = 0
0894                 }
0895                 onPressed:parent.opacity = 1
0896                 onPressAndHold:parent.opacity = 1
0897                 onReleased: parent.opacity = 0
0898                 drag{ target: parent; axis: Drag.YAxis }
0899                 onMouseYChanged: {
0900                     if(drag.active){
0901                         helpFrame.heightRate = (helpFrame.height + mouseY) / mainWindow.height
0902                         datasetFrame.heightRate = (datasetFrame.height + mouseY) / mainWindow.height
0903                         releaseSection.heightRate = (releaseSection.height - mouseY) / mainWindow.height
0904                         if(releaseSection.height < 100) {
0905                             releaseSection.heightRate = 100 / mainWindow.height
0906                             helpFrame.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0907                             datasetFrame.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0908                         }
0909                         if(helpFrame.height < 100 || datasetFrame.height < 100) {
0910                             helpFrame.heightRate = 100 / mainWindow.height
0911                             datasetFrame.heightRate = 100 / mainWindow.height
0912                             releaseSection.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0913                         }
0914                     }
0915                 }
0916             }
0917 
0918         }
0919 
0920         Rectangle {
0921             height: 3
0922             width : parent.width
0923             color: "gray"
0924             anchors.bottom: parent.top
0925             anchors.bottomMargin: 0
0926             opacity: 0
0927 
0928             MouseArea {
0929                 anchors.fill: parent
0930                 hoverEnabled: true
0931                 onEntered: {parent.opacity = 1}
0932                 onExited: {
0933                     if(!drag.active && !pressed)
0934                         parent.opacity = 0
0935                 }
0936                 onPressed:parent.opacity = 1
0937                 onPressAndHold:parent.opacity = 1
0938                 onReleased: parent.opacity = 0
0939                 drag{ target: parent; axis: Drag.YAxis }
0940                 onMouseYChanged: {
0941                     if(drag.active){
0942                         recentProjectsFrame.heightRate = (recentProjectsFrame.height + mouseY) / mainWindow.height
0943                         exampleProjects.heightRate =(exampleProjects.height + mouseY) / mainWindow.height
0944                         helpFrame.heightRate = (helpFrame.height - mouseY)  / mainWindow.height
0945                         datasetFrame.heightRate = (datasetFrame.height - mouseY) / mainWindow.height
0946                         if(recentProjectsFrame.height < 100 || exampleProjects.height < 100) {
0947                             recentProjectsFrame.heightRate = 100 /  mainWindow.height
0948                             exampleProjects.heightRate = 100/ mainWindow.height
0949                             helpFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing)  / mainWindow.height
0950                             datasetFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0951                         }
0952                         if(helpFrame.height < 100 || datasetFrame.height < 100) {
0953                             helpFrame.heightRate = 100 / mainWindow.height
0954                             datasetFrame.heightRate = 100 / mainWindow.height
0955                             recentProjectsFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) /  mainWindow.height
0956                             exampleProjects.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
0957                         }
0958                     }
0959                 }
0960             }
0961         }
0962 
0963         ColumnLayout {
0964             anchors.fill: parent
0965             spacing: 20
0966             clip: true
0967 
0968             RowLayout {
0969                 Layout.fillWidth: true
0970                 Layout.minimumHeight: Math.min((parent.height - parent.spacing) *0.2, 100)
0971                 Layout.preferredHeight: Math.min((parent.height - parent.spacing) *0.2, 100)
0972 
0973                 Image {
0974                     Layout.preferredHeight: helpFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0975                     Layout.minimumHeight: helpFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0976                     Layout.preferredWidth: helpFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0977                     Layout.minimumWidth: helpFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0978                     Layout.alignment: Qt.AlignVCenter
0979 
0980                     source: helpFrame.fullScreen ? helper.getMinIcon() : helper.getMaxIcon()
0981                     sourceSize.width: helpFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0982                     sourceSize.height: helpFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
0983 
0984 
0985                     MouseArea {
0986                         anchors.fill: parent
0987 
0988                         onClicked: {
0989                             if(!helpFrame.fullScreen)
0990                                 helpFrame.maximize()
0991                             else
0992                                 helpFrame.minimize()
0993 
0994                             helpFrame.fullScreen = !helpFrame.fullScreen
0995                         }
0996                     }
0997                 }
0998 
0999                 Label {
1000                     text: qsTr("Help")
1001 
1002                     verticalAlignment: Text.AlignVCenter
1003                     horizontalAlignment: Text.AlignHCenter
1004                     font.pointSize: helpFrame.fullScreen ? 60 : 24
1005                     minimumPointSize: 10
1006                     fontSizeMode: Text.Fit
1007                     Layout.fillWidth: true
1008                     Layout.fillHeight: true
1009                     wrapMode: Text.WordWrap
1010                 }
1011             }
1012 
1013             HelpList {
1014                 id: helpList
1015                 width: parent.width
1016                 Layout.minimumHeight: Math.max((parent.height - parent.spacing) *0.8, parent.height - parent.spacing - 100)
1017                 Layout.fillHeight: true
1018                 Layout.fillWidth: true
1019                 clip: true
1020             }
1021         }
1022     }
1023 
1024     Frame {
1025         id: datasetFrame
1026         property string sectionName: "datasetFrame"
1027         property double widthRate : helper.getWidthScale(sectionName) === -1 ? (3 * mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width : helper.getWidthScale(sectionName)
1028         property double heightRate : helper.getHeightScale(sectionName) === -1 ? (mainWindow.height / 4 - 4*mainWindow.spacing) / mainWindow.height : helper.getHeightScale(sectionName)
1029         width: mainWindow.width * widthRate
1030         height: mainWindow.height * heightRate
1031 
1032         anchors.top: exampleProjects.bottom
1033         anchors.topMargin: mainWindow.spacing
1034         anchors.left: helpFrame.right
1035         anchors.leftMargin: mainWindow.spacing
1036         anchors.right: newsSection.left
1037         anchors.rightMargin: mainWindow.spacing
1038         anchors.bottom: releaseSection.top
1039         anchors.bottomMargin: mainWindow.spacing
1040         visible: true
1041         opacity: 1
1042         padding: 5
1043         clip: true
1044 
1045         function maximize() {
1046             hideTiles()
1047             datasetFrame.prevWidth = datasetFrame.widthRate
1048             datasetFrame.prevHeight = datasetFrame.heightRate
1049             datasetFrame.visible = true
1050             datasetFrame.z = 1
1051             datasetFrame.anchors.fill = undefined
1052             datasetFrame.anchors.right = undefined
1053             datasetFrame.anchors.bottom = undefined
1054             datasetFrame.anchors.centerIn = undefined
1055             datasetFrame.anchors.top = undefined
1056             datasetFrame.anchors.left = undefined
1057 
1058             datasetFrame.widthRate = 1
1059             datasetFrame.heightRate = 1
1060             datasetFrame.anchors.fill = mainWindow
1061         }
1062 
1063         function minimize() {
1064             datasetFrame.anchors.fill = undefined
1065             datasetFrame.anchors.right = undefined
1066             datasetFrame.anchors.bottom = undefined
1067             datasetFrame.anchors.centerIn = undefined
1068             datasetFrame.anchors.top = undefined
1069             datasetFrame.anchors.left = undefined
1070 
1071             datasetFrame.anchors.top = exampleProjects.bottom
1072             datasetFrame.anchors.topMargin = mainWindow.spacing
1073             datasetFrame.anchors.left = helpFrame.right
1074             datasetFrame.anchors.leftMargin = mainWindow.spacing
1075             datasetFrame.anchors.bottom = releaseSection.top
1076             datasetFrame.anchors.bottomMargin = mainWindow.spacing
1077             datasetFrame.anchors.right = newsSection.left
1078             datasetFrame.anchors.rightMargin = mainWindow.spacing
1079             datasetFrame.widthRate = datasetFrame.prevWidth
1080             datasetFrame.heightRate = datasetFrame.prevHeight
1081 
1082             showTiles();
1083         }
1084 
1085         property bool fullScreen: false
1086         property double prevWidth: 0
1087         property double prevHeight: 0
1088 
1089         Component.onCompleted: {
1090             if(helper.getWidthScale(sectionName) === -1 || helper.getHeightScale(sectionName) === -1)
1091                 mainWindow.restoreOriginalLayout()
1092         }
1093 
1094         Rectangle {
1095             width: 3
1096             height: parent.height
1097             color: "gray"
1098             anchors.left: parent.right
1099             anchors.rightMargin: 0
1100             opacity: 0
1101 
1102             MouseArea {
1103                 anchors.fill: parent
1104                 hoverEnabled: true
1105                 onEntered: {parent.opacity = 1}
1106                 onExited: {
1107                     if(!drag.active && !pressed)
1108                         parent.opacity = 0
1109                 }
1110                 onPressed:parent.opacity = 1
1111                 onPressAndHold:parent.opacity = 1
1112                 onReleased: parent.opacity = 0
1113                 drag{ target: parent; axis: Drag.XAxis }
1114                 onMouseXChanged: {
1115                     if(drag.active){
1116                         newsSection.widthRate = (newsSection.width - mouseX) / mainWindow.width
1117                         exampleProjects.widthRate = (exampleProjects.width + mouseX) / mainWindow.width
1118                         datasetFrame.widthRate = (datasetFrame.width + mouseX) / mainWindow.width
1119                         releaseSection.widthRate = (releaseSection.width + mouseX) / mainWindow.width
1120                         if(exampleProjects.width < 300
1121                                 || datasetFrame.width < 300){
1122 
1123 
1124                             newsSection.widthRate = (mainWindow.width - Math.max(recentProjectsFrame.width, helpFrame.width) - 300 - 4*mainWindow.spacing) / mainWindow.width
1125                             exampleProjects.widthRate = (mainWindow.width - newsSection.width - recentProjectsFrame.width - 4*mainWindow.spacing)/ mainWindow.width
1126                             datasetFrame.widthRate = (mainWindow.width - newsSection.width - helpFrame.width - 4*mainWindow.spacing) / mainWindow.width
1127                             releaseSection.widthRate = (Math.max(recentProjectsFrame.width, helpFrame.width) + mainWindow.spacing + 300) / mainWindow.width
1128 
1129                         }
1130                         if(newsSection.width < 150) {
1131                             newsSection.widthRate = 150 / mainWindow.width
1132                             exampleProjects.widthRate = (mainWindow.width - recentProjectsFrame.width - 150 - 4*mainWindow.spacing)/ mainWindow.width
1133                             datasetFrame.widthRate = (mainWindow.width - helpFrame.width - 150 - 4*mainWindow.spacing) / mainWindow.width
1134                             releaseSection.widthRate = (mainWindow.width - newsSection.width - 3*mainWindow.spacing) / mainWindow.width
1135                         }
1136 
1137                     }
1138                 }
1139             }
1140         }
1141 
1142         Rectangle {
1143             height: 3
1144             width : parent.width
1145             color: "gray"
1146             anchors.top: parent.bottom
1147             anchors.bottomMargin: 0
1148             opacity: 0
1149 
1150             MouseArea {
1151                 anchors.fill: parent
1152                 hoverEnabled: true
1153                 onEntered: {parent.opacity = 1}
1154                 onExited: {
1155                     if(!drag.active && !pressed)
1156                         parent.opacity = 0
1157                 }
1158                 onPressed:parent.opacity = 1
1159                 onPressAndHold:parent.opacity = 1
1160                 onReleased: parent.opacity = 0
1161                 drag{ target: parent; axis: Drag.YAxis }
1162                 onMouseYChanged: {
1163                     if(drag.active){
1164                         helpFrame.heightRate = (helpFrame.height + mouseY) / mainWindow.height
1165                         datasetFrame.heightRate = (datasetFrame.height + mouseY) / mainWindow.height
1166                         releaseSection.heightRate = (releaseSection.height - mouseY) / mainWindow.height
1167                         if(releaseSection.height < 100) {
1168                             releaseSection.heightRate = 100 / mainWindow.height
1169                             helpFrame.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing) / mainWindow.height
1170                             datasetFrame.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing) / mainWindow.height
1171                         }
1172                         if(helpFrame.height < 100 || datasetFrame.height < 100) {
1173                             helpFrame.heightRate = 100 / mainWindow.height
1174                             datasetFrame.heightRate = 100 / mainWindow.height
1175                             releaseSection.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing) / mainWindow.height
1176                         }
1177                     }
1178                 }
1179             }
1180         }
1181 
1182         Rectangle {
1183             height: 3
1184             width : parent.width
1185             color: "gray"
1186             anchors.bottom: parent.top
1187             anchors.bottomMargin: 0
1188             opacity: 0
1189 
1190             MouseArea {
1191                 anchors.fill: parent
1192                 hoverEnabled: true
1193                 onEntered: {parent.opacity = 1}
1194                 onExited: {
1195                     if(!drag.active && !pressed)
1196                         parent.opacity = 0
1197                 }
1198                 onPressed:parent.opacity = 1
1199                 onPressAndHold:parent.opacity = 1
1200                 onReleased: parent.opacity = 0
1201                 drag{ target: parent; axis: Drag.YAxis }
1202                 onMouseYChanged: {
1203                     if(drag.active){
1204                         recentProjectsFrame.heightRate = (recentProjectsFrame.height + mouseY) / mainWindow.height
1205                         exampleProjects.heightRate = (exampleProjects.height + mouseY) / mainWindow.height
1206                         helpFrame.heightRate = (helpFrame.height - mouseY) / mainWindow.height
1207                         datasetFrame.heightRate = (datasetFrame.height - mouseY) / mainWindow.height
1208                         if(recentProjectsFrame.height < 100 || exampleProjects.height < 100) {
1209                             recentProjectsFrame.heightRate = 100 /  mainWindow.height
1210                             exampleProjects.heightRate = 100 / mainWindow.height
1211                             helpFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
1212                             datasetFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
1213                         }
1214                         if(helpFrame.height < 100 || datasetFrame.height < 100) {
1215                             helpFrame.heightRate = 100 / mainWindow.height
1216                             datasetFrame.heightRate = 100 / mainWindow.height
1217                             recentProjectsFrame.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) /  mainWindow.height
1218                             exampleProjects.heightRate = (mainWindow.height - releaseSection.height - 100 - 4*mainWindow.spacing) / mainWindow.height
1219                         }
1220                     }
1221                 }
1222             }
1223         }
1224 
1225         Rectangle {
1226             width: 3
1227             height: parent.height
1228             color: "gray"
1229             anchors.right: parent.left
1230             anchors.leftMargin: 0
1231             opacity: 0
1232 
1233             MouseArea {
1234                 anchors.fill: parent
1235                 hoverEnabled: true
1236                 onEntered: {parent.opacity = 1}
1237                 onExited: {
1238                     if(!drag.active && !pressed)
1239                         parent.opacity = 0
1240                 }
1241                 onPressed:parent.opacity = 1
1242                 onPressAndHold:parent.opacity = 1
1243                 onReleased: parent.opacity = 0
1244                 drag{ target: parent; axis: Drag.XAxis }
1245                 onMouseXChanged: {
1246                     if(drag.active){
1247                         helpFrame.widthRate = (helpFrame.width + mouseX) / mainWindow.width
1248                         datasetFrame.widthRate = (datasetFrame.width - mouseX) / mainWindow.width
1249                         if(helpFrame.width < 150){
1250                             helpFrame.widthRate = 150 / mainWindow.width
1251                             datasetFrame.widthRate = (mainWindow.width - newsSection.width - 150 - 4*mainWindow.spacing) / mainWindow.width
1252                         }
1253                         if(datasetFrame.width < 150) {
1254                             datasetFrame.widthRate = 150 / mainWindow.width
1255                             helpFrame.widthRate = (mainWindow.width - newsSection.width - 150 - 4*mainWindow.spacing) / mainWindow.width
1256                         }
1257                     }
1258                 }
1259             }
1260         }
1261 
1262         ColumnLayout {
1263             anchors.fill: parent
1264             clip: true
1265             spacing: 20
1266 
1267             RowLayout {
1268                 Layout.fillWidth: true
1269                 Layout.minimumHeight: Math.min((parent.height - parent.spacing) *0.2, 100)
1270                 Layout.preferredHeight: Math.min((parent.height - parent.spacing) *0.2, 100)
1271 
1272                 Image {
1273                     Layout.preferredHeight: datasetFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1274                     Layout.minimumHeight: datasetFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1275                     Layout.preferredWidth: datasetFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1276                     Layout.minimumWidth: datasetFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1277                     Layout.alignment: Qt.AlignVCenter
1278 
1279                     source: datasetFrame.fullScreen ? helper.getMinIcon() : helper.getMaxIcon()
1280                     sourceSize.width: datasetFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1281                     sourceSize.height: datasetFrame.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1282 
1283                     MouseArea {
1284                         anchors.fill: parent
1285 
1286                         onClicked: {
1287                             if(!datasetFrame.fullScreen)
1288                                 datasetFrame.maximize()
1289                             else
1290                                 datasetFrame.minimize()
1291 
1292                             datasetFrame.fullScreen = !datasetFrame.fullScreen
1293                         }
1294                     }
1295                 }
1296 
1297                 Label {
1298                     text: qsTr("Start exploring data")
1299 
1300                     verticalAlignment: Text.AlignVCenter
1301                     horizontalAlignment: Text.AlignHCenter
1302                     font.pointSize: datasetFrame.fullScreen ? 60 : 24
1303                     minimumPointSize: 10
1304                     fontSizeMode: Text.Fit
1305                     Layout.fillWidth: true
1306                     Layout.fillHeight: true
1307                     wrapMode: Text.WordWrap
1308                 }
1309             }
1310 
1311             RowLayout {
1312                 id: datasetSectionRow
1313                 Layout.fillHeight: true
1314                 Layout.minimumHeight: Math.max((parent.height - parent.spacing) *0.8, parent.height - parent.spacing - 100)
1315                 Layout.fillWidth: true
1316                 Layout.preferredWidth: parent.width
1317                 Layout.minimumWidth: parent.width
1318                 spacing: 10
1319                 clip: true
1320                 property int separatorWidth: 5
1321 
1322                 ListView {
1323                     id: categoryList
1324                     Layout.preferredWidth: (parent.width - 3 * datasetSectionRow.separatorWidth - 6*datasetSectionRow.spacing) * 0.15
1325                     Layout.minimumWidth:  (parent.width - 3 * datasetSectionRow.separatorWidth - 6*datasetSectionRow.spacing) * 0.15
1326                     spacing: 10
1327                     Layout.fillHeight: true
1328                     property int textWidth: 100
1329 
1330                     clip: true
1331                     ScrollBar.vertical: ScrollBar { }
1332                     model: datasetModel.allCategories()
1333                     delegate:Rectangle {
1334                         width: parent.width
1335                         height: 25
1336                         id: categoryDelegate
1337                         property string categoryName : modelData
1338                         property bool selected: ListView.isCurrentItem
1339 
1340                         RowLayout {
1341                             id: categoryRow
1342                             spacing: 10
1343                             anchors.fill: parent
1344 
1345                             Rectangle {
1346                                 id: categoryBullet
1347                                 Layout.alignment: Qt.AlignVCenter
1348                                 width: 5
1349                                 height: 5
1350                                 color: "#7a7d82"
1351                             }
1352 
1353                             Label {
1354                                 height: parent.height
1355                                 width: parent.width - 5 - categoryRow.spacing
1356                                 Layout.minimumWidth: parent.width - 5 - categoryRow.spacing
1357                                 Layout.preferredWidth: parent.width - 5 - categoryRow.spacing
1358                                 Layout.fillHeight: true
1359                                 id: categoryLabel
1360                                 verticalAlignment: Text.AlignVCenter
1361                                 horizontalAlignment: Text.AlignHCenter
1362                                 text: categoryDelegate.categoryName
1363                                 font.bold: true
1364                                 wrapMode: Text.WordWrap
1365                                 font.pixelSize: 18
1366                                 minimumPixelSize: 1
1367                                 fontSizeMode: Text.Fit
1368                                 color: selected ? "#d69f00" : "#000000"
1369                                 scale: selected ? 1.15 : 1.0
1370                                 Behavior on color { ColorAnimation { duration: 150 } }
1371                                 Behavior on scale { PropertyAnimation { duration: 300 } }
1372 
1373                                 Component.onCompleted:  {
1374                                     if(index == 0) {
1375                                         mainWindow.currentCategory =  categoryDelegate.categoryName
1376                                         categoryDelegate.ListView.view.currentIndex = index
1377                                     }
1378 
1379                                     if(categoryList.textWidth < paintedWidth + categoryBullet.width + categoryRow.spacing)
1380                                         categoryList.textWidth = paintedWidth + categoryBullet.width + categoryRow.spacing
1381                                 }
1382                             }
1383                         }
1384 
1385                         MouseArea {
1386                             anchors.fill: parent
1387                             onClicked: {
1388                                 categoryDelegate.ListView.view.currentIndex = index
1389                                 if (mainWindow.currentCategory != categoryName)
1390                                     mainWindow.currentCategory = categoryName
1391 
1392                                 if(categoryList.textWidth < categoryLabel.paintedWidth + categoryBullet.width + categoryRow.spacing)
1393                                     categoryList.textWidth = categoryLabel.paintedWidth + categoryBullet.width + categoryRow.spacing
1394                             }
1395                         }
1396                     }
1397                 }
1398 
1399                 Rectangle {
1400                     Layout.fillHeight: true
1401                     width: 5
1402                     color: "grey"
1403                 }
1404 
1405                 ListView {
1406                     id: subcategoryList
1407                     spacing: 10
1408                     Layout.fillHeight: true
1409                     Layout.preferredWidth: (parent.width - 3 * datasetSectionRow.separatorWidth - 6*datasetSectionRow.spacing) * 0.15
1410                     Layout.minimumWidth:  (parent.width - 3 * datasetSectionRow.separatorWidth - 6*datasetSectionRow.spacing) * 0.15
1411                     ScrollBar.vertical: ScrollBar{}
1412                     clip: true
1413                     property int textWidth: 100
1414 
1415                     model: datasetModel.allSubcategories(mainWindow.currentCategory)
1416                     delegate: Rectangle {
1417                         width: parent.width
1418                         height: 25
1419                         id: subcategoryDelegate
1420                         property string subcategoryName : modelData
1421                         property bool selected: ListView.isCurrentItem
1422 
1423                         RowLayout {
1424                             id: subcategoryRow
1425                             spacing: 10
1426                             anchors.fill: parent
1427 
1428                             Rectangle {
1429                                 id: subcategoryBullet
1430                                 Layout.alignment: Qt.AlignVCenter
1431                                 width: 5
1432                                 height: 5
1433                                 color: "#7a7d82"
1434                             }
1435 
1436                             Label {
1437                                 height: parent.height
1438                                 width: parent.width - 5 - subcategoryRow.spacing
1439                                 Layout.minimumWidth: parent.width - 5 - subcategoryRow.spacing
1440                                 Layout.preferredWidth: parent.width - 5 - subcategoryRow.spacing
1441                                 Layout.fillHeight: true
1442 
1443                                 verticalAlignment: Text.AlignVCenter
1444                                 horizontalAlignment: Text.AlignHCenter
1445                                 text: subcategoryDelegate.subcategoryName
1446                                 wrapMode: Text.WordWrap
1447                                 font.bold: true
1448                                 font.pixelSize: 18
1449                                 minimumPixelSize: 1
1450                                 fontSizeMode: Text.Fit
1451                                 color: selected ? "#d69f00" : "#000000"
1452                                 scale: selected ? 1.15 : 1.0
1453                                 Behavior on color { ColorAnimation { duration: 150 } }
1454                                 Behavior on scale { PropertyAnimation { duration: 300 } }
1455 
1456                                 Component.onCompleted: {
1457                                     if(index == 0) {
1458                                         mainWindow.currentSubcategory = subcategoryDelegate.subcategoryName
1459                                         subcategoryDelegate.ListView.view.currentIndex = index
1460                                     }
1461 
1462                                     if(subcategoryList.textWidth < paintedWidth + subcategoryBullet.width + subcategoryRow.spacing) {
1463                                         subcategoryList.textWidth = paintedWidth + subcategoryBullet.width + subcategoryRow.spacing
1464                                     }
1465                                 }
1466                             }
1467                         }
1468 
1469                         MouseArea {
1470                             anchors.fill: parent
1471                             onClicked: {
1472                                 console.log("Subcategory name: " +  subcategoryDelegate.subcategoryName + "Clicked")
1473                                 subcategoryDelegate.ListView.view.currentIndex = index
1474                                 if (mainWindow.currentSubcategory != subcategoryName)
1475                                     mainWindow.currentSubcategory = subcategoryName
1476                             }
1477                         }
1478                     }
1479                 }
1480 
1481                 Rectangle {
1482                     Layout.fillHeight: true
1483                     width: 5
1484                     color: "grey"
1485                 }
1486 
1487                 GridView {
1488                     id: datasetGrid
1489                     Layout.fillHeight: true
1490                     Layout.preferredWidth: (parent.width - 3 * datasetSectionRow.separatorWidth - 6*datasetSectionRow.spacing) * 0.4
1491                     Layout.minimumWidth:  (parent.width - 3 * datasetSectionRow.separatorWidth - 6*datasetSectionRow.spacing) * 0.4
1492                     cellWidth: width/4
1493                     cellHeight: 40
1494                     clip: true
1495 
1496 
1497                     model: datasetModel.allDatasets(mainWindow.currentCategory, mainWindow.currentSubcategory)
1498 
1499                     delegate: Rectangle {
1500                         id: datasetDelegate
1501                         property string datasetName : modelData
1502                         property bool selected: (index == datasetGrid.currentIndex)
1503                         width: (datasetGrid.width - 30) / 4
1504                         height: textHeight
1505 
1506                         property int textWidth: 200
1507                         property int textHeight: 40
1508 
1509                         RowLayout {
1510                             id: datasetRow
1511                             spacing: 10
1512                             anchors.fill: parent
1513 
1514                             Rectangle {
1515                                 id: datasetBullet
1516                                 width: 5
1517                                 height: 5
1518                                 color: "#7a7d82"
1519                             }
1520 
1521                             Label {
1522                                 id: datasetText
1523 
1524 
1525                                 height: parent.height
1526                                 width: parent.width - 5 - datasetRow.spacing
1527                                 Layout.minimumWidth: parent.width - 5 - datasetRow.spacing
1528                                 Layout.preferredWidth: parent.width - 5 - datasetRow.spacing
1529                                 Layout.fillHeight: true
1530 
1531                                 verticalAlignment: Text.AlignVCenter
1532                                 horizontalAlignment: Text.AlignHCenter
1533                                 text: datasetDelegate.datasetName
1534                                 wrapMode: Text.WordWrap
1535                                 font.bold: true
1536                                 font.pixelSize: 18
1537                                 minimumPixelSize: 1
1538                                 fontSizeMode: Text.Fit
1539                                 color: selected ? "#d69f00" : "#000000"
1540                                 scale: selected ? 1.15 : 1.0
1541                                 Behavior on color { ColorAnimation { duration: 150 } }
1542                                 Behavior on scale { PropertyAnimation { duration: 300 } }
1543 
1544                                 Component.onCompleted: {
1545                                     datasetDelegate.textHeight = paintedHeight
1546                                     datasetDelegate.textWidth = paintedWidth + datasetBullet.width + datasetRow.spacing
1547 
1548                                     if(index == 0) {
1549                                         datasetGrid.currentIndex = index
1550                                         mainWindow.currentDataset = datasetDelegate.datasetName
1551                                         mainWindow.datasetClicked(mainWindow.currentCategory, mainWindow.currentSubcategory, datasetDelegate.datasetName)
1552                                     }
1553                                 }
1554                             }
1555                         }
1556 
1557                         MouseArea {
1558                             anchors.fill: parent
1559                             onClicked: {
1560                                 if(datasetFrame.fullScreen)
1561                                     datasetFrame.minimize()
1562                                 datasetGrid.currentIndex = index
1563                                 console.log("Dataset name: " +  datasetDelegate.datasetName + "Clicked")
1564                                 mainWindow.currentDataset = datasetDelegate.datasetName
1565                                 mainWindow.datasetClicked(mainWindow.currentCategory, mainWindow.currentSubcategory, datasetDelegate.datasetName)
1566                             }
1567                         }
1568                     }
1569                 }
1570 
1571                 Rectangle {
1572                     Layout.fillHeight: true
1573                     width: 5
1574                     color: "grey"
1575                 }
1576 
1577 
1578                 ScrollView {
1579                     id: scrollView
1580                     Layout.fillHeight: true
1581                     Layout.preferredWidth: (parent.width - 3 * datasetSectionRow.separatorWidth - 6*datasetSectionRow.spacing) * 0.3
1582                     Layout.minimumWidth:  (parent.width - 3 * datasetSectionRow.separatorWidth - 6*datasetSectionRow.spacing) * 0.3
1583 
1584                     contentHeight: datasetDescriptionColumn.height
1585                     clip: true
1586                     ColumnLayout {
1587                         id: datasetDescriptionColumn
1588                         Layout.minimumWidth: scrollView.width
1589                         Layout.preferredWidth: scrollView.width
1590                         width: scrollView.width
1591                         spacing: 10
1592 
1593                         Row {
1594                             width: datasetDescriptionColumn.width
1595                             spacing: 5
1596                             Text {
1597                                 id: datasetTitleLabel
1598                                 text: "Full name: "
1599                                 font.pixelSize: 14
1600                                 font.bold: true
1601                                 wrapMode: Text.WordWrap
1602                             }
1603 
1604                             Text {
1605                                 id: datasetTitle
1606                                 //Layout.fillWidth: true
1607                                 width: datasetDescriptionColumn.width - datasetTitleLabel.paintedWidth
1608                                 text: "-"
1609                                 wrapMode: Text.WordWrap
1610                                 font.pixelSize: 14
1611                             }
1612                         }
1613 
1614                         Row {
1615                             width: parent.width
1616                             height: Math.max(datasetDescription.textHeight, datasetDescriptionLabel.paintedHeight)
1617                             spacing: 5
1618                             Text {
1619                                 id: datasetDescriptionLabel
1620                                 text: "Description: "
1621                                 font.pixelSize: 14
1622                                 font.bold: true
1623                                 wrapMode: Text.WordWrap
1624                             }
1625                             Text {
1626                                 id: datasetDescription
1627                                 property double textHeight: paintedHeight
1628 
1629                                 text: ""
1630                                 width: datasetDescriptionColumn.width - datasetDescriptionLabel.paintedWidth
1631                                 Layout.preferredWidth: datasetDescriptionColumn.width - datasetDescriptionLabel.paintedWidth
1632                                 Layout.minimumWidth: datasetDescriptionColumn.width - datasetDescriptionLabel.paintedWidth
1633                                 wrapMode: Text.WordWrap
1634                                 font.pixelSize: 12
1635                             }
1636                         }
1637 
1638                         Row {
1639                             width: parent.width
1640                             spacing: 5
1641                             Text {
1642                                 id: datasetColumnsLabel
1643                                 text: "Columns: "
1644                                 font.pixelSize: 14
1645                                 font.bold: true
1646                                 wrapMode: Text.WordWrap
1647                             }
1648                             Text {
1649                                 id: datasetColumns
1650                                 text: "-"
1651                                 width: datasetDescriptionColumn.width - datasetColumnsLabel.paintedWidth
1652                                 wrapMode: Text.WordWrap
1653                                 font.pixelSize: 14
1654                             }
1655                         }
1656 
1657                         Row {
1658                             width: parent.width
1659                             spacing: 5
1660                             Text {
1661                                 id: datasetRowsLabel
1662                                 text: "Rows: "
1663                                 font.pixelSize: 14
1664                                 font.bold: true
1665                                 wrapMode: Text.WordWrap
1666                             }
1667                             Text {
1668                                 id: datasetRows
1669                                 text: "-"
1670                                 width: datasetDescriptionColumn.width - datasetRowsLabel.paintedWidth
1671                                 wrapMode: Text.WordWrap
1672                                 font.pixelSize: 14
1673                             }
1674                         }
1675 
1676                         Rectangle {
1677                             width: datasetButtonText.paintedWidth + 10
1678                             height: datasetButtonText.paintedHeight + 10
1679                             Layout.alignment: Qt.AlignHCenter | Qt.AlignBottom
1680                             color:'#dfe3ee'
1681 
1682                             Text {
1683                                 id: datasetButtonText
1684                                 text: "Open dataset"
1685                                 horizontalAlignment: Text.AlignHCenter
1686                                 verticalAlignment: Text.AlignVCenter
1687                                 font.pixelSize: 14
1688                                 font.bold: true
1689                                 wrapMode: Text.WordWrap
1690                             }
1691 
1692                             MouseArea {
1693                                 anchors.fill: parent
1694                                 onClicked: {
1695                                     mainWindow.openDataset()
1696                                 }
1697                             }
1698                         }
1699                     }
1700                 }
1701             }
1702         }
1703     }
1704 
1705     Frame {
1706         id: releaseSection
1707         property string sectionName: "releaseSection"
1708         property double widthRate : helper.getWidthScale(sectionName) === -1 ? (4 * mainWindow.width / 5 - 4*mainWindow.spacing) / mainWindow.width : helper.getWidthScale(sectionName)
1709         property double heightRate : helper.getHeightScale(sectionName) === -1 ? (2*mainWindow.height / 4 - 4*mainWindow.spacing) / mainWindow.height : helper.getHeightScale(sectionName)
1710         width: mainWindow.width * widthRate
1711         height: mainWindow.height * heightRate
1712 
1713         anchors.left: parent.left
1714         anchors.leftMargin: mainWindow.spacing
1715         anchors.right: newsSection.left
1716         anchors.rightMargin: mainWindow.spacing
1717         anchors.bottom: parent.bottom
1718         anchors.bottomMargin: mainWindow.spacing
1719         visible: true
1720         opacity: 1
1721         padding: 5
1722         clip: true
1723 
1724         property bool fullScreen: false
1725         property double prevWidth: 0
1726         property double prevHeight: 0
1727 
1728         function maximize() {
1729             hideTiles()
1730             releaseSection.prevWidth = releaseSection.widthRate
1731             releaseSection.prevHeight = releaseSection.heightRate
1732             releaseSection.visible = true
1733             releaseSection.z = 1
1734             releaseSection.anchors.fill = undefined
1735             releaseSection.anchors.right = undefined
1736             releaseSection.anchors.bottom = undefined
1737             releaseSection.anchors.centerIn = undefined
1738             releaseSection.anchors.top = undefined
1739             releaseSection.anchors.left = undefined
1740 
1741             releaseSection.widthRate = 1
1742             releaseSection.heightRate = 1
1743             releaseSection.anchors.fill = mainWindow
1744         }
1745 
1746         function minimize() {
1747             releaseSection.anchors.fill = undefined
1748             releaseSection.anchors.right = undefined
1749             releaseSection.anchors.bottom = undefined
1750             releaseSection.anchors.centerIn = undefined
1751             releaseSection.anchors.top = undefined
1752             releaseSection.anchors.left = undefined
1753 
1754             releaseSection.anchors.left = mainWindow.left
1755             releaseSection.anchors.leftMargin = mainWindow.spacing
1756             releaseSection.anchors.bottom = mainWindow.bottom
1757             releaseSection.anchors.bottomMargin = mainWindow.spacing
1758             releaseSection.anchors.right = newsSection.left
1759             releaseSection.anchors.rightMargin = mainWindow.spacing
1760             releaseSection.widthRate = releaseSection.prevWidth
1761             releaseSection.heightRate = releaseSection.prevHeight
1762 
1763             showTiles();
1764         }
1765 
1766         function updateIcons() {
1767             if(releaseWebView.canGoBack)
1768                 backIcon.opacity = 1
1769             else
1770                 backIcon.opacity = 0.5
1771 
1772             if(releaseWebView.canGoForward)
1773                 forwardIcon.opacity = 1
1774             else
1775                 forwardIcon.opacity = 0.5
1776         }
1777 
1778 
1779         Component.onCompleted: {
1780             if(helper.getWidthScale(sectionName) === -1 || helper.getHeightScale(sectionName) === -1)
1781                 mainWindow.restoreOriginalLayout()
1782         }
1783 
1784         Rectangle {
1785             width: 3
1786             height: parent.height
1787             color: "gray"
1788             anchors.left: parent.right
1789             anchors.rightMargin: 0
1790             opacity: 0
1791 
1792             MouseArea {
1793                 anchors.fill: parent
1794                 hoverEnabled: true
1795                 onEntered: {parent.opacity = 1}
1796                 onExited: {
1797                     if(!drag.active && !pressed)
1798                         parent.opacity = 0
1799                 }
1800                 onPressed:parent.opacity = 1
1801                 onPressAndHold:parent.opacity = 1
1802                 onReleased: parent.opacity = 0
1803                 drag{ target: parent; axis: Drag.XAxis }
1804                 onMouseXChanged: {
1805                     if(drag.active){
1806                         newsSection.widthRate = (newsSection.width - mouseX) / mainWindow.width
1807                         exampleProjects.widthRate = (exampleProjects.width + mouseX) / mainWindow.width
1808                         datasetFrame.widthRate = (datasetFrame.width + mouseX) / mainWindow.width
1809                         releaseSection.widthRate = (releaseSection.width + mouseX) / mainWindow.width
1810                         if(exampleProjects.width < 300
1811                                 || datasetFrame.width < 300){
1812 
1813 
1814                             newsSection.widthRate = (mainWindow.width - Math.max(recentProjectsFrame.width, helpFrame.width) - 300 - 4*mainWindow.spacing) / mainWindow.width
1815                             exampleProjects.widthRate = (mainWindow.width - newsSection.width - recentProjectsFrame.width - 4*mainWindow.spacing)  / mainWindow.width
1816                             datasetFrame.widthRate = (mainWindow.width - newsSection.width - helpFrame.width - 4*mainWindow.spacing) / mainWindow.width
1817                             releaseSection.widthRate = (Math.max(recentProjectsFrame.width, helpFrame.width) + mainWindow.spacing + 300) / mainWindow.width
1818 
1819                         }
1820                         if(newsSection.width < 150) {
1821                             newsSection.width = 150 / mainWindow.width
1822                             exampleProjects.widthRate = (mainWindow.width - recentProjectsFrame.width - 150 - 4*mainWindow.spacing)  / mainWindow.width
1823                             datasetFrame.widthRate = (mainWindow.width - helpFrame.width - 150 - 4*mainWindow.spacing) / mainWindow.width
1824                             releaseSection.widthRate = (mainWindow.width - newsSection.width - 3*mainWindow.spacing) / mainWindow.width
1825                         }
1826 
1827                     }
1828                 }
1829             }
1830         }
1831 
1832         Rectangle {
1833             height: 3
1834             width : parent.width
1835             color: "gray"
1836             anchors.bottom: parent.top
1837             anchors.bottomMargin: 0
1838             opacity: 0
1839 
1840             MouseArea {
1841                 anchors.fill: parent
1842                 hoverEnabled: true
1843                 onEntered: {parent.opacity = 1}
1844                 onExited: {
1845                     if(!drag.active && !pressed)
1846                         parent.opacity = 0
1847                 }
1848                 onPressed:parent.opacity = 1
1849                 onPressAndHold:parent.opacity = 1
1850                 onReleased: parent.opacity = 0
1851                 drag{ target: parent; axis: Drag.YAxis }
1852                 onMouseYChanged: {
1853                     if(drag.active){
1854                         helpFrame.heightRate = (helpFrame.height + mouseY) / mainWindow.height
1855                         datasetFrame.heightRate = (datasetFrame.height + mouseY) / mainWindow.height
1856                         releaseSection.heightRate = (releaseSection.height - mouseY) / mainWindow.height
1857                         if(releaseSection.height < 100) {
1858                             releaseSection.heightRate = 100 / mainWindow.height
1859                             helpFrame.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing)  / mainWindow.height
1860                             datasetFrame.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing) / mainWindow.height
1861                         }
1862                         if(helpFrame.height < 100 || datasetFrame.height < 100) {
1863                             helpFrame.heightRate = 100 / mainWindow.height
1864                             datasetFrame.heightRate = 100 / mainWindow.height
1865                             releaseSection.heightRate = (mainWindow.height - recentProjectsFrame.height - 100 - 4*mainWindow.spacing) / mainWindow.height
1866                         }
1867                     }
1868                 }
1869             }
1870         }
1871 
1872         // "What's new in this release" section
1873         ColumnLayout {
1874             anchors.fill: parent
1875             clip: true
1876             spacing: 10
1877 
1878             RowLayout {
1879                 Layout.fillWidth: true
1880                 Layout.minimumHeight: Math.min((parent.height - parent.spacing) *0.2, 100)
1881                 Layout.preferredHeight: Math.min((parent.height - parent.spacing) *0.2, 100)
1882 
1883                 Image {
1884                     Layout.preferredHeight: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1885                     Layout.minimumHeight: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1886                     Layout.preferredWidth: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1887                     Layout.minimumWidth: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1888                     Layout.alignment: Qt.AlignVCenter
1889                     source: releaseSection.fullScreen ? helper.getMinIcon() : helper.getMaxIcon()
1890                     sourceSize.width: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1891                     sourceSize.height: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 25) : Math.min(Math.min(parent.height, parent.width) * 0.5, 15)
1892 
1893                     MouseArea {
1894                         anchors.fill: parent
1895 
1896                         onClicked: {
1897                             if(!releaseSection.fullScreen)
1898                                 releaseSection.maximize()
1899                             else
1900                                 releaseSection.minimize()
1901 
1902                             releaseSection.fullScreen = !releaseSection.fullScreen
1903                         }
1904                     }
1905                 }
1906 
1907                 Image {
1908                     id: backIcon
1909                     Layout.preferredHeight: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1910                     Layout.minimumHeight: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1911                     Layout.preferredWidth: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1912                     Layout.minimumWidth: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1913                     Layout.alignment: Qt.AlignVCenter
1914                     source: helper.getBackIcon()
1915                     sourceSize.width: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1916                     sourceSize.height: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1917 
1918                     MouseArea {
1919                         anchors.fill: parent
1920 
1921                         onClicked:
1922                             releaseWebView.goBack()
1923                     }
1924                 }
1925 
1926                 Image {
1927                     id: forwardIcon
1928                     Layout.preferredHeight: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1929                     Layout.minimumHeight: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1930                     Layout.preferredWidth: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1931                     Layout.minimumWidth: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1932                     Layout.alignment: Qt.AlignVCenter
1933                     source: helper.getForwardIcon()
1934                     sourceSize.width: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1935                     sourceSize.height: releaseSection.fullScreen ?Math.min(Math.min(parent.height, parent.width) * 0.5, 35) : Math.min(Math.min(parent.height, parent.width) * 0.5, 25)
1936 
1937                     MouseArea {
1938                         anchors.fill: parent
1939 
1940                         onClicked:
1941                             releaseWebView.goForward()
1942                     }
1943                 }
1944 
1945                 Label {
1946                     text: qsTr("What's new in this release")
1947 
1948                     verticalAlignment: Text.AlignVCenter
1949                     horizontalAlignment: Text.AlignHCenter
1950                     font.pointSize:releaseSection.fullScreen ? 60 : 24
1951                     minimumPointSize: 10
1952                     fontSizeMode: Text.Fit
1953                     Layout.fillWidth: true
1954                     Layout.fillHeight: true
1955                     wrapMode: Text.WordWrap
1956                 }
1957             }
1958 
1959             WebView {
1960                 id: releaseWebView
1961                 Layout.fillHeight: true
1962                 Layout.minimumHeight: Math.max((parent.height - parent.spacing) * 0.8, parent.height - parent.spacing - 100)
1963                 Layout.preferredHeight: Math.max((parent.height - parent.spacing) * 0.8, parent.height - parent.spacing - 100)
1964                 Layout.fillWidth: true
1965                 url: initialUrl
1966 
1967                 Component.onCompleted:
1968                     releaseSection.updateIcons()
1969 
1970                 onCanGoBackChanged:
1971                     releaseSection.updateIcons()
1972 
1973                 onCanGoForwardChanged:
1974                     releaseSection.updateIcons()
1975             }
1976         }
1977     }
1978 }