chore: hide 'Open in VSCode' for folders in UI Mode (#23499)
This commit is contained in:
parent
afa531ef60
commit
0e12831a02
|
|
@ -452,7 +452,7 @@ const TestList: React.FC<{
|
|||
{!!treeItem.duration && treeItem.status !== 'skipped' && <div className='ui-mode-list-item-time'>{msToString(treeItem.duration)}</div>}
|
||||
<Toolbar noMinHeight={true} noShadow={true}>
|
||||
<ToolbarButton icon='play' title='Run' onClick={() => runTreeItem(treeItem)} disabled={!!runningState}></ToolbarButton>
|
||||
<ToolbarButton icon='go-to-file' title='Open in VS Code' onClick={() => sendMessageNoReply('open', { location: locationToOpen(treeItem) })}></ToolbarButton>
|
||||
<ToolbarButton icon='go-to-file' title='Open in VS Code' onClick={() => sendMessageNoReply('open', { location: locationToOpen(treeItem) })} style={(treeItem.kind === 'group' && treeItem.subKind === 'folder') ? { visibility: 'hidden' } : {}}></ToolbarButton>
|
||||
{!watchAll && <ToolbarButton icon='eye' title='Watch' onClick={() => {
|
||||
if (watchedTreeIds.value.has(treeItem.id))
|
||||
watchedTreeIds.value.delete(treeItem.id);
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export interface ToolbarButtonProps {
|
|||
disabled?: boolean,
|
||||
toggled?: boolean,
|
||||
onClick: () => void,
|
||||
style?: React.CSSProperties
|
||||
}
|
||||
|
||||
export const ToolbarButton: React.FC<React.PropsWithChildren<ToolbarButtonProps>> = ({
|
||||
|
|
@ -33,6 +34,7 @@ export const ToolbarButton: React.FC<React.PropsWithChildren<ToolbarButtonProps>
|
|||
disabled = false,
|
||||
toggled = false,
|
||||
onClick = () => {},
|
||||
style,
|
||||
}) => {
|
||||
let className = `toolbar-button ${icon}`;
|
||||
if (toggled)
|
||||
|
|
@ -43,7 +45,9 @@ export const ToolbarButton: React.FC<React.PropsWithChildren<ToolbarButtonProps>
|
|||
onClick={onClick}
|
||||
onDoubleClick={preventDefault}
|
||||
title={title}
|
||||
disabled={!!disabled}>
|
||||
disabled={!!disabled}
|
||||
style={style}
|
||||
>
|
||||
{icon && <span className={`codicon codicon-${icon}`} style={children ? { marginRight: 5 } : {}}></span>}
|
||||
{children}
|
||||
</button>;
|
||||
|
|
|
|||
Loading…
Reference in a new issue