add title and settings button
This commit is contained in:
@@ -2,8 +2,8 @@ cmake_minimum_required(VERSION 3.16)
|
|||||||
|
|
||||||
project(archpack VERSION 0.1 LANGUAGES CXX)
|
project(archpack VERSION 0.1 LANGUAGES CXX)
|
||||||
|
|
||||||
|
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
||||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
find_package(Qt6 REQUIRED COMPONENTS Quick)
|
find_package(Qt6 REQUIRED COMPONENTS Quick)
|
||||||
|
|
||||||
qt_standard_project_setup(REQUIRES 6.10)
|
qt_standard_project_setup(REQUIRES 6.10)
|
||||||
@@ -17,10 +17,12 @@ set_source_files_properties(qml/style/Theme.qml
|
|||||||
)
|
)
|
||||||
|
|
||||||
qt_add_qml_module(apparchpack
|
qt_add_qml_module(apparchpack
|
||||||
URI archpack
|
URI archpack
|
||||||
QML_FILES
|
QML_FILES
|
||||||
Main.qml
|
Main.qml
|
||||||
qml/style/Theme.qml
|
qml/style/Theme.qml
|
||||||
|
qml/components/Title.qml
|
||||||
|
qml/buttons/Settings.qml
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(apparchpack
|
target_link_libraries(apparchpack
|
||||||
|
|||||||
34
Main.qml
34
Main.qml
@@ -1,37 +1,33 @@
|
|||||||
import QtQuick
|
import QtQuick
|
||||||
import QtQuick.Controls.Basic
|
import QtQuick.Controls.Basic
|
||||||
import QtQuick.Layouts 1.15
|
import QtQuick.Layouts
|
||||||
|
|
||||||
import archpack
|
import archpack
|
||||||
|
import "qml/components" as Components
|
||||||
|
import "qml/buttons" as Buttons
|
||||||
|
|
||||||
ApplicationWindow {
|
ApplicationWindow {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
readonly property int currentWidth: 740
|
|
||||||
|
|
||||||
title: "Arch Linux Updater"
|
title: "Arch Linux Updater"
|
||||||
width: currentWidth
|
minimumWidth: 740
|
||||||
height: 560
|
minimumHeight: 560
|
||||||
minimumWidth: 200
|
maximumWidth: 1080
|
||||||
minimumHeight: 250
|
maximumHeight: 1460
|
||||||
visible: true
|
visible: true
|
||||||
color: Theme.base
|
color: Theme.base
|
||||||
|
|
||||||
RowLayout {
|
ColumnLayout {
|
||||||
|
id: mainLayout
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
spacing: 0
|
anchors.margins: 16
|
||||||
|
spacing: 12
|
||||||
|
|
||||||
Item {
|
RowLayout {
|
||||||
id: mainColumn
|
id: headerLayout
|
||||||
Layout.preferredWidth: root.currentWidth
|
|
||||||
Layout.fillHeight: true
|
|
||||||
|
|
||||||
ColumnLayout {
|
Components.Title {}
|
||||||
id: layout
|
Buttons.Settings {}
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 16
|
|
||||||
spacing: 12
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
43
qml/buttons/Settings.qml
Normal file
43
qml/buttons/Settings.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
37
qml/components/Title.qml
Normal file
37
qml/components/Title.qml
Normal file
@@ -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"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Reference in New Issue
Block a user