fix(ui): hide Electron menu bar and polish editor chrome
Drop the system View menu across windows, show the open project name above Game properties, and keep scene list kebab visible with truncated titles and overflow tooltips. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -265,6 +265,18 @@
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.projectNameLabel {
|
||||
font-weight: 700;
|
||||
font-size: 13px;
|
||||
letter-spacing: 0.02em;
|
||||
margin-bottom: 10px;
|
||||
color: var(--text1);
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.inspectorScroll {
|
||||
flex: 1;
|
||||
min-height: 0;
|
||||
@@ -1076,6 +1088,7 @@
|
||||
border: 1px solid transparent;
|
||||
box-sizing: border-box;
|
||||
background: transparent;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.sceneCard:not(.sceneCardActive):hover {
|
||||
@@ -1163,21 +1176,23 @@
|
||||
padding: 10px;
|
||||
display: grid;
|
||||
gap: 6px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.sceneCardHeader {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
gap: 8px;
|
||||
min-width: 0;
|
||||
}
|
||||
|
||||
.badgeCurrent {
|
||||
font-size: var(--text-xs);
|
||||
color: var(--accent2);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
.sceneMenuBtn {
|
||||
margin-left: auto;
|
||||
border: none;
|
||||
background: var(--panel2);
|
||||
border-radius: var(--radius-xs);
|
||||
@@ -1191,6 +1206,11 @@
|
||||
|
||||
.sceneCardTitle {
|
||||
font-weight: 750;
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
.menuBackdrop {
|
||||
|
||||
@@ -1018,6 +1018,9 @@ export function EditorApp() {
|
||||
<div className={styles.inspectorScroll}>
|
||||
{state.project ? (
|
||||
<>
|
||||
<div className={styles.projectNameLabel} title={state.project.meta.name}>
|
||||
{t('scenes.projectLabel', { name: state.project.meta.name })}
|
||||
</div>
|
||||
<div className={styles.inspectorTitle}>{t('scenes.inspectorGame')}</div>
|
||||
<CampaignInspector
|
||||
audioRefs={campaignAudioRefs}
|
||||
@@ -2759,6 +2762,8 @@ function SceneListCard({
|
||||
const previewUrl = useAssetUrl(scene.previewAssetId);
|
||||
const [menu, setMenu] = useState<{ x: number; y: number } | null>(null);
|
||||
const [pendingDelete, setPendingDelete] = useState(false);
|
||||
const titleRef = useRef<HTMLDivElement | null>(null);
|
||||
const [titleTooltip, setTitleTooltip] = useState<string | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
if (!menu) return;
|
||||
@@ -2875,6 +2880,22 @@ function SceneListCard({
|
||||
<div className={styles.sceneCardBody}>
|
||||
<div className={styles.sceneCardHeader}>
|
||||
{scene.active ? <div className={styles.badgeCurrent}>{t('sceneCard.current')}</div> : null}
|
||||
<div
|
||||
ref={titleRef}
|
||||
className={styles.sceneCardTitle}
|
||||
title={titleTooltip}
|
||||
onMouseEnter={() => {
|
||||
const el = titleRef.current;
|
||||
if (!el) {
|
||||
setTitleTooltip(undefined);
|
||||
return;
|
||||
}
|
||||
setTitleTooltip(el.scrollWidth > el.clientWidth + 1 ? scene.title : undefined);
|
||||
}}
|
||||
onMouseLeave={() => setTitleTooltip(undefined)}
|
||||
>
|
||||
{scene.title}
|
||||
</div>
|
||||
<button
|
||||
type="button"
|
||||
aria-label={t('sceneCard.menu')}
|
||||
@@ -2888,7 +2909,6 @@ function SceneListCard({
|
||||
⋮
|
||||
</button>
|
||||
</div>
|
||||
<div className={styles.sceneCardTitle}>{scene.title}</div>
|
||||
</div>
|
||||
{menu && menuPos
|
||||
? createPortal(
|
||||
|
||||
@@ -282,6 +282,7 @@ export const EDITOR_MESSAGES: Record<EditorLocale, Record<string, string>> = {
|
||||
'scenes.dropSkippedNoPath': 'не удалось получить путь к файлу',
|
||||
'scenes.inspectorGame': 'Свойства игры',
|
||||
'scenes.inspectorScene': 'Свойства сцены',
|
||||
'scenes.projectLabel': 'Проект: {name}',
|
||||
'scenes.selectHint': 'Выберите сцену слева, чтобы редактировать её свойства.',
|
||||
'scenes.openProjectHint': 'Откройте проект, чтобы редактировать кампанию и сцены.',
|
||||
|
||||
@@ -851,6 +852,7 @@ export const EDITOR_MESSAGES: Record<EditorLocale, Record<string, string>> = {
|
||||
'scenes.dropSkippedNoPath': 'could not resolve file path',
|
||||
'scenes.inspectorGame': 'Game properties',
|
||||
'scenes.inspectorScene': 'Scene properties',
|
||||
'scenes.projectLabel': 'Project: {name}',
|
||||
'scenes.selectHint': 'Select a scene on the left to edit its properties.',
|
||||
'scenes.openProjectHint': 'Open a project to edit the campaign and scenes.',
|
||||
|
||||
|
||||
Reference in New Issue
Block a user