diff --git a/src/components/MenuItemTooltip.vue b/src/components/MenuItemTooltip.vue index 363ac33d..9b5780d7 100644 --- a/src/components/MenuItemTooltip.vue +++ b/src/components/MenuItemTooltip.vue @@ -23,7 +23,11 @@ async function checkTruncation() { context.font = `${computedStyle.fontWeight} ${computedStyle.fontSize} ${computedStyle.fontFamily}`; const textWidth = context.measureText(text).width; - const containerWidth = textRef.value.clientWidth; + + // Calculate precise container width by accounting for padding + const containerWidth = textRef.value.clientWidth + - Number.parseFloat(computedStyle.paddingLeft) + - Number.parseFloat(computedStyle.paddingRight); showTooltip.value = textWidth > containerWidth; } diff --git a/src/components/MenuLayout.vue b/src/components/MenuLayout.vue index 6c0d1d17..56cd5db0 100644 --- a/src/components/MenuLayout.vue +++ b/src/components/MenuLayout.vue @@ -29,8 +29,8 @@ const siderWidth = computed(() => { return 0; } - // Get 10% of window width, but ensure it's at least 240px - const tenPercent = windowWidth.value * 0.1; + // Use 12.5% of window width, but ensure it's at least 240px + const tenPercent = windowWidth.value * 0.125; return Math.max(240, tenPercent); });