fix(electron): pinned tab style (#8232)

fix PD-1687
This commit is contained in:
pengx17
2024-09-13 09:40:27 +00:00
parent 1d7932851e
commit 3c1cd6b648
2 changed files with 13 additions and 15 deletions

View File

@@ -237,7 +237,7 @@ const WorkbenchTab = ({
<Loading /> <Loading />
)} )}
</div> </div>
{workbench.pinned || !view.title ? null : ( {!view.title ? null : (
<div <div
title={view.title} title={view.title}
className={styles.splitViewLabelText} className={styles.splitViewLabelText}
@@ -254,19 +254,17 @@ const WorkbenchTab = ({
</Fragment> </Fragment>
); );
})} })}
{!workbench.pinned ? ( <div className={styles.tabCloseButtonWrapper}>
<div className={styles.tabCloseButtonWrapper}> {tabsLength > 1 && !workbench.pinned ? (
{tabsLength > 1 ? ( <button
<button data-testid="close-tab-button"
data-testid="close-tab-button" className={styles.tabCloseButton}
className={styles.tabCloseButton} onClick={handleCloseTab}
onClick={handleCloseTab} >
> <CloseIcon />
<CloseIcon /> </button>
</button> ) : null}
) : null} </div>
</div>
) : null}
</div> </div>
<div className={styles.dropIndicator} data-edge={closestEdge} /> <div className={styles.dropIndicator} data-edge={closestEdge} />
</div> </div>

View File

@@ -98,7 +98,7 @@ export const tab = style({
boxShadow: cssVar('buttonShadow'), boxShadow: cssVar('buttonShadow'),
}, },
'&[data-pinned="true"]': { '&[data-pinned="true"]': {
flexShrink: 0, maxWidth: 64,
}, },
[`${tabWrapper}[data-dragging="true"] &`]: { [`${tabWrapper}[data-dragging="true"] &`]: {
boxShadow: `0 0 0 1px ${cssVar('primaryColor')}`, boxShadow: `0 0 0 1px ${cssVar('primaryColor')}`,