Skip to content

Commit

Permalink
Disable multi-instance setting on macOS and improve viewport to clipb…
Browse files Browse the repository at this point in the history
…oard shortcut hint (#2107)

- The multi-instance settings has no effect on macOS ATM.
- shortcut change for viewport to clipboard on control button.
  • Loading branch information
stonerl committed Aug 17, 2023
1 parent c38013e commit 8f90283
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
6 changes: 4 additions & 2 deletions src/renderer/components/ReactFlowBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -673,9 +673,11 @@ export const ReactFlowBox = memo(({ wrapperRef, nodeTypes, edgeTypes }: ReactFlo
<Controls>
<ControlButton
disabled={nodes.length === 0}
title={'Export viewport as PNG\nCtrl+Click to export to clipboard instead'}
title={`Export viewport as PNG file\n\nHold ${
isMac ? '⌥' : 'Ctrl'
}+Click to export to clipboard`}
onClick={(e) => {
if (e.ctrlKey) {
if (isMac ? e.altKey : e.ctrlKey) {
exportViewportScreenshotToClipboard();
} else {
exportViewportScreenshot();
Expand Down
21 changes: 12 additions & 9 deletions src/renderer/components/SettingsModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ import {
import { BsFillPencilFill, BsPaletteFill } from 'react-icons/bs';
import { FaPython, FaTools } from 'react-icons/fa';
import { useContext } from 'use-context-selector';
import { getOnnxTensorRtCacheLocation, hasTensorRt, isArmMac } from '../../common/env';
import { getOnnxTensorRtCacheLocation, hasTensorRt, isArmMac, isMac } from '../../common/env';
import { log } from '../../common/log';
import { ipcRenderer } from '../../common/safeIpc';
import { BackendContext } from '../contexts/BackendContext';
Expand Down Expand Up @@ -725,14 +725,17 @@ const AdvancedSettings = memo(() => {
setIsEnableHardwareAcceleration((prev) => !prev);
}}
/>
<Toggle
description="Enable multiple concurrent instances of chaiNNer. This is not recommended, but if your chain is not using enough of your system resources, you might find this helpful for running things concurrently."
title="Allow multiple concurrent instances"
value={isAllowMultipleInstances}
onToggle={() => {
setIsAllowMultipleInstances((prev) => !prev);
}}
/>
{/* TODO: Not working on macOS ATM. A new window must be created. */}
{!isMac && (
<Toggle
description="Enable multiple concurrent instances of chaiNNer. This is not recommended, but if your chain is not using enough of your system resources, you might find this helpful for running things concurrently."
title="Allow multiple concurrent instances"
value={isAllowMultipleInstances}
onToggle={() => {
setIsAllowMultipleInstances((prev) => !prev);
}}
/>
)}
</VStack>
);
});
Expand Down

0 comments on commit 8f90283

Please sign in to comment.