diff --git a/src/frontend/components/UI/ProgressDialog/index.css b/src/frontend/components/UI/ProgressDialog/index.css index 44223af814..7573a88fea 100644 --- a/src/frontend/components/UI/ProgressDialog/index.css +++ b/src/frontend/components/UI/ProgressDialog/index.css @@ -34,15 +34,15 @@ } .progressDialog.log-error { - color: #c18672; + color: var(--text-danger); } .progressDialog.log-warning { - color: #f5cf69; + color: var(--text-warning); } .progressDialog.log-info { - color: rgb(175, 172, 172); + color: var(--text-default); } .progressDialog.header { @@ -57,7 +57,3 @@ .progressDialog.linearProgress > .MuiLinearProgress-bar { background-color: var(--accent); } - -.progressHeaderETA { - color: var(--accent); -} diff --git a/src/frontend/index.css b/src/frontend/index.css index 73e8d21904..72b68e2f9f 100644 --- a/src/frontend/index.css +++ b/src/frontend/index.css @@ -40,7 +40,7 @@ html { --danger-hover: #e43f3f; --icon-disabled: #625e69; --icons-background: #17131c; - --divider: #ffbb3384; + --divider: gray; --osk-background: var(--body-background); --osk-button-background: var(--input-background); --osk-button-border: var(--navbar-background); @@ -74,10 +74,11 @@ html { --text-default: #eae8e5; --text-secondary: #b1b1b1; --text-pause-cancel: #97f4e9; - --text-title: #97f4e9; + --text-title: white; --text-tertiary: #101111; /* This is not defined in figma */ --text-quartenary: #5a5e5f; /* this is meant to be a background colour */ --text-danger: #d22121; + --text-warning: #f5cf69; /* Fonts */ --font-primary-regular: var(--actions-font-family) normal 400; --font-primary-bold: var(--actions-font-family) normal 500; diff --git a/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.css b/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.css index 470bb0490d..8499089256 100644 --- a/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.css +++ b/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.css @@ -25,14 +25,14 @@ display: grid; grid-template-columns: 3fr 1fr; grid-template-areas: 'name action'; - margin: 0.5em 2em; + margin: 0em 2em; align-items: center; justify-items: baseline; position: relative; cursor: default; place-self: center; - border-bottom: 1px solid gray; - padding: 0.5rem 0; + border-bottom: 1px solid var(--divider); + padding: 1rem 0; } .downloadManagerTitleList { diff --git a/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx b/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx index 8f3e57a17e..8ec707d78e 100644 --- a/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx +++ b/src/frontend/screens/DownloadManager/components/DownloadManagerItem/index.tsx @@ -1,6 +1,6 @@ import './index.css' -import React from 'react' +import React, { useContext } from 'react' import { GameInfo, InstallParams } from 'common/types' import { ReactComponent as StopIcon } from 'frontend/assets/stop-icon.svg' @@ -10,11 +10,14 @@ import { handleStopInstallation } from 'frontend/helpers/library' import { getGameInfo } from 'frontend/helpers' import { useTranslation } from 'react-i18next' import { hasProgress } from 'frontend/hooks/hasProgress' +import ContextProvider from 'frontend/state/ContextProvider' const DownloadManagerItem = (props: { params: InstallParams current: boolean }) => { + const { epic, gog } = useContext(ContextProvider) + const library = [...epic.library, ...gog.library] const { t } = useTranslation('gamepage') const [progress] = hasProgress(props.params.appName) @@ -45,7 +48,10 @@ const DownloadManagerItem = (props: { return props.current ? ( ) : ( - + ) } @@ -57,7 +63,9 @@ const DownloadManagerItem = (props: { return (
- {props.params.appName} + + {library.find((val) => val.app_name === props.params.appName)?.title} + { diff --git a/src/frontend/screens/DownloadManager/components/ProgressHeader/index.css b/src/frontend/screens/DownloadManager/components/ProgressHeader/index.css index 8d9fe93067..f014d20e5d 100644 --- a/src/frontend/screens/DownloadManager/components/ProgressHeader/index.css +++ b/src/frontend/screens/DownloadManager/components/ProgressHeader/index.css @@ -1,35 +1,75 @@ -.progressHeader { - display: grid; - grid-template-columns: 1.5fr 1fr 1.5fr 1fr; - grid-template-areas: 'speed percent eta'; - margin: 0.5em 2em; - align-items: center; +.downloadRateStats { + display: flex; + flex-direction: row; position: relative; cursor: default; - border-bottom: 1px solid gray; - padding: 0.5rem 0; + padding: 1rem 0; +} + +.progressHeader { + margin: 0.5em 2em; } -.progressHeader.linearProgress { - margin-top: 10px; - background-color: var(--primary); +.linearProgress { + margin-top: 0.25em; + background-color: var(--text-default); } -.progressHeader.linearProgress > .MuiLinearProgress-bar { +.linearProgress > .MuiLinearProgress-bar { background-color: var(--accent); } .progressChartValues { - display: grid; - flex-direction: column; + display: flex; + flex-direction: row; justify-content: start; justify-items: start; } -.progressChartValues > .downSpeed { +.downloadProgressStats { + display: flex; + align-items: stretch; + justify-content: space-between; +} + +.downloadProgress { + padding: 1em 0em; +} + +.downloadStat { + color: var(--text-default); + margin: 0; + padding: 0; +} + +.realtimeDownloadStat { + white-space: nowrap; + margin: 0px; +} + +.realtimeDownloadStatLabel { + margin: auto; + padding: auto; + text-align: left; + height: auto; +} + +.realtimeDownloadStatContainer { + align-self: center; + margin: 1em; + box-sizing: border-box; +} + +.downloadRateChart { + flex-grow: 1; + /* overflow: hidden; */ + position: relative; +} + +.downLabel { color: var(--accent); } -.progressChartValues > .diskSpeed { +.diskLabel { color: var(--primary); } diff --git a/src/frontend/screens/DownloadManager/components/ProgressHeader/index.tsx b/src/frontend/screens/DownloadManager/components/ProgressHeader/index.tsx index 520846f61f..88439bda6a 100644 --- a/src/frontend/screens/DownloadManager/components/ProgressHeader/index.tsx +++ b/src/frontend/screens/DownloadManager/components/ProgressHeader/index.tsx @@ -2,18 +2,18 @@ import './index.css' import { hasProgress } from 'frontend/hooks/hasProgress' import React, { useEffect, useState } from 'react' import { AreaChart, Area, ResponsiveContainer } from 'recharts' -import { - Box, - LinearProgress, - LinearProgressProps, - Typography -} from '@mui/material' +import { LinearProgress } from '@mui/material' interface Point { download: number disk: number } +const roundToNearestHundredth = function (val: number | undefined) { + if (!val) return 0 + return Math.round(val * 100) / 100 +} + export default function ProgressHeader(props: { appName: string }) { const [progress] = hasProgress(props.appName) const [avgSpeed, setAvgDownloadSpeed] = useState( @@ -36,58 +36,74 @@ export default function ProgressHeader(props: { appName: string }) { setAvgDownloadSpeed([...avgSpeed]) }, [progress]) - function LinearProgressWithLabel( - props: LinearProgressProps & { value: number } - ) { - return ( - - - - - - {`${props.value}%`} - - - ) - } - return (
- - - - +
+
+ + + + + + +
+
+
+

+ {roundToNearestHundredth(avgSpeed.at(-1)?.download)} MiB/s +

+
Down
+
+
+

+ {roundToNearestHundredth(avgSpeed.at(-1)?.disk)} MiB/s +

+
Disk
+
+
+
+
+

{`${ + progress.percent ?? 0 + }%`}

+

{`ETA: ${progress.eta ?? '00.00.00'}`}

+
+
+ - - -
-

Down: {avgSpeed.at(-1)?.download} MiB/s

-

Disk: {avgSpeed.at(-1)?.disk} MiB/s

+
- -
{`ETA: ${ - progress.eta ?? '00.00.00' - }`}
) } diff --git a/src/frontend/screens/DownloadManager/index.css b/src/frontend/screens/DownloadManager/index.css index 1421edfcb2..120520e458 100644 --- a/src/frontend/screens/DownloadManager/index.css +++ b/src/frontend/screens/DownloadManager/index.css @@ -1,7 +1,3 @@ -.downloadList { - margin-top: 48px; -} - .downloadList > .gameListHeader { grid-template-columns: 3fr 1fr; } @@ -29,3 +25,16 @@ .downloadManager > .MuiTabs-root > .MuiTabs-scroller > .MuiTabs-indicator { background-color: var(--accent); } + +.downloadManager { + padding: 0; + margin: 0; +} + +.downloadManagerCurrentSectionTitle { + margin: 0px 0px 0px 0px; +} + +.downloadManagerQueuedSectionTitle { + margin: 30px 0px 0px 0px; +} diff --git a/src/frontend/screens/DownloadManager/index.tsx b/src/frontend/screens/DownloadManager/index.tsx index 2e879e53a9..c40a2d31c3 100644 --- a/src/frontend/screens/DownloadManager/index.tsx +++ b/src/frontend/screens/DownloadManager/index.tsx @@ -52,7 +52,7 @@ export default function DownloadManager(): JSX.Element | null { style={!currentElement ? { backgroundColor: 'transparent' } : {}} className="downloadList" > -

Current

+

Current

{t('download.manager.queue.element', 'Name')} {t('download.manager.queue.actions', 'Action')} @@ -63,7 +63,7 @@ export default function DownloadManager(): JSX.Element | null { /> {!!plannendElements.length && ( <> -

Plannend

+

Queued

{t('download.manager.queue.element', 'Name')} {t('download.manager.queue.actions', 'Action')} diff --git a/src/frontend/screens/Library/index.css b/src/frontend/screens/Library/index.css index 1346584b7d..754c3ab8e0 100644 --- a/src/frontend/screens/Library/index.css +++ b/src/frontend/screens/Library/index.css @@ -23,7 +23,7 @@ grid-template-columns: 3fr 2fr 1fr 10%; justify-items: baseline; margin: 0 2rem; - border-bottom: 1px solid gray; + border-bottom: 1px solid var(--divider); color: var(--text-default); font-weight: 700; padding-bottom: 0.5rem;