Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 25 additions & 5 deletions packages/core-browser/src/components/actions/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -158,17 +158,27 @@ const EllipsisWidget: React.FC<{
icon?: string;
disabled?: boolean;
onClick?: React.MouseEventHandler<HTMLElement>;
}> = ({ type, icon, disabled, onClick }) => {
title?: string;
}> = ({ type, icon, disabled, onClick, title }) => {
if (type === 'icon') {
return <Icon icon={icon || 'ellipsis'} className={styles.iconAction} onClick={onClick} />;
return (
<Button
size='small'
type={type}
className={styles.btnAction}
onClick={onClick}
title={title}
icon={icon || 'ellipsis'}
></Button>
);
}
const props = {};
if (isBoolean(disabled)) {
props['disabled'] = disabled;
}

return (
<Button size='small' type='secondary' className={styles.btnAction} onClick={onClick} {...props}>
<Button size='small' type='secondary' className={styles.btnAction} onClick={onClick} {...props} title={title}>
<Icon icon={icon || 'ellipsis'} />
</Button>
);
Expand Down Expand Up @@ -330,6 +340,7 @@ export const TitleActionList: React.FC<
nav: MenuNode[];
more?: MenuNode[];
moreIcon?: string;
moreTitle?: string;
className?: string;
iconService?: IMenubarIconService;
} & BaseActionListProps
Expand All @@ -343,6 +354,7 @@ export const TitleActionList: React.FC<
nav = [],
more = [],
moreIcon,
moreTitle,
context = [],
extraNavActions = [],
moreAtFirst = false,
Expand Down Expand Up @@ -378,7 +390,13 @@ export const TitleActionList: React.FC<

const moreAction =
secondary.length > 0 ? (
<EllipsisWidget disabled={secondary[0].disabled} icon={moreIcon} type={type} onClick={handleShowMore} />
<EllipsisWidget
disabled={secondary[0].disabled}
icon={moreIcon}
type={type}
onClick={handleShowMore}
title={moreTitle}
/>
) : null;

return (
Expand Down Expand Up @@ -491,6 +509,7 @@ interface InlineMenuBarProps<T, U, K, M> extends Omit<BaseActionListProps, 'extr
context?: TupleContext<T, U, K, M>;
menus: IContextMenu;
moreIcon?: string;
moreTitle?: string;
separator?: IMenuSeparator;
iconService?: IMenubarIconService;
}
Expand All @@ -500,7 +519,7 @@ interface InlineMenuBarProps<T, U, K, M> extends Omit<BaseActionListProps, 'extr
export function InlineMenuBar<T = undefined, U = undefined, K = undefined, M = undefined>(
props: InlineMenuBarProps<T, U, K, M>,
): React.ReactElement<InlineMenuBarProps<T, U, K, M>> {
const { iconService, menus, context, moreIcon, separator = 'navigation', ...restProps } = props;
const { iconService, menus, context, moreIcon, moreTitle, separator = 'navigation', ...restProps } = props;
const [navMenu, moreMenu] = useContextMenus(menus);

// inline 菜单不取第二组,对应内容由关联 context menu 去渲染
Expand All @@ -510,6 +529,7 @@ export function InlineMenuBar<T = undefined, U = undefined, K = undefined, M = u
nav={navMenu}
more={separator === 'inline' ? [] : moreMenu}
moreIcon={moreIcon}
moreTitle={moreTitle}
context={context}
iconService={iconService}
{...restProps}
Expand Down
2 changes: 1 addition & 1 deletion packages/i18n/src/common/zh-CN.lang.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,7 @@ export const localizationBundle = {
'scm.title': '源代码管理',
'scm.action.git.refresh': '刷新',
'scm.action.git.commit': '提交',
'scm.action.git.more': '提交',
'scm.action.git.more': '更多操作...',
'scm.statusbar.repo': '当前仓库',
'scm.provider.title': '代码仓库列表',
'scm.provider.empty': '没有可用的源代码仓库',
Expand Down
1 change: 1 addition & 0 deletions packages/scm/src/browser/scm-view-container.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ export const SCMViewContainer: FC<{ viewState: ViewState }> = (props) => {
<InlineMenuBar
menus={titleMenu}
context={selectedRepo && selectedRepo.provider && [selectedRepo.provider]}
moreTitle={localize('scm.action.git.more', 'More Actions')}
/>
) : null
}
Expand Down