From 9480134e95b35f676e8caf9f4b153e1e2b4dd2a0 Mon Sep 17 00:00:00 2001
From: "evgenii.tagiltsev" <tagiltsev.evgenii@gmail.com>
Date: Tue, 26 Nov 2019 15:18:28 +0100
Subject: [PATCH] [*] changed for page

---
 .../DapUiQmlScreenMainWindow.qml              |  9 ++-
 .../DapUiQmlWidgetLastActionsHeaderForm.qml   |  2 +-
 .../DapUiQmlWidgetRightPanel.qml              |  7 +++
 .../DapUiQmlWidgetRightPanelForm.ui.qml       | 55 +++++++------------
 4 files changed, 34 insertions(+), 39 deletions(-)

diff --git a/CellFrameDashboardGUI/DapUiQmlScreenMainWindow.qml b/CellFrameDashboardGUI/DapUiQmlScreenMainWindow.qml
index 79cdf6bf6..33f62f756 100644
--- a/CellFrameDashboardGUI/DapUiQmlScreenMainWindow.qml
+++ b/CellFrameDashboardGUI/DapUiQmlScreenMainWindow.qml
@@ -60,11 +60,14 @@ DapUiQmlScreenMainWindowForm {
                     listViewTabs.currentIndex = index;
                     rightPanel.header.clear(StackView.Immediate);
                     rightPanel.content.clear(StackView.Immediate);
-                    if(panelHeader !== "" && panelContent !== "")
+
+                    var headerData = panelHeader;
+                    var contentData = panelContent;
+                    if(panelHeader !== "" || panelContent !== "")
                     {
                         rightPanel.visible = true;
-                        rightPanel.header.push(Qt.resolvedUrl(panelHeader));
-                        rightPanel.content.push(Qt.resolvedUrl(panelContent));
+                        if(headerData !== "") rightPanel.header.push(Qt.resolvedUrl(headerData));
+                        if(contentData !== "") rightPanel.content.push(Qt.resolvedUrl(contentData));
                     }
                     else rightPanel.visible = false;
 
diff --git a/CellFrameDashboardGUI/DapUiQmlWidgetLastActionsHeaderForm.qml b/CellFrameDashboardGUI/DapUiQmlWidgetLastActionsHeaderForm.qml
index c4bef4acd..a8a3b4b95 100644
--- a/CellFrameDashboardGUI/DapUiQmlWidgetLastActionsHeaderForm.qml
+++ b/CellFrameDashboardGUI/DapUiQmlWidgetLastActionsHeaderForm.qml
@@ -4,7 +4,7 @@ import QtQuick.Controls 2.2
 import QtQuick.Layouts 1.12
 
 Rectangle {
-    anchors.fill: parent
+    height: 36 * pt
     color: "transparent"
 
     Text {
diff --git a/CellFrameDashboardGUI/DapUiQmlWidgetRightPanel.qml b/CellFrameDashboardGUI/DapUiQmlWidgetRightPanel.qml
index 25f1417d4..192d72a90 100644
--- a/CellFrameDashboardGUI/DapUiQmlWidgetRightPanel.qml
+++ b/CellFrameDashboardGUI/DapUiQmlWidgetRightPanel.qml
@@ -1,4 +1,11 @@
 import QtQuick 2.4
 
 DapUiQmlWidgetRightPanelForm {
+
+//    Connections {
+//        target: header
+//        onCurrentItemChanged: {
+//            height = currentItem.height
+//        }
+//    }
 }
diff --git a/CellFrameDashboardGUI/DapUiQmlWidgetRightPanelForm.ui.qml b/CellFrameDashboardGUI/DapUiQmlWidgetRightPanelForm.ui.qml
index 6c4826092..e9ed025f4 100644
--- a/CellFrameDashboardGUI/DapUiQmlWidgetRightPanelForm.ui.qml
+++ b/CellFrameDashboardGUI/DapUiQmlWidgetRightPanelForm.ui.qml
@@ -4,50 +4,35 @@ import QtQuick.Controls 2.13
 Rectangle {
     property alias header  : stackViewHeader
     property alias content : stackViewContent
-    property int headerHeight: 36 * pt
+    property alias background : rightPanelPage.background
+    property alias footer: stackViewHeader
 
     width: visible ? 400 * pt : 0
     color: "#E3E2E6"
 
-    Rectangle {
+    Page {
+        id: rightPanelPage
         anchors.fill: parent
         anchors.leftMargin: 1
-        color: "#F8F7FA"
-
-        Column {
-            anchors.fill: parent
-
-            Item {
-                id: headerItem
-                width: parent.width
-                height: headerHeight;
-
-                StackView {
-                    id: stackViewHeader
-                    anchors.fill: parent
-                }
-
-//                Loader {
-//                    anchors.fill: parent
-//                    sourceComponent: header
-//                }
-            }
-
+        background: Rectangle {
+            color: "#F8F7FA"
+        }
 
-            Item {
-                width: parent.width
-                height: parent.height - headerHeight
+        header: StackView {
+            id: stackViewHeader
+            width: parent.width
+            height: currentItem === null ? 0 : currentItem.height
+        }
 
-                StackView {
-                    id: stackViewContent
-                    anchors.fill: parent
-                }
+        StackView {
+            id: stackViewContent
+            anchors.fill: parent
+        }
 
-//                Loader {
-//                    anchors.fill: parent
-//                    sourceComponent: content
-//                }
-            }
+        footer: StackView {
+            id: stackViewFooter
+            width: parent.width
+            height: currentItem === null ? 0 : currentItem.height
         }
     }
 }
-- 
GitLab