25 25 required property
QtObject lockService
26 26 required property
QtObject surfaces
27 27 required property
QtObject usageService
28 + required property
QtObject formatService
29 + required property string orientation
31 + readonly property bool vertical: orientation
=== "vertical" 29 33 function chipLabel(name) {
30 34 switch (
String(name)) {
98 102 function registerAnchor(name, item) {
99 - if (
!root.surfaces
|| !item
|| item.width
<= 0 || item.height
<= 0)
105 + if (
!root.surfaces
|| !item
|| !item.visible
|| item.width
<= 0 || item.height
<= 0)
102 108 const rect
= itemRectInBar(item);
121 127 function refreshSurfaceGeometry() {
123 - root.surfaces.setPopoutScreen(
Math.
round(root.width),
Math.
round(root.screen
? root.screen.height
: root.height),
Math.
round(root.height));
128 + if (root.surfaces) {
129 + const thickness
= Math.
round(root.vertical
? root.width
: root.height);
130 + root.surfaces.setPopoutScreen(
Math.
round(root.screen
? root.screen.width
: root.width),
Math.
round(root.screen
? root.screen.height
: root.height), thickness, root.orientation);
127 134 screen: root.screen
128 138 implicitHeight:
34 139 + implicitWidth: root.vertical
? (
Math.
max(
34, widgetsRow.implicitWidth, clockStack.width, workspaceStrip.implicitWidth)
+ 12)
: root.width
129 140 color:
"transparent" 130 141 WlrLayershell.namespace:
"nuguland-bar" 131 142 WlrLayershell.layer:
WlrLayer.Top
152 + right:
!root.vertical
153 + bottom: root.vertical
145 159 anchors.fill: parent
146 160 color:
"transparent" 149 164 anchors.left: parent.left
150 - anchors.right: parent.right
151 165 anchors.bottom: parent.bottom
166 + anchors.right: root.vertical
? undefined : parent.right
167 + anchors.top: root.vertical
? parent.top
: undefined 168 + width: root.vertical
? 1 : undefined 169 + height: root.vertical
? undefined : 1 153 170 color: root.theme
? root.theme.withAlpha(root.theme.ui.accent,
0.55)
: "transparent" 178 + visible:
!root.vertical
161 179 popoutName:
"clock" 162 180 label: root.chipLabel(
"clock")
163 181 width: preferredWidth
170 188 anchors.verticalCenter: parent.verticalCenter
198 + readonly property bool
selected: root.surfaces
&& root.surfaces.popoutName
=== "clock" 199 + readonly property
var clockParts:
String(root.chipLabel(
"clock")).split(
":")
200 + readonly property string
hh: clockStack.clockParts[
0]
|| "--" 201 + readonly property string
mm: clockStack.clockParts[
1]
|| "--" 203 + visible: root.vertical
204 + width:
Math.
max(
34, stackColumn.implicitWidth
+ 12)
205 + height: stackColumn.implicitHeight
+ 12 207 + anchors.horizontalCenter: parent.horizontalCenter
208 + y:
Math.
min(parent.height
/ 2 - height
/ 2, widgetsRow.y
- height
- 12)
209 + color:
!root.theme
? "transparent" : (selected
? root.theme.ui.focus
: root.theme.withAlpha(root.theme.ui.minor,
0.1))
211 + Component.onCompleted:
Qt.callLater(()
=> root.registerAnchor(
"clock", clockStack))
212 + onXChanged: root.registerAnchor(
"clock", clockStack)
213 + onYChanged: root.registerAnchor(
"clock", clockStack)
214 + onWidthChanged: root.registerAnchor(
"clock", clockStack)
215 + onHeightChanged: root.registerAnchor(
"clock", clockStack)
220 + anchors.centerIn: parent
224 + anchors.horizontalCenter: parent.horizontalCenter
227 + text: clockStack.hh
228 + color:
!root.theme
? "transparent" : (clockStack.selected
? root.theme.content.backdrop
: root.theme.content.normal)
232 + anchors.horizontalCenter: parent.horizontalCenter
236 + color: root.theme
? root.theme.ui.accent
: "transparent" 240 + anchors.horizontalCenter: parent.horizontalCenter
243 + text: clockStack.mm
244 + color:
!root.theme
? "transparent" : (clockStack.selected
? root.theme.content.backdrop
: root.theme.content.normal)
250 + checked: clockStack.selected
253 + root.surfaces.hoverRegisteredPopout(
"clock");
258 + root.activatePopout(
"clock");
177 270 id: workspaceStrip
272 + flow: root.vertical
? GridLayout.TopToBottom
: GridLayout.LeftToRight
179 273 anchors.left: parent.left
180 - anchors.leftMargin:
10 181 - anchors.right: clockChip.left
182 - anchors.rightMargin:
12 183 - anchors.verticalCenter: parent.verticalCenter
274 + anchors.top: root.vertical
? parent.top
: undefined 275 + anchors.leftMargin: root.vertical
? 0 : 10 276 + anchors.topMargin: root.vertical
? 10 : 0 277 + anchors.right: root.vertical
? parent.right
: clockChip.left
278 + anchors.rightMargin: root.vertical
? 0 : 12 279 + anchors.bottom: root.vertical
? clockStack.top
: undefined 280 + anchors.bottomMargin: root.vertical
? 10 : 0 281 + anchors.verticalCenter: root.vertical
? undefined : parent.verticalCenter
282 + anchors.horizontalCenter: root.vertical
? parent.horizontalCenter
: undefined 198 297 required property
var modelData
200 299 width: tray.width
300 + height: tray.height
301 + Layout.alignment:
Qt.AlignCenter
206 - anchors.verticalCenter: parent.verticalCenter
207 - width: pillRow.implicitWidth
+ 12 306 + anchors.centerIn: parent
307 + width: pills.implicitWidth
+ 12 308 + height: pills.implicitHeight
+ 12 210 310 color: root.theme
? root.theme.withAlpha(root.theme.ui.minor,
0.07)
: "transparent" 215 317 anchors.centerIn: parent
318 + flow: root.vertical
? GridLayout.TopToBottom
: GridLayout.LeftToRight
219 323 model: groupItem.modelData.workspaces
224 328 required property
var modelData
226 330 width: workspaceChip.width
331 + height: workspaceChip.height
332 + Layout.alignment:
Qt.AlignCenter
230 335 id: workspaceChip
232 337 readonly property bool
active:
!!pillWrap.modelData.is_focused
233 - readonly property string
workspaceLabel:
`${pillWrap.modelData.idx
|| pillWrap.modelData.id
|| "?"}${pillWrap.modelData.name
? ` ${pillWrap.modelData.name}
` : ""}
`.toLowerCase()
338 + readonly property string
workspaceLabel: root.vertical
? String(pillWrap.modelData.idx
|| pillWrap.modelData.id
|| "?")
: `${pillWrap.modelData.idx
|| pillWrap.modelData.id
|| "?"}${pillWrap.modelData.name
? ` ${pillWrap.modelData.name}
` : ""}
`.toLowerCase()
235 - anchors.verticalCenter: parent.verticalCenter
340 + anchors.centerIn: parent
236 341 width:
Math.
max(
30, workspaceText.implicitWidth
+ 16)
287 - anchors.right: parent.right
288 - anchors.rightMargin:
10 289 - anchors.verticalCenter: parent.verticalCenter
393 + flow: root.vertical
? GridLayout.TopToBottom
: GridLayout.LeftToRight
394 + anchors.right: root.vertical
? undefined : parent.right
395 + anchors.rightMargin: root.vertical
? 0 : 10 396 + anchors.bottom: root.vertical
? parent.bottom
: undefined 397 + anchors.bottomMargin: root.vertical
? 10 : 0 398 + anchors.horizontalCenter: root.vertical
? parent.horizontalCenter
: undefined 399 + anchors.verticalCenter: root.vertical
? undefined : parent.verticalCenter
293 404 model: root.usageService
? root.usageService.layoutOrder
: []
296 407 required property
var modelData
298 409 popoutName: modelData
299 - label: root.chipLabel(modelData)
410 + label: root.vertical
? root.formatService.abbreviate(root.chipLabel(modelData))
: root.chipLabel(modelData)