Settings: cleanup About
Gridview could need a little love
This commit is contained in:
parent
03043b283f
commit
922a8183d2
1 changed files with 115 additions and 122 deletions
|
|
@ -7,7 +7,7 @@ import Quickshell.Io
|
||||||
import qs.Components
|
import qs.Components
|
||||||
import qs.Settings
|
import qs.Settings
|
||||||
|
|
||||||
Item {
|
ColumnLayout {
|
||||||
id: root
|
id: root
|
||||||
|
|
||||||
property string latestVersion: "Unknown"
|
property string latestVersion: "Unknown"
|
||||||
|
|
@ -44,6 +44,10 @@ Item {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
spacing: 0
|
||||||
|
anchors.fill: parent
|
||||||
|
anchors.margins: 0
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
id: currentVersionProcess
|
id: currentVersionProcess
|
||||||
|
|
||||||
|
|
@ -148,31 +152,35 @@ Item {
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView {
|
ScrollView {
|
||||||
anchors.fill: parent
|
id: scrollView
|
||||||
padding: 0
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
|
padding: 16
|
||||||
rightPadding: 12
|
rightPadding: 12
|
||||||
clip: true
|
clip: true
|
||||||
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
||||||
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
ScrollBar.vertical.policy: ScrollBar.AsNeeded
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
id: mainLayout
|
width: scrollView.availableWidth
|
||||||
|
spacing: 0
|
||||||
width: parent.availableWidth
|
|
||||||
anchors.top: parent.top
|
|
||||||
spacing: 8
|
|
||||||
|
|
||||||
Item {
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.preferredHeight: 16
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: "Noctalia"
|
text: "Noctalia: quiet by design"
|
||||||
font.pixelSize: 24 * Theme.uiScale
|
font.pixelSize: 24 * Theme.uiScale
|
||||||
font.bold: true
|
font.bold: true
|
||||||
color: Theme.textPrimary
|
color: Theme.textPrimary
|
||||||
Layout.alignment: Qt.AlignCenter
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
Layout.bottomMargin: 8 * Theme.uiScale
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: "It may just be another quickshell setup but it won't get in your way."
|
||||||
|
font.pixelSize: 14 * Theme.uiScale
|
||||||
|
color: Theme.textSecondary
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
Layout.bottomMargin: 16 * Theme.uiScale
|
||||||
}
|
}
|
||||||
|
|
||||||
GridLayout {
|
GridLayout {
|
||||||
|
|
@ -273,14 +281,7 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Text {
|
// Separator
|
||||||
text: "Description something something <.< I hate writing text..."
|
|
||||||
font.pixelSize: 14 * Theme.uiScale
|
|
||||||
color: Theme.textSecondary
|
|
||||||
Layout.alignment: Qt.AlignCenter
|
|
||||||
Layout.topMargin: 24
|
|
||||||
}
|
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.topMargin: 26
|
Layout.topMargin: 26
|
||||||
|
|
@ -292,8 +293,10 @@ Item {
|
||||||
|
|
||||||
ColumnLayout {
|
ColumnLayout {
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
|
Layout.fillHeight: true
|
||||||
Layout.leftMargin: 32
|
Layout.leftMargin: 32
|
||||||
Layout.rightMargin: 32
|
Layout.rightMargin: 32
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
spacing: 16
|
spacing: 16
|
||||||
|
|
||||||
RowLayout {
|
RowLayout {
|
||||||
|
|
@ -315,124 +318,114 @@ Item {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollView {
|
GridView {
|
||||||
Layout.fillWidth: true
|
id: contributorsGrid
|
||||||
Layout.preferredHeight: 300
|
|
||||||
clip: true
|
|
||||||
|
|
||||||
Item {
|
Layout.leftMargin: 32
|
||||||
anchors.fill: parent
|
Layout.rightMargin: 32
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
|
width: 200 * 3
|
||||||
|
height: 300
|
||||||
|
cellWidth: 200
|
||||||
|
cellHeight: 100
|
||||||
|
model: root.contributors
|
||||||
|
|
||||||
GridView {
|
delegate: Rectangle {
|
||||||
id: contributorsGrid
|
width: contributorsGrid.cellWidth - 8
|
||||||
|
height: contributorsGrid.cellHeight - 4
|
||||||
|
radius: 20
|
||||||
|
color: contributorArea.containsMouse ? Theme.highlight : "transparent"
|
||||||
|
|
||||||
anchors.centerIn: parent
|
RowLayout {
|
||||||
width: Math.min(parent.width, Math.ceil(root.contributors.length / 3) * 200)
|
anchors.fill: parent
|
||||||
height: parent.height
|
anchors.margins: 8
|
||||||
cellWidth: 200
|
spacing: 12
|
||||||
cellHeight: 100
|
|
||||||
model: root.contributors
|
|
||||||
|
|
||||||
delegate: Rectangle {
|
Item {
|
||||||
width: contributorsGrid.cellWidth - 4
|
Layout.alignment: Qt.AlignVCenter
|
||||||
height: contributorsGrid.cellHeight - 10
|
Layout.preferredWidth: 40
|
||||||
radius: 20
|
Layout.preferredHeight: 40
|
||||||
color: contributorArea.containsMouse ? Theme.highlight : "transparent"
|
|
||||||
|
Image {
|
||||||
|
id: avatarImage
|
||||||
|
|
||||||
RowLayout {
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.margins: 8
|
source: modelData.avatar_url || ""
|
||||||
spacing: 12
|
sourceSize: Qt.size(80, 80)
|
||||||
|
visible: false
|
||||||
|
mipmap: true
|
||||||
|
smooth: true
|
||||||
|
asynchronous: true
|
||||||
|
fillMode: Image.PreserveAspectCrop
|
||||||
|
cache: true
|
||||||
|
}
|
||||||
|
|
||||||
Item {
|
MultiEffect {
|
||||||
Layout.alignment: Qt.AlignVCenter
|
anchors.fill: parent
|
||||||
Layout.preferredWidth: 40
|
source: avatarImage
|
||||||
Layout.preferredHeight: 40
|
maskEnabled: true
|
||||||
|
maskSource: mask
|
||||||
|
}
|
||||||
|
|
||||||
Image {
|
Item {
|
||||||
id: avatarImage
|
id: mask
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
source: modelData.avatar_url || ""
|
layer.enabled: true
|
||||||
sourceSize: Qt.size(80, 80)
|
visible: false
|
||||||
visible: false
|
|
||||||
mipmap: true
|
|
||||||
smooth: true
|
|
||||||
asynchronous: true
|
|
||||||
fillMode: Image.PreserveAspectCrop
|
|
||||||
cache: true
|
|
||||||
}
|
|
||||||
|
|
||||||
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: avatarImage.width / 2
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: "person"
|
|
||||||
font.family: "Material Symbols Outlined"
|
|
||||||
font.pixelSize: 24 * Theme.uiScale
|
|
||||||
color: contributorArea.containsMouse ? Theme.backgroundPrimary : Theme.textPrimary
|
|
||||||
visible: !avatarImage.source || avatarImage.status !== Image.Ready
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ColumnLayout {
|
|
||||||
spacing: 4
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: modelData.login || "Unknown"
|
|
||||||
font.pixelSize: 13 * Theme.uiScale
|
|
||||||
color: contributorArea.containsMouse ? Theme.backgroundPrimary : Theme.textPrimary
|
|
||||||
elide: Text.ElideRight
|
|
||||||
Layout.fillWidth: true
|
|
||||||
}
|
|
||||||
|
|
||||||
Text {
|
|
||||||
text: (modelData.contributions || 0) + " commits"
|
|
||||||
font.pixelSize: 11 * Theme.uiScale
|
|
||||||
color: contributorArea.containsMouse ? Theme.backgroundPrimary : Theme.textSecondary
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Rectangle {
|
||||||
|
anchors.fill: parent
|
||||||
|
radius: avatarImage.width / 2
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
MouseArea {
|
Text {
|
||||||
id: contributorArea
|
anchors.centerIn: parent
|
||||||
|
text: "person"
|
||||||
anchors.fill: parent
|
font.family: "Material Symbols Outlined"
|
||||||
hoverEnabled: true
|
font.pixelSize: 24 * Theme.uiScale
|
||||||
cursorShape: Qt.PointingHandCursor
|
color: contributorArea.containsMouse ? Theme.backgroundPrimary : Theme.textPrimary
|
||||||
onClicked: {
|
visible: !avatarImage.source || avatarImage.status !== Image.Ready
|
||||||
if (modelData.html_url)
|
|
||||||
Quickshell.execDetached(["xdg-open", modelData.html_url]);
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ColumnLayout {
|
||||||
|
spacing: 4
|
||||||
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
Layout.fillWidth: true
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: modelData.login || "Unknown"
|
||||||
|
font.pixelSize: 13 * Theme.uiScale
|
||||||
|
color: contributorArea.containsMouse ? Theme.backgroundPrimary : Theme.textPrimary
|
||||||
|
elide: Text.ElideRight
|
||||||
|
Layout.fillWidth: true
|
||||||
|
}
|
||||||
|
|
||||||
|
Text {
|
||||||
|
text: (modelData.contributions || 0) + " commits"
|
||||||
|
font.pixelSize: 11 * Theme.uiScale
|
||||||
|
color: contributorArea.containsMouse ? Theme.backgroundPrimary : Theme.textSecondary
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
MouseArea {
|
||||||
|
id: contributorArea
|
||||||
|
|
||||||
|
anchors.fill: parent
|
||||||
|
hoverEnabled: true
|
||||||
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: {
|
||||||
|
if (modelData.html_url)
|
||||||
|
Quickshell.execDetached(["xdg-open", modelData.html_url]);
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue