mirror of
https://github.com/nextcloud/desktop.git
synced 2025-10-26 11:17:43 +00:00
fix: accounts menu width adapting to it's contents
Signed-off-by: Tamás Bari <adaorcpp@gmail.com>
This commit is contained in:
parent
adaa54cced
commit
8145c1ef7a
@ -53,7 +53,8 @@ Button {
|
||||
x: (root.x + 2)
|
||||
y: (root.y + Style.trayWindowHeaderHeight + 2)
|
||||
|
||||
width: (Style.rootWidth - 2)
|
||||
property real widestMenuItemWidth: 0
|
||||
width: widestMenuItemWidth + leftPadding + rightPadding
|
||||
height: Math.min(implicitHeight, maxMenuHeight)
|
||||
closePolicy: Menu.CloseOnPressOutsideParent | Menu.CloseOnEscape
|
||||
|
||||
@ -71,7 +72,12 @@ Button {
|
||||
implicitHeight: instantiatedUserLine.height
|
||||
UserLine {
|
||||
id: instantiatedUserLine
|
||||
width: parent.width
|
||||
width: accountMenu.widestMenuItemWidth
|
||||
|
||||
Component.onCompleted: {
|
||||
accountMenu.widestMenuItemWidth = Math.max( instantiatedUserLine.implicitWidth, accountMenu.widestMenuItemWidth )
|
||||
}
|
||||
|
||||
onShowUserStatusSelector: {
|
||||
userStatusDrawer.openUserStatusDrawer(model.index);
|
||||
accountMenu.close();
|
||||
|
||||
@ -27,6 +27,7 @@ AbstractButton {
|
||||
contentItem: RowLayout {
|
||||
id: userLineLayout
|
||||
spacing: Style.userLineSpacing
|
||||
width: parent.width
|
||||
|
||||
Image {
|
||||
id: accountAvatar
|
||||
@ -139,6 +140,10 @@ AbstractButton {
|
||||
}
|
||||
}
|
||||
|
||||
Item { // Spacer
|
||||
Layout.fillWidth: true
|
||||
}
|
||||
|
||||
Button {
|
||||
id: userMoreButton
|
||||
Layout.preferredWidth: Style.headerButtonIconSize
|
||||
|
||||
Loading…
Reference in New Issue
Block a user