Files
metabuilder/qml/MetaBuilder/CComponentTreeRow.qml
johndoe6345789 786f91ec64 Add QML Material lib, demo email UI, and QML refactor
Add a large set of QML components (qml/Material, qml/MetaBuilder, qml/dbal) and a QmlComponents symlink for local development; migrate many frontends/qt6 files into qml/qt6. Replace the email client bootloader with a self-contained demo UI using FakeMUI primitives (MailboxLayout, ThreadList, EmailHeader, ComposeWindow), demo data, handlers, and new folder-navigation styles in globals.css. Update several QML component APIs to new signal/handler names (e.g. selectAllChanged→selectAllToggled, pageChanged→pageRequested, *Changed→*Edited) to standardize events. Add find_config_files() to frontends/qt6/generate_cmake.py to include config JS/JSON in QML/files and resources. Also add /frontends/qt6/_build to .gitignore.
2026-03-19 10:18:09 +00:00

75 lines
1.9 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
Rectangle {
id: root
property var node
property bool isSelected: false
property int childCount: 0
signal clicked()
width: parent ? parent.width : 400
height: 40
radius: 6
color: isSelected ? Qt.rgba(Theme.primary.r, Theme.primary.g, Theme.primary.b, 0.12)
: mouseArea.containsMouse ? Theme.surface : "transparent"
function typeBadgeColor(nodeType) {
switch (nodeType) {
case "container": return "#5C6BC0"
case "layout": return "#26A69A"
case "widget": return "#FFA726"
case "atom": return "#EF5350"
default: return Theme.primary
}
}
MouseArea {
id: mouseArea
anchors.fill: parent
hoverEnabled: true
cursorShape: Qt.PointingHandCursor
onClicked: root.clicked()
}
RowLayout {
anchors.fill: parent
anchors.leftMargin: 12 + (root.node ? root.node.depth * 24 : 0)
anchors.rightMargin: 12
spacing: 8
CText {
visible: root.node && root.node.depth > 0
variant: "caption"
text: "\u251C\u2500"
opacity: 0.4
}
Rectangle {
width: 8; height: 8; radius: 4
color: root.node ? typeBadgeColor(root.node.type) : "#9e9e9e"
}
CText {
variant: root.isSelected ? "body1" : "body2"
text: root.node ? root.node.name : ""
Layout.fillWidth: true
}
CText {
variant: "caption"
text: root.node && root.node.visible ? "\uD83D\uDC41" : "\u2014"
opacity: root.node && root.node.visible ? 0.6 : 0.3
}
CBadge {
visible: root.childCount > 0
text: root.childCount.toString()
}
}
}