diff --git a/CMakeLists.txt b/CMakeLists.txt index e3a122a..e92ca6a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.16) project(archpack VERSION 0.1 LANGUAGES CXX) +set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_CXX_STANDARD_REQUIRED ON) - find_package(Qt6 REQUIRED COMPONENTS Quick) qt_standard_project_setup(REQUIRES 6.10) @@ -17,10 +17,12 @@ set_source_files_properties(qml/style/Theme.qml ) qt_add_qml_module(apparchpack - URI archpack - QML_FILES - Main.qml - qml/style/Theme.qml + URI archpack + QML_FILES + Main.qml + qml/style/Theme.qml + qml/components/Title.qml + qml/buttons/Settings.qml ) target_link_libraries(apparchpack diff --git a/Main.qml b/Main.qml index aa0c845..210a091 100644 --- a/Main.qml +++ b/Main.qml @@ -1,37 +1,33 @@ import QtQuick import QtQuick.Controls.Basic -import QtQuick.Layouts 1.15 +import QtQuick.Layouts import archpack +import "qml/components" as Components +import "qml/buttons" as Buttons ApplicationWindow { id: root - readonly property int currentWidth: 740 - title: "Arch Linux Updater" - width: currentWidth - height: 560 - minimumWidth: 200 - minimumHeight: 250 + minimumWidth: 740 + minimumHeight: 560 + maximumWidth: 1080 + maximumHeight: 1460 visible: true color: Theme.base - RowLayout { + ColumnLayout { + id: mainLayout anchors.fill: parent - spacing: 0 + anchors.margins: 16 + spacing: 12 - Item { - id: mainColumn - Layout.preferredWidth: root.currentWidth - Layout.fillHeight: true + RowLayout { + id: headerLayout - ColumnLayout { - id: layout - anchors.fill: parent - anchors.margins: 16 - spacing: 12 - } + Components.Title {} + Buttons.Settings {} } } } diff --git a/qml/buttons/Settings.qml b/qml/buttons/Settings.qml new file mode 100644 index 0000000..599e334 --- /dev/null +++ b/qml/buttons/Settings.qml @@ -0,0 +1,43 @@ +pragma ComponentBehavior: Bound + +import QtQuick 2.15 +import QtQuick.Controls 2.15 + +Item { + id: root + + implicitWidth: 32 + implicitHeight: 32 + + Button { + id: button + anchors.fill: parent + + contentItem: Item { + implicitWidth: 18 + implicitHeight: 14 + + Column { + anchors.centerIn: parent + spacing: 4 + + Repeater { + model: 3 + + Rectangle { + width: 18 + height: 2 + radius: 1 + color: "#585b70" + } + } + } + } + + background: Rectangle { + radius: 3 + color: button.down ? "#45475a" : button.hovered ? "#313244" : "transparent" + } + } +} + diff --git a/qml/components/Title.qml b/qml/components/Title.qml new file mode 100644 index 0000000..9dcbd94 --- /dev/null +++ b/qml/components/Title.qml @@ -0,0 +1,37 @@ +import QtQuick 2.15 +import QtQuick.Layouts 1.15 + +ColumnLayout { + id: root + Layout.fillWidth: true + spacing: 4 + + RowLayout { + spacing: 5 + + Text { + text: "Arch Linux Updater" + font.pixelSize: 20 + font.bold: true + color: "#cdd6f4" + Layout.alignment: Qt.AlignBaseline + } + + Text { + text: "v. " + Qt.application.version + font.pixelSize: 12 + font.italic: true + color: "#6c7086" + Layout.alignment: Qt.AlignBaseline + } + } + + Text { + text: "Можно обновить: " + Layout.fillWidth: true + wrapMode: Text.WordWrap + font.pixelSize: 12 + color: "#6c7086" + } +} +