fix checkbox on dark theme and respect mini too

This commit is contained in:
nikk gitanes
2021-08-24 00:35:27 +03:00
parent 3e79bfb4bb
commit e61a86da0d
4 changed files with 10 additions and 6 deletions

View File

@@ -54,7 +54,9 @@ export default function DetailedView({
<FormControlLabel
control={
<Checkbox
color='primary'
checked={isSnakeDebugMode}
disableRipple
onChange={({ target: { checked } }) => {
setIsSnakeDebugMode(checked)
localStorage.setItem('isSnakeDebugMode', checked)
@@ -62,6 +64,7 @@ export default function DetailedView({
/>
}
label={t('DebugMode')}
labelPlacement='start'
/>
</div>
</SectionTitle>

View File

@@ -91,16 +91,16 @@ const TorrentCache = ({ cache, isMini, isSnakeDebugMode }) => {
ctx.strokeRect(0, 0, pieceSize, pieceSize)
ctx.setTransform(1, 0, 0, 1, 0, 0)
if (!isMini && isSnakeDebugMode && priority > 0) {
if (isSnakeDebugMode && priority > 0) {
let info = ''
if (priority === 1) info = '*'
else if (priority === 2) info = 'H'
else if (priority === 3) info = 'R'
else if (priority === 4) info = 'N'
else if (priority === 5) info = 'A'
ctx.font = '10px monospace'
const xpad = pieceSize * 0.28
const ypad = pieceSize * 0.78
ctx.font = isMini ? '13px monospace' : '10px monospace'
const xpad = isMini ? pieceSize * 0.35 : pieceSize * 0.29
const ypad = isMini ? pieceSize * 0.69 : pieceSize * 0.78
ctx.fillStyle = 'black'
ctx.fillText(info, x + xpad, y + ypad)
}

View File

@@ -45,6 +45,7 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
const [playableFileList, setPlayableFileList] = useState()
const [seasonAmount, setSeasonAmount] = useState(null)
const [selectedSeason, setSelectedSeason] = useState()
const [isSnakeDebugMode] = useState(JSON.parse(localStorage.getItem('isSnakeDebugMode')) || false)
const {
poster,
@@ -210,7 +211,7 @@ export default function DialogTorrentDetailsContent({ closeDialog, torrent }) {
/>
</SectionHeader>
<TorrentCache isMini cache={cache} />
<TorrentCache isMini cache={cache} isSnakeDebugMode={isSnakeDebugMode} />
<Button
style={{ marginTop: '30px' }}
variant='contained'

View File

@@ -80,7 +80,7 @@
"RemoveViews": "Очистить просмотры",
"Resolution": "Разреш.",
"Save": "Сохранить",
"ScrollDown": "прокрутить вниз",
"ScrollDown": "прокрутите вниз",
"Season": "Сезон",
"Sec": "c",
"Seconds": "Секунды",