feat: dynamically adjust Wallhaven settings popup width based on measured text content

This commit is contained in:
c0mpile
2026-01-03 16:02:49 -05:00
parent 71bf318195
commit 73279c913d
@@ -11,7 +11,15 @@ Popup {
property ShellScreen screen
width: Math.max(440, Math.round(contentColumn.implicitWidth + (Style.marginL * 2)))
// Measure the ENV placeholder text at current font settings
TextMetrics {
id: envPlaceholderMetrics
text: I18n.tr("wallpaper.panel.apikey.managed-by-env")
font.pointSize: Style.fontSizeM
}
// Dynamic width: use measured ENV placeholder width + input padding, or fallback to 440
width: Math.max(440, Math.round(envPlaceholderMetrics.width + (Style.marginL * 4)), Math.round(contentColumn.implicitWidth + (Style.marginL * 2)))
height: Math.round(contentColumn.implicitHeight + (Style.marginL * 2))
padding: Style.marginL
modal: true