add title and settings button

This commit is contained in:
2026-11-13 22:09:48 +03:00
parent 4cf768439c
commit 928555cc7d
4 changed files with 102 additions and 24 deletions

View File

@@ -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)
@@ -21,6 +21,8 @@ qt_add_qml_module(apparchpack
QML_FILES
Main.qml
qml/style/Theme.qml
qml/components/Title.qml
qml/buttons/Settings.qml
)
target_link_libraries(apparchpack

View File

@@ -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 {
anchors.fill: parent
spacing: 0
Item {
id: mainColumn
Layout.preferredWidth: root.currentWidth
Layout.fillHeight: true
ColumnLayout {
id: layout
id: mainLayout
anchors.fill: parent
anchors.margins: 16
spacing: 12
}
RowLayout {
id: headerLayout
Components.Title {}
Buttons.Settings {}
}
}
}

43
qml/buttons/Settings.qml Normal file
View 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
View 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"
}
}