mirror of
https://github.com/zoriya/noctalia-shell.git
synced 2026-08-15 18:43:59 +00:00
Tray: converted to Layout
This commit is contained in:
@@ -39,8 +39,9 @@ RowLayout {
|
||||
tooltipText: "Keyboard layout: " + currentLayout
|
||||
|
||||
onClicked: {
|
||||
|
||||
// You could open keyboard settings here if needed
|
||||
// For now, just show the current layout
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,26 +26,26 @@ Rectangle {
|
||||
}
|
||||
|
||||
visible: SystemTray.items.values.length > 0
|
||||
implicitWidth: tray.width + Style.marginM * scaling * 2
|
||||
implicitWidth: trayLayout.implicitWidth + Style.marginM * scaling * 2
|
||||
implicitHeight: Math.round(Style.capsuleHeight * scaling)
|
||||
radius: Math.round(Style.radiusM * scaling)
|
||||
color: Color.mSurfaceVariant
|
||||
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
|
||||
Row {
|
||||
id: tray
|
||||
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
RowLayout {
|
||||
id: trayLayout
|
||||
anchors.centerIn: parent
|
||||
spacing: Style.marginS * scaling
|
||||
|
||||
Repeater {
|
||||
id: repeater
|
||||
model: SystemTray.items
|
||||
|
||||
delegate: Item {
|
||||
width: itemSize
|
||||
height: itemSize
|
||||
Layout.preferredWidth: itemSize
|
||||
Layout.preferredHeight: itemSize
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
visible: modelData
|
||||
|
||||
IconImage {
|
||||
@@ -146,13 +146,14 @@ Rectangle {
|
||||
|
||||
function open() {
|
||||
visible = true
|
||||
|
||||
PanelService.willOpenPanel(trayPanel)
|
||||
}
|
||||
|
||||
function close() {
|
||||
visible = false
|
||||
trayMenu.item.hideMenu()
|
||||
if (trayMenu.item) {
|
||||
trayMenu.item.hideMenu()
|
||||
}
|
||||
}
|
||||
|
||||
// Clicking outside of the rectangle to close
|
||||
|
||||
@@ -185,7 +185,6 @@ Variants {
|
||||
|| "Unknown App"} · ${NotificationService.formatTimestamp(model.timestamp)}`
|
||||
color: Color.mSecondary
|
||||
font.pointSize: Style.fontSizeXS * scaling
|
||||
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
@@ -108,4 +108,4 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user