diff --git a/vite/src/pipedal/App.tsx b/vite/src/pipedal/App.tsx
index 396d281..b8a60f5 100644
--- a/vite/src/pipedal/App.tsx
+++ b/vite/src/pipedal/App.tsx
@@ -28,6 +28,7 @@ import { isDarkMode } from './DarkMode';
import Tone3000AuthComplete from './Tone3000AuthComplete';
import FontTest from './FontTest';
+import IconTest from './IconTest';
declare module '@mui/material/styles' {
interface Theme {
@@ -235,6 +236,11 @@ function isFontTest() {
let param = url.searchParams.get("fontTest");
return (param !== null)
}
+function isIconTest() {
+ let url = new URL(window.location.href);
+ let param = url.searchParams.get("iconTest");
+ return (param !== null)
+}
const App = (class extends React.Component {
// Before the component mounts, we initialise our state
@@ -258,6 +264,7 @@ const App = (class extends React.Component {
{
isTone3000Auth() && ()
|| isFontTest() && ()
+ || isIconTest() && ()
|| ()
}
diff --git a/vite/src/pipedal/IconColorDropdownButton.tsx b/vite/src/pipedal/IconColorDropdownButton.tsx
new file mode 100644
index 0000000..eb1c09f
--- /dev/null
+++ b/vite/src/pipedal/IconColorDropdownButton.tsx
@@ -0,0 +1,142 @@
+/*
+ * MIT License
+ *
+ * Copyright (c) Robin E. R. Davies
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of
+ * this software and associated documentation files (the "Software"), to deal in
+ * the Software without restriction, including without limitation the rights to
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+ * of the Software, and to permit persons to whom the Software is furnished to do
+ * so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in all
+ * copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+import React, { useState, useEffect } from 'react';
+import ButtonBase from '@mui/material/ButtonBase';
+import Menu from '@mui/material/Menu';
+import MenuItem from '@mui/material/MenuItem';
+import { useTheme } from '@mui/material/styles';
+import { getIconColorSelections,getIconColor,IconColorSelect } from './PluginIcon';
+import ArrowDropDownIcon from '@mui/icons-material/ArrowDropDown';
+
+
+export enum DropdownAlignment {
+ SE, SW
+}
+
+interface ColorListDropdownButtonProps {
+ colorKey: string;
+ colorList?: IconColorSelect[];
+
+ onColorChange: (selection: IconColorSelect) => void;
+ dropdownAlignment: DropdownAlignment;
+}
+
+const IconColorDropdownButton: React.FC = (props: ColorListDropdownButtonProps) => {
+ let { colorList, colorKey, onColorChange, dropdownAlignment } = props;
+ if (!colorList) colorList = getIconColorSelections();
+ const theme = useTheme();
+
+ const [anchorEl, setAnchorEl] = useState(null);
+
+ let selectedColor = getIconColor(colorKey);
+ if (selectedColor === undefined) {
+ selectedColor = theme.palette.text.secondary;
+ }
+
+ const handleClick = (event: React.MouseEvent) => {
+ setAnchorEl(event.currentTarget);
+ };
+
+ const handleClose = () => {
+ setAnchorEl(null);
+ };
+
+ const handleColorSelect = (selection: IconColorSelect) => {
+ handleClose();
+ onColorChange(selection);
+ };
+ return (
+
+
+
+
+
+
+
+
+
+
+ );
+};
+
+export default IconColorDropdownButton;
\ No newline at end of file
diff --git a/vite/src/pipedal/IconTest.tsx b/vite/src/pipedal/IconTest.tsx
new file mode 100644
index 0000000..0a40d24
--- /dev/null
+++ b/vite/src/pipedal/IconTest.tsx
@@ -0,0 +1,73 @@
+
+import { useState } from "react";
+import { PluginType } from "./Lv2Plugin";
+import PluginIcon, { getIconColorSelections } from './PluginIcon';
+import IconColorDropdownButton, {DropdownAlignment} from "./IconColorDropdownButton";
+
+function IconTest() {
+ const [selectedColor, setSelectedColor] = useState(undefined);
+ const [selectedKey, setSelectedKey] = useState("");
+ return (
+ <>
+