diff --git a/CMakeLists.txt b/CMakeLists.txt index fb86b65..0c7c6b8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -23,8 +23,8 @@ qt_add_qml_module(apparchpack QML_FILES Main.qml qml/style/Theme.qml - qml/components/Title.qml qml/buttons/Settings.qml + qml/components/Title.qml SOURCES cpp/utils/utils.hpp cpp/utils/utils.cpp diff --git a/Main.qml b/Main.qml index 098bd1c..a1a915e 100644 --- a/Main.qml +++ b/Main.qml @@ -22,14 +22,22 @@ ApplicationWindow { ColumnLayout { id: mainLayout anchors.fill: parent - anchors.margins: 16 - spacing: 12 + anchors.margins: Theme.baseMargins + spacing: Theme.baseSpacing RowLayout { id: headerLayout + Layout.alignment: Qt.AlignTop + Layout.maximumWidth: Number.POSITIVE_INFINITY - Components.Title {} - Buttons.Settings {} + Components.Title { + id: title + Layout.maximumWidth: Number.POSITIVE_INFINITY + } + + Buttons.Settings { + id: settingsButton + } } } } diff --git a/qml/buttons/Settings.qml b/qml/buttons/Settings.qml index 599e334..d0fbdf1 100644 --- a/qml/buttons/Settings.qml +++ b/qml/buttons/Settings.qml @@ -1,7 +1,7 @@ pragma ComponentBehavior: Bound -import QtQuick 2.15 -import QtQuick.Controls 2.15 +import QtQuick +import QtQuick.Controls Item { id: root @@ -28,7 +28,7 @@ Item { width: 18 height: 2 radius: 1 - color: "#585b70" + color: Theme.color3 } } } @@ -36,7 +36,7 @@ Item { background: Rectangle { radius: 3 - color: button.down ? "#45475a" : button.hovered ? "#313244" : "transparent" + color: button.down ? Theme.color4 : button.hovered ? Theme.color5 : Theme.colorTransparent } } } diff --git a/qml/components/Title.qml b/qml/components/Title.qml index a50a60e..2b01e24 100644 --- a/qml/components/Title.qml +++ b/qml/components/Title.qml @@ -1,5 +1,5 @@ -import QtQuick 2.15 -import QtQuick.Layouts 1.15 +import QtQuick +import QtQuick.Layouts ColumnLayout { id: root @@ -14,7 +14,7 @@ ColumnLayout { Text { text: "Arch Linux Updater" - font.pixelSize: 20 + font.pixelSize: Theme.fontTitleSize font.bold: true color: Theme.color2 Layout.alignment: Qt.AlignBaseline @@ -22,7 +22,7 @@ ColumnLayout { Text { text: "v. " + Qt.application.version - font.pixelSize: 12 + font.pixelSize: Theme.fontSize font.italic: true color: Theme.color3 Layout.alignment: Qt.AlignBaseline diff --git a/qml/style/Theme.qml b/qml/style/Theme.qml index 7eea281..879c907 100644 --- a/qml/style/Theme.qml +++ b/qml/style/Theme.qml @@ -1,11 +1,18 @@ pragma Singleton -import QtQuick 2.15 +import QtQuick QtObject { readonly property color color1: "#303446" readonly property color color2: "#cdd6f4" readonly property color color3: "#6c7086" + readonly property color color4: "#45475a" + readonly property color color5: "#313244" + readonly property color colorTransparent: "transparent" readonly property int fontSize: 12 + readonly property int fontTitleSize: 20 + + readonly property int baseMargins: 12 + readonly property int baseSpacing: 12 }