Rewrite the launcher in MoonBit (old code moves to legacy/) (#1)
This commit was merged in pull request #1.
This commit is contained in:
1 parent
7d2bf5996f
commit
2fa7bd745b
150 files changed
+8319
-462
No files matched your search
@@ -0,0 +1,61 @@
|
||||
import QtQuick
|
||||
|
||||
// An app: its icon over its name.
|
||||
Item {
|
||||
id: root
|
||||
property string key: ""
|
||||
property string label: ""
|
||||
property int generation: 0
|
||||
property real iconSize: 40
|
||||
property real fontSize: 11
|
||||
property real spacing: 4
|
||||
property bool checkable: false // the drawer's pick mode: a check circle in the corner
|
||||
property bool checked: false
|
||||
property bool pressed: false
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
radius: 12
|
||||
color: Qt.rgba(1, 1, 1, .12)
|
||||
visible: root.pressed
|
||||
}
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
width: parent.width
|
||||
spacing: root.spacing
|
||||
AppIcon {
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
key: root.key
|
||||
generation: root.generation
|
||||
size: root.iconSize
|
||||
}
|
||||
Text {
|
||||
width: parent.width - 4
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
text: root.label
|
||||
color: "white"
|
||||
font.pixelSize: root.fontSize
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
elide: Text.ElideRight
|
||||
style: Text.Raised
|
||||
styleColor: Qt.rgba(0, 0, 0, .55)
|
||||
}
|
||||
}
|
||||
Rectangle {
|
||||
visible: root.checkable
|
||||
width: 20; height: 20; radius: 10
|
||||
x: parent.width / 2 + root.iconSize / 2 - 12
|
||||
y: 2
|
||||
color: root.checked ? "white" : Qt.rgba(0, 0, 0, .35)
|
||||
border.color: "white"
|
||||
border.width: 2
|
||||
Text {
|
||||
anchors.centerIn: parent
|
||||
visible: root.checked
|
||||
text: "✓"
|
||||
color: "#111"
|
||||
font.pixelSize: 12
|
||||
font.bold: true
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user