Port the AGS widgets into the shell as plugins

This commit is contained in:
2026-09-20 00:09:41 -04:00
parent c5434026a8
commit 0c422e7345
31 changed files with 1740 additions and 17 deletions
+26
View File
@@ -0,0 +1,26 @@
import QtQuick
import qs.Commons
Rectangle {
id: root
property color fillColor: Util.alpha(Color.background, Style.cardFillAlpha)
property color borderColor: Util.alpha(Color.blue, Style.cardBorderAlpha)
default property alias content: contentColumn.data
property alias spacing: contentColumn.spacing
property int padding: Style.cardPadding
color: fillColor
radius: Style.cardRadius
border.width: Style.cardBorderWidth
border.color: borderColor
implicitWidth: contentColumn.implicitWidth + padding * 2
implicitHeight: contentColumn.implicitHeight + padding * 2
Column {
id: contentColumn
anchors.fill: parent
anchors.margins: root.padding
spacing: Style.cardSpacing
}
}
+38
View File
@@ -0,0 +1,38 @@
import QtQuick
import qs.Commons
Row {
id: root
property string icon: ""
property string title: ""
spacing: Style.spaceReal(10)
Rectangle {
width: Style.spaceReal(28)
height: width
radius: Style.cardRadius
color: Util.alpha(Color.blue, 0.2)
anchors.verticalCenter: parent.verticalCenter
Text {
anchors.centerIn: parent
text: root.icon
textFormat: Text.PlainText
color: Color.blue
font.family: Style.font.family
font.pixelSize: Style.font.body
}
}
Text {
anchors.verticalCenter: parent.verticalCenter
text: root.title
textFormat: Text.PlainText
color: Color.foreground
font.family: Style.font.family
font.pixelSize: Style.font.body
font.bold: true
}
}
+34
View File
@@ -0,0 +1,34 @@
import QtQuick
import qs.Commons
Rectangle {
id: root
property string icon: ""
property bool active: false
signal activated()
implicitWidth: Style.spaceReal(26)
implicitHeight: Style.spaceReal(24)
radius: Style.cardRadius
color: root.active
? Color.accent
: (hover.hovered ? Util.alpha(Color.blue, 0.25) : "transparent")
Text {
anchors.centerIn: parent
text: root.icon
textFormat: Text.PlainText
color: root.active ? Color.background : (hover.hovered ? Color.blue : Color.magenta)
font.family: Style.font.family
font.pixelSize: Style.font.bodySmall
}
HoverHandler {
id: hover
}
TapHandler {
onTapped: root.activated()
}
}
+47
View File
@@ -0,0 +1,47 @@
import QtQuick
import qs.Commons
Item {
id: root
property string icon: ""
property string label: ""
property string value: ""
implicitHeight: Math.max(iconText.implicitHeight, labelText.implicitHeight)
Text {
id: iconText
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
width: Style.spaceReal(22)
text: root.icon
textFormat: Text.PlainText
color: Color.magenta
font.family: Style.font.family
font.pixelSize: Style.font.body
}
Text {
id: labelText
anchors.left: iconText.right
anchors.leftMargin: Style.spaceReal(8)
anchors.verticalCenter: parent.verticalCenter
text: root.label
textFormat: Text.PlainText
color: Color.foreground
font.family: Style.font.family
font.pixelSize: Style.font.bodySmall
}
Text {
anchors.right: parent.right
anchors.verticalCenter: parent.verticalCenter
text: root.value
textFormat: Text.PlainText
color: Color.foreground
font.family: Style.font.family
font.pixelSize: Style.font.bodySmall
font.bold: true
}
}
+4
View File
@@ -33,3 +33,7 @@ TextField 1.0 TextField.qml
Toggle 1.0 Toggle.qml
ToggleSwitch 1.0 ToggleSwitch.qml
WidgetButton 1.0 WidgetButton.qml
Card 1.0 Card.qml
CardHeader 1.0 CardHeader.qml
StatRow 1.0 StatRow.qml
CardIconButton 1.0 CardIconButton.qml