update
This commit is contained in:
@@ -9,7 +9,7 @@ import qs.Modules.Bar.Extras
|
||||
import qs.Services.UI
|
||||
import qs.Widgets
|
||||
|
||||
Rectangle {
|
||||
Item {
|
||||
id: root
|
||||
|
||||
property var pluginApi: null
|
||||
@@ -18,8 +18,13 @@ Rectangle {
|
||||
property string widgetId: ""
|
||||
property string section: ""
|
||||
|
||||
readonly property string barPosition: Settings.data.bar.position
|
||||
// Bar positioning properties
|
||||
readonly property string screenName: screen ? screen.name : ""
|
||||
readonly property string barPosition: Settings.getBarPositionForScreen(screenName)
|
||||
readonly property bool isVertical: barPosition === "left" || barPosition === "right"
|
||||
readonly property real barHeight: Style.getBarHeightForScreen(screenName)
|
||||
readonly property real capsuleHeight: Style.getCapsuleHeightForScreen(screenName)
|
||||
readonly property real barFontSize: Style.getBarFontSizeForScreen(screenName)
|
||||
|
||||
property bool micActive: false
|
||||
property bool camActive: false
|
||||
@@ -44,12 +49,14 @@ Rectangle {
|
||||
readonly property bool isVisible: !hideInactive || micActive || camActive || scrActive
|
||||
|
||||
property real margins: removeMargins ? 0 : Style.marginM * 2
|
||||
implicitWidth: isVertical ? Style.capsuleHeight : Math.round(layout.implicitWidth + margins)
|
||||
implicitHeight: isVertical ? Math.round(layout.implicitHeight + margins) : Style.capsuleHeight
|
||||
|
||||
readonly property real contentWidth: isVertical ? Style.capsuleHeight : Math.round(layout.implicitWidth + margins)
|
||||
readonly property real contentHeight: isVertical ? Math.round(layout.implicitHeight + margins) : Style.capsuleHeight
|
||||
|
||||
implicitWidth: contentWidth
|
||||
implicitHeight: contentHeight
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
radius: Style.radiusM
|
||||
color: Style.capsuleColor
|
||||
visible: root.isVisible
|
||||
opacity: root.isVisible ? 1.0 : 0.0
|
||||
|
||||
@@ -221,6 +228,54 @@ Rectangle {
|
||||
return parts.length > 0 ? parts.join("\n") : "";
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: visualCapsule
|
||||
x: Style.pixelAlignCenter(parent.width, width)
|
||||
y: Style.pixelAlignCenter(parent.height, height)
|
||||
width: root.contentWidth
|
||||
height: root.contentHeight
|
||||
radius: Style.radiusM
|
||||
color: Style.capsuleColor
|
||||
border.color: Style.capsuleBorderColor
|
||||
border.width: Style.capsuleBorderWidth
|
||||
|
||||
Item {
|
||||
id: layout
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
implicitWidth: iconsLayout.implicitWidth
|
||||
implicitHeight: iconsLayout.implicitHeight
|
||||
|
||||
GridLayout {
|
||||
id: iconsLayout
|
||||
|
||||
columns: root.isVertical ? 1 : 3
|
||||
rows: root.isVertical ? 3 : 1
|
||||
|
||||
rowSpacing: root.iconSpacing
|
||||
columnSpacing: root.iconSpacing
|
||||
|
||||
NIcon {
|
||||
visible: micActive || !root.hideInactive
|
||||
icon: micActive ? "microphone" : "microphone-off"
|
||||
color: root.micColor
|
||||
}
|
||||
NIcon {
|
||||
visible: camActive || !root.hideInactive
|
||||
icon: camActive ? "camera" : "camera-off"
|
||||
color: root.camColor
|
||||
}
|
||||
NIcon {
|
||||
visible: scrActive || !root.hideInactive
|
||||
icon: scrActive ? "screen-share" : "screen-share-off"
|
||||
color: root.scrColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
acceptedButtons: Qt.RightButton
|
||||
@@ -234,40 +289,4 @@ Rectangle {
|
||||
}
|
||||
onExited: TooltipService.hide()
|
||||
}
|
||||
|
||||
Item {
|
||||
id: layout
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
|
||||
implicitWidth: iconsLayout.implicitWidth
|
||||
implicitHeight: iconsLayout.implicitHeight
|
||||
|
||||
GridLayout {
|
||||
id: iconsLayout
|
||||
|
||||
columns: root.isVertical ? 1 : 3
|
||||
rows: root.isVertical ? 3 : 1
|
||||
|
||||
rowSpacing: root.iconSpacing
|
||||
columnSpacing: root.iconSpacing
|
||||
|
||||
NIcon {
|
||||
visible: micActive || !root.hideInactive
|
||||
icon: micActive ? "microphone" : "microphone-off"
|
||||
color: root.micColor
|
||||
}
|
||||
NIcon {
|
||||
visible: camActive || !root.hideInactive
|
||||
icon: camActive ? "camera" : "camera-off"
|
||||
color: root.camColor
|
||||
}
|
||||
NIcon {
|
||||
visible: scrActive || !root.hideInactive
|
||||
icon: scrActive ? "screen-share" : "screen-share-off"
|
||||
color: root.scrColor
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user