Undo/Redo buttons, refactor menu toggles (#793)
* Make Undo & Redo and the menu buttons into actions; add undo/redo buttons * Create variables for the ToolIcon colors * Darken the menu buttons when they’re active * Put the more intensive test in `perform` * Fix & restyle hint viewer * Add pinch zoom for macOS Safari * Chrome/Firefox trackpad pinch zoom * openedMenu → openMenu * needsShapeEditor.ts → showSelectedShapeActions.ts * Call showSelectedShapeActions
This commit is contained in:
@ -16,6 +16,7 @@ type ToolButtonBaseProps = {
|
||||
keyBindingLabel?: string;
|
||||
showAriaLabel?: boolean;
|
||||
visible?: boolean;
|
||||
selected?: boolean;
|
||||
};
|
||||
|
||||
type ToolButtonProps =
|
||||
@ -40,7 +41,9 @@ export const ToolButton = React.forwardRef(function(
|
||||
if (props.type === "button") {
|
||||
return (
|
||||
<button
|
||||
className={`ToolIcon_type_button ToolIcon ${sizeCn}`}
|
||||
className={`ToolIcon_type_button ToolIcon ${sizeCn}${
|
||||
props.selected ? " ToolIcon--selected" : ""
|
||||
}`}
|
||||
title={props.title}
|
||||
aria-label={props["aria-label"]}
|
||||
type="button"
|
||||
|
Reference in New Issue
Block a user