Port the AGS widgets into the shell as plugins
This commit is contained in:
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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()
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user