mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
Don't create binding loop
Signed-off-by: Felix Weilbach <felix.weilbach@nextcloud.com>
This commit is contained in:
parent
8a2097e7b9
commit
fa37f5c2bc
@ -7,5 +7,6 @@
|
||||
<file>theme/Style/qmldir</file>
|
||||
<file>src/gui/tray/ActivityActionButton.qml</file>
|
||||
<file>src/gui/tray/ActivityItem.qml</file>
|
||||
<file>src/gui/tray/AutoSizingMenu.qml</file>
|
||||
</qresource>
|
||||
</RCC>
|
||||
|
||||
15
src/gui/tray/AutoSizingMenu.qml
Normal file
15
src/gui/tray/AutoSizingMenu.qml
Normal file
@ -0,0 +1,15 @@
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.3
|
||||
|
||||
Menu {
|
||||
width: {
|
||||
var result = 0;
|
||||
var padding = 0;
|
||||
for (var i = 0; i < count; ++i) {
|
||||
var item = itemAt(i);
|
||||
result = Math.max(item.contentItem.implicitWidth, result);
|
||||
padding = Math.max(item.padding, padding);
|
||||
}
|
||||
return result + padding * 2;
|
||||
}
|
||||
}
|
||||
@ -508,12 +508,10 @@ Window {
|
||||
Accessible.name: qsTr("More apps")
|
||||
Accessible.onPressAction: trayWindowAppsButton.clicked()
|
||||
|
||||
Menu {
|
||||
AutoSizingMenu {
|
||||
id: appsMenu
|
||||
y: (trayWindowAppsButton.y + trayWindowAppsButton.height + 2)
|
||||
readonly property Item listContentItem: contentItem.contentItem
|
||||
width: Math.min(listContentItem.childrenRect.width + 4, Style.trayWindowWidth / 2)
|
||||
height: Math.min(implicitHeight, maxMenuHeight)
|
||||
closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape
|
||||
|
||||
background: Rectangle {
|
||||
@ -531,24 +529,9 @@ Window {
|
||||
text: appName
|
||||
font.pixelSize: Style.topLinePixelSize
|
||||
icon.source: appIconUrl
|
||||
width: contentItem.implicitWidth + leftPadding + rightPadding
|
||||
onTriggered: UserAppsModel.openAppUrl(appUrl)
|
||||
hoverEnabled: true
|
||||
|
||||
background: Item {
|
||||
width: appsMenu.width
|
||||
height: parent.height
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 1
|
||||
color: appEntry.hovered ? Style.lightHover : "transparent"
|
||||
}
|
||||
|
||||
Accessible.role: Accessible.PopupMenu
|
||||
Accessible.name: qsTr("Apps menu")
|
||||
}
|
||||
|
||||
Accessible.role: Accessible.MenuItem
|
||||
Accessible.name: qsTr("Open %1 in browser").arg(appName)
|
||||
Accessible.onPressAction: appEntry.triggered()
|
||||
|
||||
Loading…
Reference in New Issue
Block a user