Skip to content

Commit

Permalink
improve tracks ui #482
Browse files Browse the repository at this point in the history
  • Loading branch information
mifi committed Aug 27, 2021
1 parent d77da7c commit f387272
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions src/StreamsSelector.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -223,18 +223,20 @@ const Stream = memo(({ filePath, stream, onToggle, batchSetCopyStreamIds, copySt

return (
<tr style={{ opacity: copyStream ? undefined : 0.4 }}>
<td style={{ whiteSpace: 'nowrap', display: 'flex', alignItems: 'center' }} title={t('Click to toggle track inclusion when exporting')}>
<div style={{ width: 16 }}>{stream.index}</div>
<IconButton appearance="minimal" icon={() => <Icon color={copyStream ? '#52BD95' : '#D14343'} size={20} />} onClick={onClick} />
<td style={{ whiteSpace: 'nowrap', display: 'flex', alignItems: 'center' }}>
<div style={{ width: 20 }}>{stream.index}</div>
{stream.codec_type}
</td>
<td>{stream.codec_type}</td>
<td>{stream.codec_tag !== '0x0000' && stream.codec_tag_string}</td>
<td style={{ maxWidth: '3em', overflow: 'hidden' }} title={stream.codec_name}>{stream.codec_name}</td>
<td>{!Number.isNaN(duration) && `${formatDuration({ seconds: duration, shorten: true })}`}</td>
<td>{stream.nb_frames}</td>
<td>{!Number.isNaN(bitrate) && `${(bitrate / 1e6).toFixed(1)}MBit`}</td>
<td style={{ maxWidth: '2.5em', overflow: 'hidden' }} title={language}>{language}</td>
<td>{stream.width && stream.height && `${stream.width}x${stream.height}`} {stream.channels && `${stream.channels}c`} {stream.channel_layout} {streamFps && `${streamFps.toFixed(2)}fps`}</td>
<td>
<IconButton title={t('Click to toggle track inclusion when exporting')} appearance="minimal" icon={() => <Icon color={copyStream ? '#52BD95' : '#D14343'} size={20} />} onClick={onClick} />
</td>
<td style={{ display: 'flex' }}>
<IconButton icon={InfoSignIcon} onClick={() => onInfoClick(stream, t('Track info'))} appearance="minimal" iconSize={18} />
<IconButton title={t('Extract this track as file')} icon={() => <FaFileExport size={18} />} onClick={onExtractStreamPress} appearance="minimal" iconSize={18} />
Expand Down Expand Up @@ -289,25 +291,25 @@ const FileHeading = ({ path, formatData, onTrashClick, onEditClick, setCopyAllSt
const Thead = () => {
const { t } = useTranslation();
return (
<thead style={{ color: 'rgba(0,0,0,0.6)' }}>
<thead style={{ color: 'rgba(0,0,0,0.6)', textAlign: 'left' }}>
<tr>
<th>{t('Keep?')}</th>
<th>{t('Type')}</th>
<th style={{ paddingLeft: 20 }}>{t('Type')}</th>
<th>{t('Tag')}</th>
<th>{t('Codec')}</th>
<th>{t('Duration')}</th>
<th>{t('Frames')}</th>
<th>{t('Bitrate')}</th>
<th>{t('Lang')}</th>
<th>{t('Data')}</th>
<th>{t('Keep?')}</th>
<th />
</tr>
</thead>
);
};

const tableStyle = { fontSize: 14, width: '100%' };
const fileStyle = { marginBottom: 20, padding: 5 };
const fileStyle = { marginBottom: 20, padding: 5, minWidth: '100%', overflowX: 'auto' };

const StreamsSelector = memo(({
mainFilePath, mainFileFormatData, streams: mainFileStreams, isCopyingStreamId, toggleCopyStreamId,
Expand Down

0 comments on commit f387272

Please sign in to comment.