diff --git a/src/components/WindowThumbnailSettings.js b/src/components/WindowThumbnailSettings.js index e25dc0553e..042355e4d0 100644 --- a/src/components/WindowThumbnailSettings.js +++ b/src/components/WindowThumbnailSettings.js @@ -1,4 +1,5 @@ import { Component } from 'react'; +import { styled } from '@mui/material/styles'; import FormControlLabel from '@mui/material/FormControlLabel'; import ListSubheader from '@mui/material/ListSubheader'; import MenuItem from '@mui/material/MenuItem'; @@ -6,6 +7,19 @@ import ThumbnailsOffIcon from '@mui/icons-material/CropDinSharp'; import PropTypes from 'prop-types'; import ThumbnailNavigationBottomIcon from './icons/ThumbnailNavigationBottomIcon'; import ThumbnailNavigationRightIcon from './icons/ThumbnailNavigationRightIcon'; + +const ThumbnailOption = styled(MenuItem, { name: 'WindowThumbnailSettings', slot: 'option' })(({ selected, theme }) => ({ + '& .MuiFormControlLabel-label': { + borderBottom: '2px solid transparent', + ...(selected && { + borderBottomColor: theme.palette.secondary.main, + }), + }, + backgroundColor: 'transparent !important', + color: selected ? theme.palette.secondary.main : undefined, + display: 'inline-block', +})); + /** * */ @@ -41,60 +55,40 @@ export class WindowThumbnailSettings extends Component { <> {t('thumbnails')} - { this.handleChange('off'); handleClose(); }}> + { this.handleChange('off'); handleClose(); }}> + } label={t('off')} labelPlacement="bottom" /> - - { this.handleChange('far-bottom'); handleClose(); }}> + + { this.handleChange('far-bottom'); handleClose(); }}> + } label={t('bottom')} labelPlacement="bottom" /> - - { this.handleChange('far-right'); handleClose(); }}> + + { this.handleChange('far-right'); handleClose(); }}> )} label={t('right')} labelPlacement="bottom" /> - + ); } diff --git a/src/components/WindowViewSettings.js b/src/components/WindowViewSettings.js index 1895516550..e693b2ffcd 100644 --- a/src/components/WindowViewSettings.js +++ b/src/components/WindowViewSettings.js @@ -1,4 +1,5 @@ import { Component } from 'react'; +import { styled } from '@mui/material/styles'; import FormControlLabel from '@mui/material/FormControlLabel'; import MenuItem from '@mui/material/MenuItem'; import ListSubheader from '@mui/material/ListSubheader'; @@ -8,6 +9,18 @@ import PropTypes from 'prop-types'; import BookViewIcon from './icons/BookViewIcon'; import GalleryViewIcon from './icons/GalleryViewIcon'; +const ViewOption = styled(MenuItem, { name: 'WindowViewSettings', slot: 'option' })(({ selected, theme }) => ({ + '& .MuiFormControlLabel-label': { + borderBottom: '2px solid transparent', + ...(selected && { + borderBottomColor: theme.palette.secondary.main, + }), + }, + backgroundColor: 'transparent !important', + color: selected ? theme.palette.secondary.main : undefined, + display: 'inline-block', +})); + /** * */ @@ -49,26 +62,19 @@ export class WindowViewSettings extends Component { /** Suspiciously similar to a component, yet if it is invoked through JSX none of the click handlers work? */ const menuItem = ({ value, Icon }) => ( - { this.handleChange(value); handleClose(); }} > } + control={} label={t(value)} labelPlacement="bottom" /> - + ); if (viewTypes.length === 0) return null;