fix: Distinguish subtype toggles from regular tools.
This commit is contained in:
parent
00691631d8
commit
3aa1365acb
@ -17,7 +17,7 @@ import { AppClassProperties, AppProps, UIAppState, Zoom } from "../types";
|
|||||||
import { capitalizeString, isTransparent } from "../utils";
|
import { capitalizeString, isTransparent } from "../utils";
|
||||||
import Stack from "./Stack";
|
import Stack from "./Stack";
|
||||||
import { ToolButton } from "./ToolButton";
|
import { ToolButton } from "./ToolButton";
|
||||||
import { SubtypeShapeActions, SubtypeToggles } from "./Subtypes";
|
import { SubtypeShapeActions } from "./Subtypes";
|
||||||
import { hasStrokeColor } from "../scene/comparisons";
|
import { hasStrokeColor } from "../scene/comparisons";
|
||||||
import { trackEvent } from "../analytics";
|
import { trackEvent } from "../analytics";
|
||||||
import { hasBoundTextElement, isTextElement } from "../element/typeChecks";
|
import { hasBoundTextElement, isTextElement } from "../element/typeChecks";
|
||||||
@ -342,7 +342,6 @@ export const ShapesSwitcher = ({
|
|||||||
</DropdownMenu.Item>
|
</DropdownMenu.Item>
|
||||||
</DropdownMenu.Content>
|
</DropdownMenu.Content>
|
||||||
</DropdownMenu>
|
</DropdownMenu>
|
||||||
<SubtypeToggles />
|
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
@ -55,6 +55,7 @@ import "./Toolbar.scss";
|
|||||||
import { mutateElement } from "../element/mutateElement";
|
import { mutateElement } from "../element/mutateElement";
|
||||||
import { ShapeCache } from "../scene/ShapeCache";
|
import { ShapeCache } from "../scene/ShapeCache";
|
||||||
import Scene from "../scene/Scene";
|
import Scene from "../scene/Scene";
|
||||||
|
import { SubtypeToggles } from "./Subtypes";
|
||||||
import { LaserPointerButton } from "./LaserTool/LaserPointerButton";
|
import { LaserPointerButton } from "./LaserTool/LaserPointerButton";
|
||||||
|
|
||||||
interface LayerUIProps {
|
interface LayerUIProps {
|
||||||
@ -285,6 +286,7 @@ const LayerUI = ({
|
|||||||
/>
|
/>
|
||||||
</Stack.Row>
|
</Stack.Row>
|
||||||
</Island>
|
</Island>
|
||||||
|
<SubtypeToggles />
|
||||||
{isCollaborating && (
|
{isCollaborating && (
|
||||||
<Island
|
<Island
|
||||||
style={{
|
style={{
|
||||||
|
@ -26,6 +26,7 @@ import { actionToggleStats } from "../actions";
|
|||||||
import { HandButton } from "./HandButton";
|
import { HandButton } from "./HandButton";
|
||||||
import { isHandToolActive } from "../appState";
|
import { isHandToolActive } from "../appState";
|
||||||
import { useTunnels } from "../context/tunnels";
|
import { useTunnels } from "../context/tunnels";
|
||||||
|
import { SubtypeToggles } from "./Subtypes";
|
||||||
|
|
||||||
type MobileMenuProps = {
|
type MobileMenuProps = {
|
||||||
appState: UIAppState;
|
appState: UIAppState;
|
||||||
@ -91,6 +92,7 @@ export const MobileMenu = ({
|
|||||||
/>
|
/>
|
||||||
</Stack.Row>
|
</Stack.Row>
|
||||||
</Island>
|
</Island>
|
||||||
|
<SubtypeToggles />
|
||||||
{renderTopRightUI && renderTopRightUI(true, appState)}
|
{renderTopRightUI && renderTopRightUI(true, appState)}
|
||||||
<div className="mobile-misc-tools-container">
|
<div className="mobile-misc-tools-container">
|
||||||
{!appState.viewModeEnabled && (
|
{!appState.viewModeEnabled && (
|
||||||
|
@ -17,6 +17,7 @@ import {
|
|||||||
useExcalidrawSetAppState,
|
useExcalidrawSetAppState,
|
||||||
} from "./App";
|
} from "./App";
|
||||||
import { ContextMenuItems } from "./ContextMenu";
|
import { ContextMenuItems } from "./ContextMenu";
|
||||||
|
import { Island } from "./Island";
|
||||||
|
|
||||||
export const SubtypeButton = (
|
export const SubtypeButton = (
|
||||||
subtype: Subtype,
|
subtype: Subtype,
|
||||||
@ -145,12 +146,20 @@ export const SubtypeToggles = () => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{getSubtypeNames().map((subtype) =>
|
<Island
|
||||||
am.renderAction(
|
style={{
|
||||||
`custom.${subtype}`,
|
marginLeft: 8,
|
||||||
hasAlwaysEnabledActions(subtype) ? { onContextMenu } : {},
|
alignSelf: "center",
|
||||||
),
|
height: "fit-content",
|
||||||
)}
|
}}
|
||||||
|
>
|
||||||
|
{getSubtypeNames().map((subtype) =>
|
||||||
|
am.renderAction(
|
||||||
|
`custom.${subtype}`,
|
||||||
|
hasAlwaysEnabledActions(subtype) ? { onContextMenu } : {},
|
||||||
|
),
|
||||||
|
)}
|
||||||
|
</Island>
|
||||||
</>
|
</>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user