add settins menu
This commit is contained in:
@@ -28,6 +28,7 @@ qt_add_qml_module(apparchpack
|
||||
qml/components/Title.qml
|
||||
qml/components/Line.qml
|
||||
qml/components/Tabs.qml
|
||||
qml/components/SettingsMenu.qml
|
||||
qml/components/pages/UpdatePg.qml
|
||||
qml/components/pages/InstallPg.qml
|
||||
qml/components/pages/DeletePg.qml
|
||||
|
||||
2
Main.qml
2
Main.qml
@@ -18,6 +18,8 @@ ApplicationWindow {
|
||||
visible: true
|
||||
color: Theme.color1
|
||||
|
||||
property string packageManager: "yay"
|
||||
|
||||
ColumnLayout {
|
||||
id: mainLayout
|
||||
anchors.fill: parent
|
||||
|
||||
@@ -2,6 +2,7 @@ pragma ComponentBehavior: Bound
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import "../components" as Components
|
||||
|
||||
Item {
|
||||
id: root
|
||||
@@ -38,6 +39,12 @@ Item {
|
||||
radius: 3
|
||||
color: button.down ? Theme.color4 : button.hovered ? Theme.color5 : Theme.colorTransparent
|
||||
}
|
||||
|
||||
onClicked: menu.opened ? menu.close() : menu.open()
|
||||
}
|
||||
|
||||
Components.SettingsMenu {
|
||||
id: menu
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
115
qml/components/SettingsMenu.qml
Normal file
115
qml/components/SettingsMenu.qml
Normal file
@@ -0,0 +1,115 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
|
||||
Popup {
|
||||
id: root
|
||||
|
||||
property int parentWidth: 0
|
||||
property int parentHeight: 0
|
||||
|
||||
x: parentWidth - width
|
||||
y: parentHeight + 6
|
||||
|
||||
width: 190
|
||||
padding: 12
|
||||
modal: false
|
||||
closePolicy: Popup.CloseOnEscape | Popup.CloseOnPressOutside
|
||||
|
||||
background: Rectangle {
|
||||
color: Theme.color1
|
||||
radius: 3
|
||||
border.width: 1
|
||||
border.color: Theme.color4
|
||||
}
|
||||
|
||||
component RadioBtn: RadioButton {
|
||||
id: radio
|
||||
|
||||
padding: 8
|
||||
|
||||
contentItem: Text {
|
||||
text: radio.text
|
||||
color: Theme.color2
|
||||
font.pixelSize: 13
|
||||
leftPadding: 24
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
indicator: Rectangle {
|
||||
implicitWidth: 16
|
||||
implicitHeight: 16
|
||||
x: 8
|
||||
y: (radio.height - height) / 2
|
||||
radius: 3
|
||||
color: Theme.colorTransparent
|
||||
border.width: 1
|
||||
border.color: radio.checked ? Theme.color6 : Theme.color3
|
||||
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: 8
|
||||
height: 8
|
||||
radius: 3
|
||||
color: Theme.color6
|
||||
visible: radio.checked
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 6
|
||||
|
||||
Label {
|
||||
text: "Способ обновления"
|
||||
color: Theme.color3
|
||||
font.pixelSize: 11
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
RadioBtn {
|
||||
id: yayRadio
|
||||
text: "yay"
|
||||
}
|
||||
|
||||
RadioBtn {
|
||||
id: pacmanRadio
|
||||
text: "pacman"
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 2
|
||||
Layout.preferredHeight: 1
|
||||
color: Theme.color4
|
||||
}
|
||||
|
||||
// Пункт меню «История»: открывает список завершённых заданий.
|
||||
Button {
|
||||
id: historyButton
|
||||
text: "История"
|
||||
Layout.fillWidth: true
|
||||
leftPadding: 8
|
||||
rightPadding: 8
|
||||
topPadding: 8
|
||||
bottomPadding: 8
|
||||
|
||||
onClicked: {
|
||||
root.close()
|
||||
}
|
||||
|
||||
background: Rectangle {
|
||||
radius: 3
|
||||
color: historyButton.down ? Theme.color4 : historyButton.hovered ? Theme.color5 : Theme.colorTransparent
|
||||
}
|
||||
|
||||
contentItem: Text {
|
||||
text: historyButton.text
|
||||
font.pixelSize: 13
|
||||
color: Theme.color2
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user