mirror of
https://github.com/savoirfairelinux/jami-client-qt.git
synced 2026-01-08 15:06:58 +08:00
calls: fix call-action button sub-menu positioning
The submenus are no longer created dynamically, so bindings are required for positioning. Gitlab: #1965 Change-Id: Idc2fe77f00ff9b2124f0bad4cc1a8160cd01bf04
This commit is contained in:
@@ -277,11 +277,11 @@ ItemDelegate {
|
|||||||
if (isVertical) {
|
if (isVertical) {
|
||||||
// For a vertical layout, adjust the y position to center the item vertically
|
// For a vertical layout, adjust the y position to center the item vertically
|
||||||
// relative to the root's height, with an additional upward offset of 18 pixels.
|
// relative to the root's height, with an additional upward offset of 18 pixels.
|
||||||
y = -(implicitHeight - root.height) / 2 - 18;
|
return -(implicitHeight - root.height) / 2 - 18;
|
||||||
} else {
|
} else {
|
||||||
// For non-vertical layouts, position the item fully above its normal position
|
// For non-vertical layouts, position the item fully above its normal position
|
||||||
// with an upward offset of 12 pixels from its implicit height.
|
// with an upward offset of 12 pixels from its implicit height.
|
||||||
y = -implicitHeight - 12;
|
return -implicitHeight - 12;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -290,7 +290,7 @@ ItemDelegate {
|
|||||||
if (isVertical) {
|
if (isVertical) {
|
||||||
// If the layout is vertical, position the item to the left of its implicit width
|
// If the layout is vertical, position the item to the left of its implicit width
|
||||||
// with an additional offset of 12 pixels.
|
// with an additional offset of 12 pixels.
|
||||||
x = -implicitWidth - 12;
|
return -implicitWidth - 12;
|
||||||
} else {
|
} else {
|
||||||
// Note: isn't some of this logic built into the Popup?
|
// Note: isn't some of this logic built into the Popup?
|
||||||
|
|
||||||
@@ -309,7 +309,7 @@ ItemDelegate {
|
|||||||
|
|
||||||
// If the item extends beyond the overlay, adjust x value to the left to ensure
|
// If the item extends beyond the overlay, adjust x value to the left to ensure
|
||||||
// it fits within the overlay, with an extra leftward margin of 24 pixels.
|
// it fits within the overlay, with an extra leftward margin of 24 pixels.
|
||||||
x = diff > 0 ? xValue - diff - 24 : xValue;
|
return diff > 0 ? xValue - diff - 24 : xValue;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user