Settings: About polishing
This commit is contained in:
parent
484d38a096
commit
8a6ac222bb
1 changed files with 43 additions and 99 deletions
|
|
@ -11,7 +11,7 @@ ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property string latestVersion: GitHub.latestVersion
|
property string latestVersion: GitHub.latestVersion
|
||||||
property string currentVersion: "v1.2.1" // Fallback version
|
property string currentVersion: "v2.0.0" // Fallback version
|
||||||
property var contributors: GitHub.contributors
|
property var contributors: GitHub.contributors
|
||||||
|
|
||||||
spacing: 0
|
spacing: 0
|
||||||
|
|
@ -45,8 +45,8 @@ ColumnLayout {
|
||||||
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
padding: 16
|
padding: Style.marginLarge * scaling
|
||||||
rightPadding: 12
|
rightPadding: Style.marginMedium * scaling
|
||||||
clip: true
|
clip: true
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||||
|
|
@ -57,51 +57,47 @@ ColumnLayout {
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: "Noctalia: quiet by design"
|
text: "Noctalia: quiet by design"
|
||||||
font.pointSize: 24 * Scaling.scale(screen)
|
font.pointSize: Style.fontSizeXXL * scaling
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
color: Colors.textPrimary
|
color: Colors.textPrimary
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.bottomMargin: 8 * Scaling.scale(screen)
|
Layout.bottomMargin: Style.marginSmall * scaling
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: "It may just be another quickshell setup but it won't get in your way."
|
text: "It may just be another quickshell setup but it won't get in your way."
|
||||||
font.pointSize: 14 * Scaling.scale(screen)
|
font.pointSize: Style.fontSizeMedium * scaling
|
||||||
color: Colors.textSecondary
|
color: Colors.textSecondary
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.bottomMargin: Style.marginLarge * scaling.scale(screen)
|
Layout.bottomMargin: Style.marginLarge * scaling
|
||||||
}
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
columns: 2
|
columns: 2
|
||||||
rowSpacing: 4
|
rowSpacing: Style.marginTiny * scaling
|
||||||
columnSpacing: 8
|
columnSpacing: Style.marginSmall * scaling
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: "Latest Version:"
|
text: "Latest Version:"
|
||||||
font.pointSize: Style.marginLarge * scaling.scale(screen)
|
|
||||||
color: Colors.textSecondary
|
color: Colors.textSecondary
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: root.latestVersion
|
text: root.latestVersion
|
||||||
font.pointSize: Style.marginLarge * scaling.scale(screen)
|
|
||||||
color: Colors.textPrimary
|
color: Colors.textPrimary
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: "Installed Version:"
|
text: "Installed Version:"
|
||||||
font.pointSize: Style.marginLarge * scaling.scale(screen)
|
|
||||||
color: Colors.textSecondary
|
color: Colors.textSecondary
|
||||||
Layout.alignment: Qt.AlignRight
|
Layout.alignment: Qt.AlignRight
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: root.currentVersion
|
text: root.currentVersion
|
||||||
font.pointSize: Style.marginLarge * scaling.scale(screen)
|
|
||||||
color: Colors.textPrimary
|
color: Colors.textPrimary
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
}
|
}
|
||||||
|
|
@ -109,10 +105,10 @@ ColumnLayout {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.topMargin: 8
|
Layout.topMargin: Style.marginSmall * scaling
|
||||||
Layout.preferredWidth: updateText.implicitWidth + 46
|
Layout.preferredWidth: updateText.implicitWidth + 46 * scaling
|
||||||
Layout.preferredHeight: 32
|
Layout.preferredHeight: 32 * scaling
|
||||||
radius: 20
|
radius: Style.radiusLarge * scaling
|
||||||
color: updateArea.containsMouse ? Colors.accentPrimary : "transparent"
|
color: updateArea.containsMouse ? Colors.accentPrimary : "transparent"
|
||||||
border.color: Colors.accentPrimary
|
border.color: Colors.accentPrimary
|
||||||
border.width: 1
|
border.width: 1
|
||||||
|
|
@ -141,15 +137,14 @@ ColumnLayout {
|
||||||
NText {
|
NText {
|
||||||
text: "system_update"
|
text: "system_update"
|
||||||
font.family: "Material Symbols Outlined"
|
font.family: "Material Symbols Outlined"
|
||||||
font.pointSize: 18 * Scaling.scale(screen)
|
font.pointSize: 18 * scaling
|
||||||
color: updateArea.containsMouse ? Colors.backgroundPrimary : Colors.accentPrimary
|
color: updateArea.containsMouse ? Colors.backgroundPrimary : Colors.accentPrimary
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
id: updateText
|
id: updateText
|
||||||
|
|
||||||
text: "Download latest release"
|
text: "Download latest release"
|
||||||
font.pointSize: 14 * Scaling.scale(screen)
|
font.pointSize: 14 * scaling
|
||||||
color: updateArea.containsMouse ? Colors.backgroundPrimary : Colors.accentPrimary
|
color: updateArea.containsMouse ? Colors.backgroundPrimary : Colors.accentPrimary
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -166,38 +161,26 @@ ColumnLayout {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Separator
|
NDivider {
|
||||||
Rectangle {
|
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 26
|
Layout.topMargin: Style.marginLarge * 2 * scaling
|
||||||
Layout.bottomMargin: 18
|
Layout.bottomMargin: Style.marginLarge * scaling
|
||||||
height: 1
|
|
||||||
color: Colors.outline
|
|
||||||
opacity: 0.3
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: "Contributors"
|
text: `Contributors: ${root.contributors.length}`
|
||||||
font.pointSize: 18 * Scaling.scale(screen)
|
font.pointSize: Style.fontSizeLarge * scaling
|
||||||
font.weight: Style.fontWeightBold
|
font.weight: Style.fontWeightBold
|
||||||
color: Colors.textPrimary
|
color: Colors.textPrimary
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.topMargin: 32
|
Layout.topMargin: Style.marginLarge * 2
|
||||||
}
|
|
||||||
|
|
||||||
NText {
|
|
||||||
text: "(" + root.contributors.length + ")"
|
|
||||||
font.pointSize: 14 * Scaling.scale(screen)
|
|
||||||
color: Colors.textSecondary
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
Layout.topMargin: 4
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
Layout.preferredWidth: 200 * 4
|
Layout.preferredWidth: 200 * Style.marginTiny * scaling
|
||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
Layout.topMargin: 16
|
Layout.topMargin: Style.marginLarge * scaling
|
||||||
clip: true
|
clip: true
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||||
|
|
@ -206,86 +189,47 @@ ColumnLayout {
|
||||||
id: contributorsGrid
|
id: contributorsGrid
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
width: 200 * 4
|
width: 200 * 4 * scaling
|
||||||
height: Math.ceil(root.contributors.length / 4) * 100
|
height: Math.ceil(root.contributors.length / 4) * 100
|
||||||
cellWidth: 200
|
cellWidth: 200 * scaling
|
||||||
cellHeight: 100
|
cellHeight: 100 * scaling
|
||||||
model: root.contributors
|
model: root.contributors
|
||||||
|
|
||||||
delegate: Rectangle {
|
delegate: Rectangle {
|
||||||
width: contributorsGrid.cellWidth - 16
|
width: contributorsGrid.cellWidth - Style.marginLarge * scaling
|
||||||
height: contributorsGrid.cellHeight - 4
|
height: contributorsGrid.cellHeight - Style.marginTiny * scaling
|
||||||
radius: 20
|
radius: Style.radiusLarge * scaling
|
||||||
color: contributorArea.containsMouse ? Colors.hover : "transparent"
|
color: contributorArea.containsMouse ? Colors.hover : "transparent"
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 8
|
anchors.margins: Style.marginSmall * scaling
|
||||||
spacing: 12
|
spacing: Style.marginMedium * scaling
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.preferredWidth: 40
|
Layout.preferredWidth: 64 * scaling
|
||||||
Layout.preferredHeight: 40
|
Layout.preferredHeight: 64 * scaling
|
||||||
|
|
||||||
Image {
|
|
||||||
id: avatarImage
|
|
||||||
|
|
||||||
|
NImageRounded {
|
||||||
|
imagePath: modelData.avatar_url || ""
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: modelData.avatar_url || ""
|
anchors.margins: Style.marginTiny * scaling
|
||||||
sourceSize: Qt.size(80, 80)
|
fallbackIcon: "person"
|
||||||
visible: false
|
borderColor: Colors.accentPrimary
|
||||||
mipmap: true
|
borderWidth: Math.max(1, Style.borderMedium * scaling)
|
||||||
smooth: true
|
imageRadius: width * 0.5
|
||||||
asynchronous: true
|
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
cache: true
|
|
||||||
|
|
||||||
onStatusChanged: {
|
|
||||||
if (status === Image.Error) {
|
|
||||||
console.log("[About] Failed to load avatar for", modelData.login, "URL:", modelData.avatar_url)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
MultiEffect {
|
|
||||||
anchors.fill: parent
|
|
||||||
source: avatarImage
|
|
||||||
maskEnabled: true
|
|
||||||
maskSource: mask
|
|
||||||
}
|
|
||||||
|
|
||||||
Item {
|
|
||||||
id: mask
|
|
||||||
|
|
||||||
anchors.fill: parent
|
|
||||||
layer.enabled: true
|
|
||||||
visible: false
|
|
||||||
|
|
||||||
Rectangle {
|
|
||||||
anchors.fill: parent
|
|
||||||
radius: parent.width / 2
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
NText {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "person"
|
|
||||||
font.family: "Material Symbols Outlined"
|
|
||||||
font.pointSize: 24 * Scaling.scale(screen)
|
|
||||||
color: contributorArea.containsMouse ? Colors.backgroundPrimary : Colors.textPrimary
|
|
||||||
visible: !avatarImage.source || avatarImage.status !== Image.Ready
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
spacing: 4
|
spacing: Style.marginTiny * scaling
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: modelData.login || "Unknown"
|
text: modelData.login || "Unknown"
|
||||||
font.pointSize: 13 * Scaling.scale(screen)
|
font.weight: Style.fontWeightBold
|
||||||
color: contributorArea.containsMouse ? Colors.backgroundPrimary : Colors.textPrimary
|
color: contributorArea.containsMouse ? Colors.backgroundPrimary : Colors.textPrimary
|
||||||
elide: Text.ElideRight
|
elide: Text.ElideRight
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
|
@ -293,7 +237,7 @@ ColumnLayout {
|
||||||
|
|
||||||
NText {
|
NText {
|
||||||
text: (modelData.contributions || 0) + " commits"
|
text: (modelData.contributions || 0) + " commits"
|
||||||
font.pointSize: 11 * Scaling.scale(screen)
|
font.pointSize: Style.fontSizeSmall * scaling
|
||||||
color: contributorArea.containsMouse ? Colors.backgroundPrimary : Colors.textSecondary
|
color: contributorArea.containsMouse ? Colors.backgroundPrimary : Colors.textSecondary
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue