Files
metabuilder/qml/MetaBuilder/MediaChannelDetail.qml
johndoe6345789 827387d807 style(qt6): enforce 80-character line margin across all QML and JS files
88 files reformatted — zero logic changes:
- All views, components, and JS modules wrapped to 80-char margin
- Long property bindings, ternaries, and strings broken at natural points
- Theme.qml theme definitions expanded to multi-line
- StyleVariables tokens wrapped
- Section comment rulers trimmed to 80 chars

Trade-off: LOC increases from line wrapping (compact single-line properties
now span 2-3 lines). Content unchanged.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-19 15:20:01 +00:00

130 lines
3.7 KiB
QML

import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QmlComponents 1.0
CCard {
id: channelDetail
Layout.fillWidth: true
Layout.fillHeight: true
property var channel: null
signal toggleBroadcast()
function resolutionColor(res) {
switch (res) {
case "1080p": return Theme.success
case "720p": return Theme.warning
case "480p": return Theme.error
default: return Theme.textSecondary
}
}
Flickable {
anchors.fill: parent
anchors.margins: 16
contentHeight: detailCol.implicitHeight
clip: true
ColumnLayout {
id: detailCol
width: parent.width
spacing: 16
FlexRow {
Layout.fillWidth: true
spacing: 12
CText { variant: "h3"; text: channel ? channel.name : "" }
CStatusBadge {
status: channel
&& channel.status
=== "broadcasting"
? "success" : "error"
text: channel
&& channel.status
=== "broadcasting"
? "Broadcasting" : "Offline"
}
Rectangle {
width: resLabel.implicitWidth + 16
height: 24
radius: 4
color: channel
? resolutionColor(
channel.resolution)
: "transparent"
opacity: 0.15
CText {
id: resLabel
anchors.centerIn: parent
variant: "caption"
text: channel
? channel.resolution : ""
color: channel
? channelDetail
.resolutionColor(
channel.resolution)
: Theme.textSecondary
font.bold: true
}
}
Item { Layout.fillWidth: true }
CButton {
text: channel
&& channel.status
=== "broadcasting"
? "Stop Broadcast"
: "Start Broadcast"
variant: channel
&& channel.status
=== "broadcasting"
? "danger" : "primary"
onClicked: {
channelDetail.toggleBroadcast()
}
}
}
CDivider { Layout.fillWidth: true }
FlexRow {
Layout.fillWidth: true
spacing: 12
CStatCell {
label: "Viewers"
value: channel
? channel.viewers.toString()
: "0"
}
CStatCell {
label: "Resolution"
value: channel
? channel.resolution : ""
}
CStatCell {
label: "Uptime"
value: channel
? channel.uptime : ""
}
}
CDivider { Layout.fillWidth: true }
MediaChannelSchedule {
Layout.fillWidth: true
schedule: channel ? channel.schedule : []
}
Item { Layout.preferredHeight: 8 }
}
}
}