diff --git a/Main.qml b/Main.qml index d7d9759..3d5c116 100644 --- a/Main.qml +++ b/Main.qml @@ -69,12 +69,32 @@ ApplicationWindow { } } - readonly property string consoleTitle: tabs.currentIndex === 0 ? "Консоль обновления" : tabs.currentIndex === 1 ? "Консоль установки" : "Консоль удаления" - - Components.ConsoleBar { - title: consoleTitle - consoleOpen: consoleOpen + Item { + id: plug + implicitHeight: 20 } - Components.ConsolePanel {} + } + + readonly property string consoleTitle: tabs.currentIndex === 0 ? "Консоль обновления" : tabs.currentIndex === 1 ? "Консоль установки" : "Консоль удаления" + readonly property string consoleStatus: "in develop" + // readonly property string consoleStatus: tabs.currentIndex === 0 + // ? (UpdateManager.isUpdating ? "обновление..." : "") + // : tabBar.currentIndex === 1 + // ? (UpdateManager.isInstalling ? "установка..." : "") + // : (UpdateManager.isRemoving ? "удаление..." : "") + + Components.ConsoleBar { + id: consoleBar + title: root.consoleTitle + consoleOpen: root.consoleOpen + status: root.consoleStatus + onToggled: root.consoleOpen = !root.consoleOpen + } + + Components.ConsolePanel { + id: consolePanel + anchors.bottom: consoleBar.top + consoleOpen: root.consoleOpen + status: root.consoleStatus } } diff --git a/qml/components/console/ConsoleBar.qml b/qml/components/console/ConsoleBar.qml index 8d57f45..a8d9825 100644 --- a/qml/components/console/ConsoleBar.qml +++ b/qml/components/console/ConsoleBar.qml @@ -7,47 +7,50 @@ Rectangle { anchors.right: parent.right anchors.bottom: parent.bottom height: 26 - color: barMouse.containsMouse ? "#313244" : "#1e1e2e" + color: mouseArea.containsMouse ? Theme.color9 : Theme.color8 z: 50 property string title: "" + property string status: "" property bool consoleOpen: false + signal toggled() + Rectangle { anchors.top: parent.top anchors.left: parent.left anchors.right: parent.right height: 1 - color: "#313244" + color: Theme.color5 } RowLayout { anchors.fill: parent - anchors.leftMargin: 12 - anchors.rightMargin: 12 - spacing: 8 + anchors.leftMargin: Theme.baseMargins + anchors.rightMargin: Theme.baseMargins + spacing: Theme.baseSpacing Text { text: root.consoleOpen ? "▼ Скрыть консоль" : "▲ " + root.title - color: "#a6adc8" + color: Theme.color3 font.pixelSize: 11 } Item { Layout.fillWidth: true } Text { - text: "root.consoleStatus" - color: "#f9e2af" + text: root.status + color: Theme.color7 font.pixelSize: 11 } } MouseArea { - id: barMouse + id: mouseArea anchors.fill: parent hoverEnabled: true cursorShape: Qt.PointingHandCursor - // onClicked: root.consoleOpen = !root.consoleOpen + onClicked: root.toggled() } } diff --git a/qml/components/console/ConsolePanel.qml b/qml/components/console/ConsolePanel.qml index 08573f1..820c17c 100644 --- a/qml/components/console/ConsolePanel.qml +++ b/qml/components/console/ConsolePanel.qml @@ -5,13 +5,17 @@ Rectangle { id: root anchors.left: parent.left anchors.right: parent.right - // anchors.bottom: consoleBar.top visible: height > 0 clip: true - color: "#1e1e2e" + color: Theme.color8 + height: root.consoleOpen ? root.consoleHeight : 0 + opacity: root.consoleOpen ? 1 : 0 z: 40 property string title: "" + property string status: "" + property int consoleHeight: 320 + property bool consoleOpen: false Behavior on height { NumberAnimation { duration: 250; easing.type: Easing.InOutQuad } } Behavior on opacity { NumberAnimation { duration: 180 } } @@ -25,7 +29,7 @@ Rectangle { anchors.left: parent.left anchors.right: parent.right height: 1 - color: "#313244" + color: Theme.color5 } ColumnLayout { @@ -39,7 +43,7 @@ Rectangle { Text { text: root.title - color: "#cdd6f4" + color: Theme.color2 font.pixelSize: 13 font.bold: true } @@ -47,53 +51,21 @@ Rectangle { Item { Layout.fillWidth: true } Text { - text: "root.consoleStatus" - color: "#f9e2af" + text: root.status + color: Theme.color7 font.pixelSize: 11 } } Rectangle { Layout.fillWidth: true - height: 1 - color: "#313244" + implicitHeight: 1 + color: Theme.color5 } Item { Layout.fillWidth: true Layout.fillHeight: true - - // ListView { - // id: logView - // anchors.fill: parent - // clip: true - // model: root.consoleLog - // onModelChanged: positionViewAtEnd() - // spacing: 2 - // onCountChanged: positionViewAtEnd() - // - // ScrollBar.vertical: ScrollBar { - // policy: ScrollBar.AsNeeded - // width: 6 - // } - // - // delegate: Text { - // width: logView.width - // text: modelData - // color: "#a6adc8" - // font.family: "monospace" - // font.pixelSize: 11 - // wrapMode: Text.WrapAnywhere - // } - // } - // - // Text { - // anchors.centerIn: parent - // text: root.consolePlaceholder - // color: "#585b70" - // font.pixelSize: 12 - // visible: root.consoleLog.length === 0 - // } } } } diff --git a/qml/style/Theme.qml b/qml/style/Theme.qml index f981d8d..b0167d6 100644 --- a/qml/style/Theme.qml +++ b/qml/style/Theme.qml @@ -10,6 +10,9 @@ QtObject { readonly property color color4: "#45475a" readonly property color color5: "#313244" readonly property color color6: "#89b4fa" + readonly property color color7: "#f9e2af" + readonly property color color8: "#1e1e2e" + readonly property color color9: "#242439" readonly property int fontSize: 12 readonly property int fontTitleSize: 20