Memory hardening for AlsaDriver.

This commit is contained in:
Robin Davies
2024-10-05 02:14:58 -04:00
parent 46669cfda9
commit 9d4cc6e978
22 changed files with 1137 additions and 409 deletions
+9 -3
View File
@@ -7,14 +7,21 @@ import { useTheme } from '@mui/styles';
const colors: string[] = colorKeys;
export enum DropdownAlignment {
SE, SW
}
interface ColorDropdownButtonProps {
currentColor?: string;
onColorChange: (color: string) => void;
dropdownAlignment: DropdownAlignment;
}
const ColorDropdownButton: React.FC<ColorDropdownButtonProps> = ({
currentColor = colors[0],
onColorChange,
dropdownAlignment = DropdownAlignment.SE
}) => {
const [anchorEl, setAnchorEl] = useState<null | HTMLElement>(null);
const [selectedColor, setSelectedColor] = useState<string>(currentColor);
@@ -38,7 +45,6 @@ const ColorDropdownButton: React.FC<ColorDropdownButtonProps> = ({
setSelectedColor(color);
onColorChange(color);
};
return (
<div>
<ButtonBase
@@ -63,11 +69,11 @@ const ColorDropdownButton: React.FC<ColorDropdownButtonProps> = ({
onClose={handleClose}
anchorOrigin={{
vertical: 'bottom',
horizontal: 'right',
horizontal: (dropdownAlignment === DropdownAlignment.SW ? 'right' : 'left')
}}
transformOrigin={{
vertical: 'top',
horizontal: 'right',
horizontal: (dropdownAlignment === DropdownAlignment.SW ? 'right' : 'left'),
}}
>
<div style={{ display: "flex", flexFlow: "row wrap", width: 56 * 4 + 2 }}>