From b51ba8b9f8bcd225a9600e1d22b309ba99c7cbe7 Mon Sep 17 00:00:00 2001 From: ChenX Date: Tue, 27 Apr 2021 10:00:41 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96:=E5=A2=9E=E5=8A=A0=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E5=BF=AB=E6=8D=B7=E9=94=AECtrl+B,=E5=8A=A8=E6=80=81?= =?UTF-8?q?=E6=8D=95=E6=8D=89F3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ApplicationServices/Application.ts | 11 +++++++++++ src/UI/Components/Panel.tsx | 20 ++++++++++---------- src/UI/Store/DownPanelStore.ts | 13 ++++++++++--- 3 files changed, 31 insertions(+), 13 deletions(-) diff --git a/src/ApplicationServices/Application.ts b/src/ApplicationServices/Application.ts index be178b2cf..c6940c840 100644 --- a/src/ApplicationServices/Application.ts +++ b/src/ApplicationServices/Application.ts @@ -194,6 +194,12 @@ export class ApplicationService e.preventDefault(); commandMachine.ExecCommand("COMANP"); } + if (e.code === KeyCode.F3) + { + let store = DownPanelStore.GetInstance(); + store.useDynSnap = !store.useDynSnap; + e.preventDefault(); + } if (app.Editor.KeyCtrl.KeyIsDown(KeyCode.ControlLeft) || app.Editor.KeyCtrl.KeyIsDown(KeyCode.ControlRight)) { if (e.code === KeyCode.KeyZ) @@ -206,6 +212,11 @@ export class ApplicationService app.Database.hm.Redo(); app.Viewer.GripScene.UpdateAll(); } + else if (e.code === KeyCode.KeyB) + { + let store = DownPanelStore.GetInstance(); + store.isLayout = !store.isLayout; + } else if (e.code === KeyCode.KeyC) { if (CommandState.CommandIng) return;//避免提示命令执行中,因为我们按住三个按键的时候,会重复出现命令事件 diff --git a/src/UI/Components/Panel.tsx b/src/UI/Components/Panel.tsx index 8693c4f8e..ad40f1b3e 100644 --- a/src/UI/Components/Panel.tsx +++ b/src/UI/Components/Panel.tsx @@ -1,23 +1,23 @@ -import { Alignment, Button, Classes, HTMLSelect, InputGroup, Navbar, ProgressBar, Switch, Intent } from '@blueprintjs/core'; +import { Alignment, Button, Classes, HTMLSelect, Intent, Navbar, ProgressBar, Switch } from '@blueprintjs/core'; import { inject, observer } from 'mobx-react'; import * as React from 'react'; import { app } from '../../ApplicationServices/Application'; +import { CommandNames } from '../../Common/CommandNames'; import { SignUrl } from '../../Common/HostUrl'; +import { Log } from '../../Common/Log'; import { Post, RequestStatus } from '../../Common/Request'; +import { Entity } from '../../DatabaseServices/Entity/Entity'; import { commandMachine } from '../../Editor/CommandMachine'; import { CommandState } from '../../Editor/CommandState'; import { SnapMenuFixed } from '../../Editor/SnapMenuFixed'; +import { TempEditor } from '../../Editor/TempEditor'; import { DownPanelStore } from '../Store/DownPanelStore'; import { TopPanelStore } from '../Store/TopPanelStore'; +import { userConfigStore } from '../Store/UserConfigStore'; +import { AppConfirm } from './Common/Confirm'; import { SettingPanel } from './SettingPanel/SettingPanel'; import SoucePanel from './SourceManage/SoucePanel'; import { AppToaster } from './Toaster'; -import { CommandNames } from '../../Common/CommandNames'; -import { userConfigStore } from '../Store/UserConfigStore'; -import { TempEditor } from '../../Editor/TempEditor'; -import { Log } from '../../Common/Log'; -import { Entity } from '../../DatabaseServices/Entity/Entity'; -import { AppConfirm } from './Common/Confirm'; interface TopPanelState { @@ -259,7 +259,7 @@ export class DownPanel extends React.Component<{ store?: DownPanelStore; }, {}> /> /> { this.posEl.innerText = PointToString(app.Editor.MouseCtrl._CurMousePointWCS); @@ -134,6 +132,15 @@ export class DownPanelStore extends Singleton app.LayoutTool.Switch(); }); } + + private static _SingleInstance: DownPanelStore; + static GetInstance(): DownPanelStore + { + if (this._SingleInstance) return this._SingleInstance; + this._SingleInstance = new DownPanelStore; + return this._SingleInstance; + } + get Config() { return {