Dialog button colors
This commit is contained in:
+44
-2
@@ -35,7 +35,12 @@ declare module '@mui/material/styles' {
|
||||
|
||||
}
|
||||
|
||||
|
||||
declare module '@mui/material/Button' {
|
||||
interface ButtonPropsVariantOverrides {
|
||||
dialogPrimary: true;
|
||||
dialogSecondary: true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
declare module '@mui/styles/defaultTheme' {
|
||||
@@ -49,13 +54,32 @@ declare module '@mui/styles/defaultTheme' {
|
||||
const theme = createTheme(
|
||||
isDarkMode() ?
|
||||
{
|
||||
components: {
|
||||
MuiButton: {
|
||||
variants: [
|
||||
{
|
||||
props: { variant: 'dialogPrimary' },
|
||||
style: {
|
||||
color: "#FFFFFF"
|
||||
}
|
||||
},
|
||||
{
|
||||
props: { variant: 'dialogSecondary', },
|
||||
style: {
|
||||
color: "rgb(255,255,255,0.7)"
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
|
||||
palette: {
|
||||
mode: 'dark',
|
||||
primary: {
|
||||
main: '#A770E4'// #6750A4" // #5B5690 #60529A #5C5694
|
||||
},
|
||||
secondary: {
|
||||
main: "#FF6060"
|
||||
main: "#0AA102" //'"#FF6060"
|
||||
},
|
||||
},
|
||||
mainBackground: "#222",
|
||||
@@ -63,6 +87,24 @@ const theme = createTheme(
|
||||
}
|
||||
:
|
||||
{
|
||||
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)"
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
palette: {
|
||||
primary: {
|
||||
main: "#6750A4" // #5B5690 #60529A #5C5694
|
||||
|
||||
@@ -879,7 +879,7 @@ render() {
|
||||
</DialogContentText>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={this.handleCloseAlert} color="primary" autoFocus>
|
||||
<Button variant="dialogPrimary" onClick={this.handleCloseAlert} color="primary" autoFocus>
|
||||
OK
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -546,10 +546,10 @@ const BankDialog = withStyles(styles, { withTheme: true })(
|
||||
<Typography>Are you sure you want to delete bank '{this.getSelectedBankName()}'?</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={()=> this.handleDeletePromptClose()} color="primary">
|
||||
<Button variant="dialogSecondary" onClick={()=> this.handleDeletePromptClose()} color="primary">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={()=> this.handleDeletePromptOk()} color="secondary" >
|
||||
<Button variant="dialogPrimary" onClick={()=> this.handleDeletePromptOk()} color="secondary" >
|
||||
DELETE
|
||||
</Button>
|
||||
|
||||
|
||||
@@ -553,12 +553,12 @@ export default withStyles(styles, { withTheme: true })(
|
||||
</Button>
|
||||
<div style={{ flex: "1 1 auto" }}> </div>
|
||||
|
||||
<Button onClick={() => { this.props.onCancel(); }} aria-label="cancel">
|
||||
<Button variant="dialogSecondary" onClick={() => { this.props.onCancel(); }} aria-label="cancel">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button style={{ flex: "0 0 auto" }}
|
||||
<Button variant="dialogPrimary" style={{ flex: "0 0 auto" }}
|
||||
onClick={() => { this.openSelectedFile(); }}
|
||||
color="secondary"
|
||||
|
||||
disabled={(!this.state.hasSelection) && this.state.selectedFile !== ""} aria-label="select"
|
||||
>
|
||||
Select
|
||||
|
||||
@@ -334,10 +334,10 @@ export default class FilePropertyDirectorySelectDialog extends ResizeResponsiveC
|
||||
</DialogContent>
|
||||
<Divider />
|
||||
<DialogActions>
|
||||
<Button onClick={() => { this.onClose(); }} color="primary">
|
||||
<Button variant="dialogSecondary" onClick={() => { this.onClose(); }} color="primary">
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={() => { this.onOK(); }} color="secondary" disabled={!this.state.hasSelection} >
|
||||
<Button variant="dialogPrimary" onClick={() => { this.onOK(); }} color="secondary" disabled={!this.state.hasSelection} >
|
||||
OK
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -362,10 +362,10 @@ const JackServerSettingsDialog = withStyles(styles)(
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary">
|
||||
<Button variant="dialogSecondary" onClick={handleClose} >
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={() => this.handleApply()} color="primary" disabled={
|
||||
<Button variant="dialogPrimary" onClick={() => this.handleApply()} disabled={
|
||||
(!this.state.alsaDevices) || !this.state.jackServerSettings.valid}>
|
||||
OK
|
||||
</Button>
|
||||
|
||||
@@ -106,7 +106,7 @@ export default class ListSelectDialog extends ResizeResponsiveComponent<ListSele
|
||||
}
|
||||
</List>
|
||||
<DialogActions>
|
||||
<Button onClick={()=> this.props.onClose()} color="primary">
|
||||
<Button variant="dialogSecondary" onClick={()=> this.props.onClose()} color="primary">
|
||||
Cancel
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -814,8 +814,8 @@ export const LoadPluginDialog =
|
||||
</div>
|
||||
</div>
|
||||
<div style={{ position: "relative", float: "right", flex: "0 1 200px", width: 200, display: "flex", alignItems: "center" }}>
|
||||
<Button onClick={this.handleCancel} style={{ width: 120 }} >Cancel</Button>
|
||||
<Button onClick={this.handleOk} color="secondary" disabled={selectedPlugin === null} style={{ width: 180 }} >SELECT</Button>
|
||||
<Button variant="dialogSecondary" onClick={this.handleCancel} style={{ width: 120 }} >Cancel</Button>
|
||||
<Button variant="dialogPrimary" onClick={this.handleOk} disabled={selectedPlugin === null} style={{ width: 180 }} >SELECT</Button>
|
||||
</div>
|
||||
</div>
|
||||
</DialogActions>
|
||||
@@ -839,8 +839,8 @@ export const LoadPluginDialog =
|
||||
<div className={classes.bottom} style={{height: 64}}>
|
||||
<div style={{ flex: "1 1 1px" }} />
|
||||
<div style={{ position: "relative", flex: "0 1 auto", display: "flex", alignItems: "center" }}>
|
||||
<Button onClick={this.handleCancel} style={{ height: 48 }} >Cancel</Button>
|
||||
<Button onClick={this.handleOk} color="secondary" disabled={selectedPlugin === null} style={{ height: 48 }} >SELECT</Button>
|
||||
<Button variant="dialogSecondary" onClick={this.handleCancel} style={{ height: 48 }} >Cancel</Button>
|
||||
<Button variant="dialogPrimary" onClick={this.handleOk} disabled={selectedPlugin === null} style={{ height: 48 }} >SELECT</Button>
|
||||
</div>
|
||||
</div>
|
||||
</DialogActions>
|
||||
|
||||
@@ -70,10 +70,10 @@ export default class OkCancelDialog extends React.Component<OkCancelDialogProps,
|
||||
>{text}</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary">
|
||||
<Button variant="dialogSecondary" onClick={handleClose} >
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={handleOk} color="secondary" >
|
||||
<Button variant="dialogPrimary" onClick={handleOk} >
|
||||
{okButtonText}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -2644,7 +2644,10 @@ export class PiPedalModel //implements PiPedalModel
|
||||
if (this.getTheme() !== value)
|
||||
{
|
||||
setColorScheme(value);
|
||||
setTimeout(()=>{
|
||||
this.reloadPage();
|
||||
},
|
||||
200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
@@ -317,7 +317,7 @@ const PluginInfoDialog = withStyles(styles)((props: PluginInfoProps) => {
|
||||
</div>
|
||||
</PluginInfoDialogContent>
|
||||
<PluginInfoDialogActions>
|
||||
<Button autoFocus onClick={handleClose} color="primary" style={{ width: "130px" }}>
|
||||
<Button variant="dialogPrimary" autoFocus onClick={handleClose} style={{ width: "130px" }}>
|
||||
OK
|
||||
</Button>
|
||||
</PluginInfoDialogActions>
|
||||
|
||||
@@ -131,10 +131,10 @@ export default class RenameDialog extends ResizeResponsiveComponent<RenameDialog
|
||||
/>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary">
|
||||
<Button onClick={handleClose} variant="dialogSecondary" >
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={handleOk} color="secondary" >
|
||||
<Button onClick={handleOk} variant="dialogPrimary" >
|
||||
{acceptActionName}
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -107,10 +107,10 @@ function SelectChannelsDialog(props: SelectChannelsDialogProps) {
|
||||
)}
|
||||
</List>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary">
|
||||
<Button onClick={handleClose} variant="dialogSecondary" >
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={handleOk} color="primary" disabled={currentSelection.length === 0 || currentSelection.length > 2} >
|
||||
<Button onClick={handleOk} variant="dialogPrimary" disabled={currentSelection.length === 0 || currentSelection.length > 2} >
|
||||
OK
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -110,10 +110,10 @@ function SelectMidiChannelsDialog(props: SelectMidiChannelsDialogProps) {
|
||||
)}
|
||||
</List>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary">
|
||||
<Button onClick={handleClose} variant="dialogSecondary" >
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={handleOk} color="primary" >
|
||||
<Button onClick={handleOk} variant="dialogPrimary" >
|
||||
OK
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -79,10 +79,10 @@ function SelectThemesDialog(props: SelectThemesDialogProps) {
|
||||
</FormControl>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary">
|
||||
<Button onClick={handleClose} variant="dialogSecondary" >
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={handleOk} color="primary" >
|
||||
<Button onClick={handleOk} variant="dialogPrimary" >
|
||||
OK
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -384,7 +384,8 @@ export default class UploadFileDialog extends ResizeResponsiveComponent<UploadFi
|
||||
|
||||
<DialogActions >
|
||||
<Button
|
||||
component="label" color="primary" style={{ whiteSpace: "nowrap", textOverflow: "ellipsis", marginLeft: 16, width: 120, flex: "0 0 auto" }}
|
||||
component="label" variant="dialogPrimary" style={{ whiteSpace: "nowrap",
|
||||
textOverflow: "ellipsis", marginLeft: 16, width: 120, flex: "0 0 auto" }}
|
||||
>
|
||||
Select Files
|
||||
<input
|
||||
@@ -399,12 +400,12 @@ export default class UploadFileDialog extends ResizeResponsiveComponent<UploadFi
|
||||
{
|
||||
this.state.okEnabled ?
|
||||
(
|
||||
<Button onClick={() => this.handleClose()} color="primary">
|
||||
<Button onClick={() => this.handleClose()} variant="dialogPrimary" >
|
||||
OK
|
||||
</Button>
|
||||
|
||||
) : (
|
||||
<Button onClick={() => this.handleCancel()} color="primary">
|
||||
<Button onClick={() => this.handleCancel()} variant="dialogPrimary" >
|
||||
Cancel
|
||||
</Button>
|
||||
|
||||
|
||||
@@ -182,11 +182,11 @@ export default class UploadPresetDialog extends ResizeResponsiveComponent<Upload
|
||||
</DialogContent>
|
||||
|
||||
<DialogActions>
|
||||
<Button onClick={() => this.handleClose()} color="primary">
|
||||
<Button onClick={() => this.handleClose()} variant="dialogSecondary" >
|
||||
Cancel
|
||||
</Button>
|
||||
<Button
|
||||
component="label" color="secondary" style={{width: 120}}
|
||||
component="label" variant="dialogPrimary" style={{width: 120}}
|
||||
>
|
||||
Select File
|
||||
<input
|
||||
|
||||
@@ -337,10 +337,10 @@ const WifiConfigDialog = withStyles(styles, { withTheme: true })(
|
||||
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary" style={{ width: 120 }}>
|
||||
<Button onClick={handleClose} variant="dialogSecondary" style={{ width: 120 }}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={()=> this.handleOk(false)} color="success" style={{ width: 120 }} >
|
||||
<Button onClick={()=> this.handleOk(false)} variant="dialogPrimary" style={{ width: 120 }} >
|
||||
OK
|
||||
</Button>
|
||||
</DialogActions>
|
||||
@@ -356,13 +356,13 @@ const WifiConfigDialog = withStyles(styles, { withTheme: true })(
|
||||
</Typography>
|
||||
</DialogContent>
|
||||
<DialogActions>
|
||||
<Button onClick={()=> this.setState({showWifiWarningDialog: false})} color="primary" style={{ width: 120 }}>
|
||||
<Button onClick={()=> this.setState({showWifiWarningDialog: false})} variant="dialogSecondary" style={{ width: 120 }}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={()=> {
|
||||
this.setState({showWifiWarningDialog: false});
|
||||
this.handleOk(true);
|
||||
}} color="secondary" style={{ width: 120 }} >
|
||||
}} variant="dialogPrimary" style={{ width: 120 }} >
|
||||
PROCEED
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
@@ -506,10 +506,10 @@ const WifiDirectConfigDialog = withStyles(styles, { withTheme: true })(
|
||||
)}
|
||||
|
||||
<DialogActions>
|
||||
<Button onClick={handleClose} color="primary" style={{ width: 120 }}>
|
||||
<Button onClick={handleClose} variant="dialogSecondary" style={{ width: 120 }}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button onClick={() => this.handleOk()} color="primary" style={{ width: 120 }} >
|
||||
<Button onClick={() => this.handleOk()} variant="dialogPrimary" style={{ width: 120 }} >
|
||||
OK
|
||||
</Button>
|
||||
</DialogActions>
|
||||
|
||||
Reference in New Issue
Block a user