From 1ff09b37f8cdc31c1c8127edb2b13958c8196f0e Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 Aug 2025 22:34:03 +0000 Subject: [PATCH 1/2] Initial plan From f9ad94162da10618279fbe13d64eb5ad70c83d55 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sun, 17 Aug 2025 22:42:30 +0000 Subject: [PATCH 2/2] Fix ColorSelector popup positioning to prevent window clipping Co-authored-by: fabiencastan <153585+fabiencastan@users.noreply.github.com> --- meshroom/ui/qml/Controls/ColorSelector.qml | 34 ++++++++++++++++++++-- 1 file changed, 32 insertions(+), 2 deletions(-) diff --git a/meshroom/ui/qml/Controls/ColorSelector.qml b/meshroom/ui/qml/Controls/ColorSelector.qml index ed1f27d619..b8de730e8c 100644 --- a/meshroom/ui/qml/Controls/ColorSelector.qml +++ b/meshroom/ui/qml/Controls/ColorSelector.qml @@ -64,9 +64,39 @@ MaterialToolButton { padding: 4 width: (root.height * 4) + (padding * 4) - // center the current color + // Smart positioning to avoid clipping y: -height - x: -width + root.width + padding + x: { + // Get the root's position in its parent coordinates + // This works because mapToItem maps to parent coordinates by default when parent is null + const parentPos = root.mapToItem(null, 0, 0) + const parentWidth = root.parent ? root.parent.width : 800 // fallback width + + // Calculate space available on left and right + const spaceOnLeft = parentPos.x + const spaceOnRight = parentWidth - (parentPos.x + root.width) + + // Required space for positioning to the left + const requiredSpaceLeft = width - root.width - padding + + // Check if there's enough space on the left + if (spaceOnLeft >= requiredSpaceLeft) { + // Position to the left (original behavior) + return -width + root.width + padding + } else if (spaceOnRight >= width + padding) { + // Position to the right if there's space + return root.width + padding + } else { + // Not enough space on either side, position to minimize clipping + // If more space on right, align to right edge of button + if (spaceOnRight > spaceOnLeft) { + return root.width + padding + } else { + // Align to left edge of button + return -width + root.width + padding + } + } + } // Layout of the Colors Grid {