diff --git a/react/src/App.tsx b/react/src/App.tsx index 61277d0..1f3774f 100644 --- a/react/src/App.tsx +++ b/react/src/App.tsx @@ -21,12 +21,12 @@ import React from 'react'; import { ThemeProvider, createTheme, StyledEngineProvider, Theme } from '@mui/material/styles'; import AppThemed from "./AppThemed"; -import {isDarkMode} from './DarkMode'; +import { isDarkMode } from './DarkMode'; declare module '@mui/material/styles' { interface Theme { - mainBackground: React.CSSProperties['color']; - toolbarColor: React.CSSProperties['color']; + mainBackground: React.CSSProperties['color']; + toolbarColor: React.CSSProperties['color']; } interface ThemeOptions { mainBackground?: React.CSSProperties['color']; @@ -35,12 +35,17 @@ declare module '@mui/material/styles' { } - +declare module '@mui/material/Button' { + interface ButtonPropsVariantOverrides { + dialogPrimary: true; + dialogSecondary: true; + } +} declare module '@mui/styles/defaultTheme' { - // eslint-disable-next-line @typescript-eslint/no-empty-interface - interface DefaultTheme extends Theme {} + // eslint-disable-next-line @typescript-eslint/no-empty-interface + interface DefaultTheme extends Theme { } } @@ -49,34 +54,71 @@ declare module '@mui/styles/defaultTheme' { const theme = createTheme( isDarkMode() ? { - palette: { - mode: 'dark', - primary: { - main: '#A770E4'// #6750A4" // #5B5690 #60529A #5C5694 + components: { + MuiButton: { + variants: [ + { + props: { variant: 'dialogPrimary' }, + style: { + color: "#FFFFFF" + } + }, + { + props: { variant: 'dialogSecondary', }, + style: { + color: "rgb(255,255,255,0.7)" + }, + }, + ], + }, }, - secondary: { - main: "#FF6060" + + palette: { + mode: 'dark', + primary: { + main: '#A770E4'// #6750A4" // #5B5690 #60529A #5C5694 + }, + secondary: { + main: "#0AA102" //'"#FF6060" + }, }, - }, - mainBackground: "#222", - toolbarColor: '#222' - } + mainBackground: "#222", + toolbarColor: '#222' + } : { - palette: { - primary: { - main: "#6750A4" // #5B5690 #60529A #5C5694 + components: { + MuiButton: { + variants: [ + { + props: { variant: 'dialogPrimary' }, + style: { + color: "rgb(0,0,0,0.87)" + } + }, + { + props: { variant: 'dialogSecondary', }, + style: { + color: "rgb(0,0,0,0.6)" + }, + }, + ], + }, }, - secondary: { - main: "#FF6060" - } + palette: { + primary: { + main: "#6750A4" // #5B5690 #60529A #5C5694 + }, + secondary: { + main: "#FF6060" + } - }, - mainBackground: "#FFFFFF", - toolbarColor: '#FFFFFF' + }, + mainBackground: "#FFFFFF", + toolbarColor: '#FFFFFF' - } + } ); @@ -97,7 +139,7 @@ const App = (class extends React.Component { return ( - + ); diff --git a/react/src/AppThemed.tsx b/react/src/AppThemed.tsx index 94b00b1..19965bc 100644 --- a/react/src/AppThemed.tsx +++ b/react/src/AppThemed.tsx @@ -879,7 +879,7 @@ render() { - + OK diff --git a/react/src/BankDialog.tsx b/react/src/BankDialog.tsx index 8ceb2d4..eb61160 100644 --- a/react/src/BankDialog.tsx +++ b/react/src/BankDialog.tsx @@ -546,10 +546,10 @@ const BankDialog = withStyles(styles, { withTheme: true })( Are you sure you want to delete bank '{this.getSelectedBankName()}'? - this.handleDeletePromptClose()} color="primary"> + this.handleDeletePromptClose()} color="primary"> Cancel - this.handleDeletePromptOk()} color="secondary" > + this.handleDeletePromptOk()} color="secondary" > DELETE diff --git a/react/src/FilePropertyDialog.tsx b/react/src/FilePropertyDialog.tsx index 72c1b6f..af384e2 100644 --- a/react/src/FilePropertyDialog.tsx +++ b/react/src/FilePropertyDialog.tsx @@ -553,12 +553,12 @@ export default withStyles(styles, { withTheme: true })( - { this.props.onCancel(); }} aria-label="cancel"> + { this.props.onCancel(); }} aria-label="cancel"> Cancel - { this.openSelectedFile(); }} - color="secondary" + disabled={(!this.state.hasSelection) && this.state.selectedFile !== ""} aria-label="select" > Select diff --git a/react/src/FilePropertyDirectorySelectDialog.tsx b/react/src/FilePropertyDirectorySelectDialog.tsx index 8ee9bb4..ec468c3 100644 --- a/react/src/FilePropertyDirectorySelectDialog.tsx +++ b/react/src/FilePropertyDirectorySelectDialog.tsx @@ -334,10 +334,10 @@ export default class FilePropertyDirectorySelectDialog extends ResizeResponsiveC - { this.onClose(); }} color="primary"> + { this.onClose(); }} color="primary"> Cancel - { this.onOK(); }} color="secondary" disabled={!this.state.hasSelection} > + { this.onOK(); }} color="secondary" disabled={!this.state.hasSelection} > OK diff --git a/react/src/JackServerSettingsDialog.tsx b/react/src/JackServerSettingsDialog.tsx index 34b3fec..38c811b 100644 --- a/react/src/JackServerSettingsDialog.tsx +++ b/react/src/JackServerSettingsDialog.tsx @@ -362,10 +362,10 @@ const JackServerSettingsDialog = withStyles(styles)( - + Cancel - this.handleApply()} color="primary" disabled={ + this.handleApply()} disabled={ (!this.state.alsaDevices) || !this.state.jackServerSettings.valid}> OK diff --git a/react/src/ListSelectDialog.tsx b/react/src/ListSelectDialog.tsx index 0124104..03f145d 100644 --- a/react/src/ListSelectDialog.tsx +++ b/react/src/ListSelectDialog.tsx @@ -106,7 +106,7 @@ export default class ListSelectDialog extends ResizeResponsiveComponent - this.props.onClose()} color="primary"> + this.props.onClose()} color="primary"> Cancel diff --git a/react/src/LoadPluginDialog.tsx b/react/src/LoadPluginDialog.tsx index 5c7c93b..fea41e4 100644 --- a/react/src/LoadPluginDialog.tsx +++ b/react/src/LoadPluginDialog.tsx @@ -814,8 +814,8 @@ export const LoadPluginDialog = - Cancel - SELECT + Cancel + SELECT @@ -839,8 +839,8 @@ export const LoadPluginDialog = - Cancel - SELECT + Cancel + SELECT diff --git a/react/src/OkCancelDialog.tsx b/react/src/OkCancelDialog.tsx index 72f8ab4..726ac3b 100644 --- a/react/src/OkCancelDialog.tsx +++ b/react/src/OkCancelDialog.tsx @@ -70,10 +70,10 @@ export default class OkCancelDialog extends React.Component{text} - + Cancel - + {okButtonText} diff --git a/react/src/PiPedalModel.tsx b/react/src/PiPedalModel.tsx index fad9d26..ae9fd62 100644 --- a/react/src/PiPedalModel.tsx +++ b/react/src/PiPedalModel.tsx @@ -2644,8 +2644,11 @@ export class PiPedalModel //implements PiPedalModel if (this.getTheme() !== value) { setColorScheme(value); - this.reloadPage(); - } + setTimeout(()=>{ + this.reloadPage(); + }, + 200); +} } reloadRequested: boolean = false; @@ -2653,7 +2656,9 @@ export class PiPedalModel //implements PiPedalModel reloadPage() { this.reloadRequested = true; // eslint-disable-next-line no-restricted-globals - window.location.reload(); + let url = window.location.href.split('#')[0]; + window.location.href = url; + //window.location.reload(); } }; diff --git a/react/src/PluginInfoDialog.tsx b/react/src/PluginInfoDialog.tsx index 465361a..2e9bfca 100644 --- a/react/src/PluginInfoDialog.tsx +++ b/react/src/PluginInfoDialog.tsx @@ -317,7 +317,7 @@ const PluginInfoDialog = withStyles(styles)((props: PluginInfoProps) => { - + OK diff --git a/react/src/RenameDialog.tsx b/react/src/RenameDialog.tsx index 72a68f6..2cb82bc 100644 --- a/react/src/RenameDialog.tsx +++ b/react/src/RenameDialog.tsx @@ -131,10 +131,10 @@ export default class RenameDialog extends ResizeResponsiveComponent - + Cancel - + {acceptActionName} diff --git a/react/src/SelectChannelsDialog.tsx b/react/src/SelectChannelsDialog.tsx index de9edd6..ccabcd2 100644 --- a/react/src/SelectChannelsDialog.tsx +++ b/react/src/SelectChannelsDialog.tsx @@ -107,10 +107,10 @@ function SelectChannelsDialog(props: SelectChannelsDialogProps) { )} - + Cancel - 2} > + 2} > OK diff --git a/react/src/SelectMidiChannelsDialog.tsx b/react/src/SelectMidiChannelsDialog.tsx index bd51194..df621bc 100644 --- a/react/src/SelectMidiChannelsDialog.tsx +++ b/react/src/SelectMidiChannelsDialog.tsx @@ -110,10 +110,10 @@ function SelectMidiChannelsDialog(props: SelectMidiChannelsDialogProps) { )} - + Cancel - + OK diff --git a/react/src/SelectThemeDialog.tsx b/react/src/SelectThemeDialog.tsx index f928663..c4db808 100644 --- a/react/src/SelectThemeDialog.tsx +++ b/react/src/SelectThemeDialog.tsx @@ -79,10 +79,10 @@ function SelectThemesDialog(props: SelectThemesDialogProps) { - + Cancel - + OK diff --git a/react/src/SettingsDialog.tsx b/react/src/SettingsDialog.tsx index 53f5da5..bd1d863 100644 --- a/react/src/SettingsDialog.tsx +++ b/react/src/SettingsDialog.tsx @@ -885,7 +885,7 @@ const SettingsDialog = withStyles(styles, { withTheme: true })( onClose={()=> { this.setState({showThemeSelectDialog: false});} } onOk={(selectedTheme: ColorTheme) => { this.model.setTheme(selectedTheme); - this.setState({showThemeSelectDialog: false}); + this.setState({showThemeSelectDialog: false}); }} defaultTheme={this.model.getTheme()} /> diff --git a/react/src/UploadFileDialog.tsx b/react/src/UploadFileDialog.tsx index f6b0d72..4e1cd31 100644 --- a/react/src/UploadFileDialog.tsx +++ b/react/src/UploadFileDialog.tsx @@ -384,7 +384,8 @@ export default class UploadFileDialog extends ResizeResponsiveComponent Select Files this.handleClose()} color="primary"> + this.handleClose()} variant="dialogPrimary" > OK ) : ( - this.handleCancel()} color="primary"> + this.handleCancel()} variant="dialogPrimary" > Cancel diff --git a/react/src/UploadPresetDialog.tsx b/react/src/UploadPresetDialog.tsx index 9381473..073179c 100644 --- a/react/src/UploadPresetDialog.tsx +++ b/react/src/UploadPresetDialog.tsx @@ -182,11 +182,11 @@ export default class UploadPresetDialog extends ResizeResponsiveComponent - this.handleClose()} color="primary"> + this.handleClose()} variant="dialogSecondary" > Cancel Select File - + Cancel - this.handleOk(false)} color="success" style={{ width: 120 }} > + this.handleOk(false)} variant="dialogPrimary" style={{ width: 120 }} > OK @@ -356,13 +356,13 @@ const WifiConfigDialog = withStyles(styles, { withTheme: true })( - this.setState({showWifiWarningDialog: false})} color="primary" style={{ width: 120 }}> + this.setState({showWifiWarningDialog: false})} variant="dialogSecondary" style={{ width: 120 }}> Cancel { this.setState({showWifiWarningDialog: false}); this.handleOk(true); - }} color="secondary" style={{ width: 120 }} > + }} variant="dialogPrimary" style={{ width: 120 }} > PROCEED diff --git a/react/src/WifiDirectConfigDialog.tsx b/react/src/WifiDirectConfigDialog.tsx index 1402c08..50bad7a 100644 --- a/react/src/WifiDirectConfigDialog.tsx +++ b/react/src/WifiDirectConfigDialog.tsx @@ -506,10 +506,10 @@ const WifiDirectConfigDialog = withStyles(styles, { withTheme: true })( )} - + Cancel - this.handleOk()} color="primary" style={{ width: 120 }} > + this.handleOk()} variant="dialogPrimary" style={{ width: 120 }} > OK