@@ -2,6 +2,7 @@ import { styled } from '@mui/material/styles';
22import FormControlLabel from '@mui/material/FormControlLabel' ;
33import ListSubheader from '@mui/material/ListSubheader' ;
44import MenuItem from '@mui/material/MenuItem' ;
5+ import MenuList from '@mui/material/MenuList' ;
56import ThumbnailsOffIcon from '@mui/icons-material/CropDinSharp' ;
67import PropTypes from 'prop-types' ;
78import { useTranslation } from 'react-i18next' ;
@@ -14,20 +15,23 @@ const ThumbnailOption = styled(MenuItem, { name: 'WindowThumbnailSettings', slot
1415 ...( selected && {
1516 borderBottomColor : theme . palette . secondary . main ,
1617 } ) ,
18+ '&.Mui-selected' : {
19+ backgroundColor : 'transparent !important' ,
20+ } ,
21+ '&.Mui-selected.Mui-focusVisible' : {
22+ backgroundColor : `${ ( theme . vars || theme ) . palette . action . focus } !important` ,
23+ } ,
24+ '&:focused' : {
25+ backgroundColor : `${ ( theme . vars || theme ) . palette . action . focus } !important` ,
26+ } ,
27+ color : selected ? theme . palette . secondary . main : undefined ,
28+ display : 'inline-flex' ,
1729 } ,
18- '&.Mui-selected' : {
19- backgroundColor : 'transparent !important' ,
20- } ,
21- '&.Mui-selected.Mui-focusVisible' : {
22- backgroundColor : `${ ( theme . vars || theme ) . palette . action . focus } !important` ,
23- } ,
24- '&:focused' : {
25- backgroundColor : `${ ( theme . vars || theme ) . palette . action . focus } !important` ,
26- } ,
27- color : selected ? theme . palette . secondary . main : undefined ,
28- display : 'inline-block' ,
2930} ) ) ;
3031
32+ const StyledMenuList = styled ( MenuList , { name : 'WindowViewSettings' , slot : 'option' } ) ( ( ) => ( {
33+ display : 'inline-flex' ,
34+ } ) ) ;
3135/**
3236 *
3337 */
@@ -40,43 +44,63 @@ export function WindowThumbnailSettings({
4044
4145 return (
4246 < >
43- < ListSubheader role = "presentation" disableSticky tabIndex = { - 1 } > { t ( 'thumbnails' ) } </ ListSubheader >
44-
45- < ThumbnailOption selected = { thumbnailNavigationPosition === 'off' } onClick = { ( ) => { handleChange ( 'off' ) ; } } >
46- < FormControlLabel
47- value = "off"
48- control = {
49- < ThumbnailsOffIcon color = { thumbnailNavigationPosition === 'off' ? 'secondary' : undefined } fill = "currentcolor" />
50- }
51- label = { t ( 'off' ) }
52- labelPlacement = "bottom"
53- />
54- </ ThumbnailOption >
55- < ThumbnailOption selected = { thumbnailNavigationPosition === 'far-bottom' } onClick = { ( ) => { handleChange ( 'far-bottom' ) ; } } >
56- < FormControlLabel
57- value = "far-bottom"
58- control = {
59- < ThumbnailNavigationBottomIcon color = { thumbnailNavigationPosition === 'far-bottom' ? 'secondary' : undefined } fill = "currentcolor" />
60- }
61- label = { t ( 'bottom' ) }
62- labelPlacement = "bottom"
63- />
64- </ ThumbnailOption >
65- < ThumbnailOption selected = { thumbnailNavigationPosition === 'far-right' } onClick = { ( ) => { handleChange ( 'far-right' ) ; } } >
66- < FormControlLabel
67- value = "far-right"
68- control = { (
69- < ThumbnailNavigationRightIcon
70- color = { thumbnailNavigationPosition === 'far-right' ? 'secondary' : undefined }
71- fill = "currentcolor"
72- style = { direction === 'rtl' ? { transform : 'rotate(180deg)' } : { } }
73- />
74- ) }
75- label = { t ( 'right' ) }
76- labelPlacement = "bottom"
77- />
78- </ ThumbnailOption >
47+ < ListSubheader role = "presentation" disableSticky > { t ( 'thumbnails' ) } </ ListSubheader >
48+ < StyledMenuList role = "menubar" >
49+ < ThumbnailOption
50+ aria-checked = { thumbnailNavigationPosition === 'off' }
51+ key = "off"
52+ onClick = { ( ) => { handleChange ( 'off' ) ; } }
53+ role = "menuitemradio"
54+ selected = { thumbnailNavigationPosition === 'off' }
55+ >
56+ < FormControlLabel
57+ control = {
58+ < ThumbnailsOffIcon color = { thumbnailNavigationPosition === 'off' ? 'secondary' : undefined } fill = "currentcolor" />
59+ }
60+ label = { t ( 'off' ) }
61+ labelPlacement = "bottom"
62+ value = "off"
63+ />
64+ </ ThumbnailOption >
65+ < ThumbnailOption
66+ aria-checked = { thumbnailNavigationPosition === 'far-bottom' }
67+ key = "far-bottom"
68+ onClick = { ( ) => { handleChange ( 'far-bottom' ) ; } }
69+ role = "menuitemradio"
70+ selected = { thumbnailNavigationPosition === 'far-bottom' }
71+ >
72+ < FormControlLabel
73+ control = {
74+ < ThumbnailNavigationBottomIcon color = { thumbnailNavigationPosition === 'far-bottom' ? 'secondary' : undefined } fill = "currentcolor" />
75+ }
76+ label = { t ( 'bottom' ) }
77+ labelPlacement = "bottom"
78+ value = "far-bottom"
79+ />
80+ </ ThumbnailOption >
81+ < ThumbnailOption
82+ aria-checked = { thumbnailNavigationPosition === 'far-right' }
83+ key = "far-right"
84+ onClick = { ( ) => { handleChange ( 'far-right' ) ; } }
85+ role = "menuitemradio"
86+ selected = { thumbnailNavigationPosition === 'far-right' }
87+ >
88+ < FormControlLabel
89+ control = { (
90+ < ThumbnailNavigationRightIcon
91+ color = { thumbnailNavigationPosition === 'far-right' ? 'secondary' : undefined }
92+ fill = "currentcolor"
93+ style = { direction === 'rtl' ? { transform : 'rotate(180deg)' } : { } }
94+ />
95+ ) }
96+ label = { t ( 'right' ) }
97+ labelPlacement = "bottom"
98+ value = "far-right"
99+ />
100+ </ ThumbnailOption >
101+ </ StyledMenuList >
79102 </ >
103+
80104 ) ;
81105}
82106
0 commit comments