Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor: Prettified shortcuts #28466

Merged
merged 1 commit into from
May 23, 2024
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
11 changes: 11 additions & 0 deletions editor/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,17 @@ select {
line-height: 16px;
}

#menubar .menu .key {
position: absolute;
right: 10px;
color: #ccc;
border: 1px solid #ccc;
border-radius: 4px;
font-size: 9px;
padding: 2px 4px;
right: 10px;
}

#menubar .menu .options {
position: fixed;
z-index: 1; /* higher than resizer */
Expand Down
5 changes: 4 additions & 1 deletion editor/js/Menubar.Edit.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Box3, Vector3 } from 'three';

import { UIPanel, UIRow, UIHorizontalRule } from './libs/ui.js';
import { UIPanel, UIRow, UIHorizontalRule, UIText } from './libs/ui.js';

import { AddObjectCommand } from './commands/AddObjectCommand.js';
import { RemoveObjectCommand } from './commands/RemoveObjectCommand.js';
Expand Down Expand Up @@ -28,6 +28,7 @@ function MenubarEdit( editor ) {
const undo = new UIRow();
undo.setClass( 'option' );
undo.setTextContent( strings.getKey( 'menubar/edit/undo' ) );
undo.add( new UIText( 'CTRL+Z' ).setClass( 'key' ) );
undo.onClick( function () {

editor.undo();
Expand All @@ -40,6 +41,7 @@ function MenubarEdit( editor ) {
const redo = new UIRow();
redo.setClass( 'option' );
redo.setTextContent( strings.getKey( 'menubar/edit/redo' ) );
redo.add( new UIText( 'CTRL+SHIFT+Z' ).setClass( 'key' ) );
redo.onClick( function () {

editor.redo();
Expand Down Expand Up @@ -122,6 +124,7 @@ function MenubarEdit( editor ) {
option = new UIRow();
option.setClass( 'option' );
option.setTextContent( strings.getKey( 'menubar/edit/delete' ) );
option.add( new UIText( 'DEL' ).setClass( 'key' ) );
option.onClick( function () {

const object = editor.selected;
Expand Down
24 changes: 12 additions & 12 deletions editor/js/Strings.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,11 @@ function Strings( config ) {
'menubar/file/export': 'Export',

'menubar/edit': 'Edit',
'menubar/edit/undo': 'Undo (Ctrl+Z)',
'menubar/edit/redo': 'Redo (Ctrl+Shift+Z)',
'menubar/edit/undo': 'Undo',
'menubar/edit/redo': 'Redo',
'menubar/edit/center': 'Center',
'menubar/edit/clone': 'Clone',
'menubar/edit/delete': 'Delete (Del)',
'menubar/edit/delete': 'Delete',

'menubar/add': 'Add',
'menubar/add/group': 'Group',
Expand Down Expand Up @@ -441,11 +441,11 @@ function Strings( config ) {
'menubar/file/export': 'Exporter',

'menubar/edit': 'Edition',
'menubar/edit/undo': 'Annuler (Ctrl+Z)',
'menubar/edit/redo': 'Refaire (Ctrl+Shift+Z)',
'menubar/edit/undo': 'Annuler',
'menubar/edit/redo': 'Refaire',
'menubar/edit/center': 'Center',
'menubar/edit/clone': 'Cloner',
'menubar/edit/delete': 'Supprimer (Supp)',
'menubar/edit/delete': 'Supprimer',

'menubar/add': 'Ajouter',
'menubar/add/group': 'Groupe',
Expand Down Expand Up @@ -830,11 +830,11 @@ function Strings( config ) {
'menubar/file/export': '导出',

'menubar/edit': '编辑',
'menubar/edit/undo': '撤销 (Ctrl+Z)',
'menubar/edit/redo': '重做 (Ctrl+Shift+Z)',
'menubar/edit/undo': '撤销',
'menubar/edit/redo': '重做',
'menubar/edit/center': '居中',
'menubar/edit/clone': '拷贝',
'menubar/edit/delete': '删除 (Del)',
'menubar/edit/delete': '删除',

'menubar/add': '添加',
'menubar/add/group': '组',
Expand Down Expand Up @@ -1219,11 +1219,11 @@ function Strings( config ) {
'menubar/file/export': 'エクスポート',

'menubar/edit': '編集',
'menubar/edit/undo': '元に戻す(Ctrl+Z)',
'menubar/edit/redo': 'やり直す(Ctrl+Shift+Z)',
'menubar/edit/undo': '元に戻す',
'menubar/edit/redo': 'やり直す',
'menubar/edit/center': '中央揃え',
'menubar/edit/clone': '複製',
'menubar/edit/delete': '削除(Del)',
'menubar/edit/delete': '削除',

'menubar/add': '追加',
'menubar/add/group': 'グループ',
Expand Down