From 6508ef4fce23281bac0efea0e8f76ddf56b58e10 Mon Sep 17 00:00:00 2001 From: SiriusXT <1160925501@qq.com> Date: Thu, 5 Jun 2025 20:27:58 +0800 Subject: [PATCH] fix(tab-row): Avoid this.newTabOuterWidth being a decimal in Electron --- apps/client/src/widgets/tab_row.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/client/src/widgets/tab_row.ts b/apps/client/src/widgets/tab_row.ts index bfd3fe918..2d8c8e20e 100644 --- a/apps/client/src/widgets/tab_row.ts +++ b/apps/client/src/widgets/tab_row.ts @@ -488,8 +488,9 @@ export default class TabRowWidget extends BasicWidget { // this.$newTab may include margin, and using NEW_TAB_WIDTH could cause tabsContainerWidth to be slightly larger, // resulting in misaligned scrollbars/buttons. Therefore, use outerwidth. this.updateOuterWidth(); - let tabsContainerWidth = Math.floor(this.$widget.width() ?? 0); - tabsContainerWidth -= this.newTabOuterWidth + MIN_FILLER_WIDTH; + let tabsContainerWidth = Math.floor( + (this.$widget.width() ?? 0) - this.newTabOuterWidth - MIN_FILLER_WIDTH + ); // Check whether the scroll buttons need to be displayed. if ((TAB_CONTAINER_MIN_WIDTH + MARGIN_WIDTH) * numberOfTabs > tabsContainerWidth) { tabsContainerWidth -= this.scrollButtonsOuterWidth;