Tray: converted to Layout
This commit is contained in:
parent
7feab63e5b
commit
7b5c97f38a
4 changed files with 14 additions and 13 deletions
|
|
@ -39,6 +39,7 @@ RowLayout {
|
||||||
tooltipText: "Keyboard layout: " + currentLayout
|
tooltipText: "Keyboard layout: " + currentLayout
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
|
|
||||||
// You could open keyboard settings here if needed
|
// You could open keyboard settings here if needed
|
||||||
// For now, just show the current layout
|
// For now, just show the current layout
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,26 +26,26 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
visible: SystemTray.items.values.length > 0
|
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)
|
implicitHeight: Math.round(Style.capsuleHeight * scaling)
|
||||||
radius: Math.round(Style.radiusM * scaling)
|
radius: Math.round(Style.radiusM * scaling)
|
||||||
color: Color.mSurfaceVariant
|
color: Color.mSurfaceVariant
|
||||||
|
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
|
||||||
Row {
|
RowLayout {
|
||||||
id: tray
|
id: trayLayout
|
||||||
|
anchors.centerIn: parent
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
spacing: Style.marginS * scaling
|
spacing: Style.marginS * scaling
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: repeater
|
id: repeater
|
||||||
model: SystemTray.items
|
model: SystemTray.items
|
||||||
|
|
||||||
delegate: Item {
|
delegate: Item {
|
||||||
width: itemSize
|
Layout.preferredWidth: itemSize
|
||||||
height: itemSize
|
Layout.preferredHeight: itemSize
|
||||||
|
Layout.alignment: Qt.AlignCenter
|
||||||
visible: modelData
|
visible: modelData
|
||||||
|
|
||||||
IconImage {
|
IconImage {
|
||||||
|
|
@ -146,13 +146,14 @@ Rectangle {
|
||||||
|
|
||||||
function open() {
|
function open() {
|
||||||
visible = true
|
visible = true
|
||||||
|
|
||||||
PanelService.willOpenPanel(trayPanel)
|
PanelService.willOpenPanel(trayPanel)
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
visible = false
|
visible = false
|
||||||
trayMenu.item.hideMenu()
|
if (trayMenu.item) {
|
||||||
|
trayMenu.item.hideMenu()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Clicking outside of the rectangle to close
|
// Clicking outside of the rectangle to close
|
||||||
|
|
|
||||||
|
|
@ -185,7 +185,6 @@ Variants {
|
||||||
|| "Unknown App"} · ${NotificationService.formatTimestamp(model.timestamp)}`
|
|| "Unknown App"} · ${NotificationService.formatTimestamp(model.timestamp)}`
|
||||||
color: Color.mSecondary
|
color: Color.mSecondary
|
||||||
font.pointSize: Style.fontSizeXS * scaling
|
font.pointSize: Style.fontSizeXS * scaling
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue