Skip to content

Commit a974831

Browse files
committed
Change design for chapter timeline
Make the chapter portion a bit smaller.
1 parent 00caecf commit a974831

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

src/main/SubtitleTimeline.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -393,6 +393,7 @@ const TimelineSubtitleSegment: React.FC<{
393393
border: `${theme.subtitle_segment_border}`,
394394
borderRadius: "5px",
395395
boxSizing: "border-box",
396+
color: `${theme.subtitle_segment_text}`,
396397
zIndex: 1,
397398

398399
cursor: isGrabbed ? "grabbing" : "grab",

src/main/Timeline.tsx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -161,11 +161,14 @@ const Timeline: React.FC<{
161161
setIsPlaying={setIsPlaying}
162162
/>
163163
<div css={{ position: "relative", height: timelineHeight + "px" }}>
164-
<Waveforms timelineHeight={timelineHeight}/>
164+
<Waveforms
165+
timelineHeight={!isChapters ? timelineHeight : (timelineHeight / 4) * 3}
166+
topOffset={!isChapters ? undefined : (timelineHeight / 4) * 1}
167+
/>
165168
{isChapters &&
166169
<SegmentsList
167170
timelineWidth={width}
168-
timelineHeight={timelineHeight / 2}
171+
timelineHeight={(timelineHeight / 4) * 1}
169172
styleByActiveSegment={styleByActiveSegment}
170173
tabable={true}
171174
selectSegments={chapterSelectSegments}
@@ -175,8 +178,8 @@ const Timeline: React.FC<{
175178
}
176179
<SegmentsList
177180
timelineWidth={width}
178-
timelineHeight={!isChapters ? timelineHeight : timelineHeight / 2}
179-
styleByActiveSegment={styleByActiveSegment}
181+
timelineHeight={!isChapters ? timelineHeight : (timelineHeight / 4) * 3}
182+
styleByActiveSegment={!isChapters ? styleByActiveSegment : false}
180183
tabable={true}
181184
selectSegments={selectSegments}
182185
selectActiveSegmentIndex={selectActiveSegmentIndex}
@@ -404,7 +407,6 @@ export const SegmentsList: React.FC<{
404407
moveCut,
405408
}) => {
406409
const { t } = useTranslation();
407-
const theme = useTheme();
408410

409411
// Init redux variables
410412
const segments = useAppSelector(selectSegments);
@@ -472,7 +474,6 @@ export const SegmentsList: React.FC<{
472474
whiteSpace: "nowrap",
473475
textOverflow: "ellipsis",
474476
padding: "8px",
475-
color: `${theme.subtitle_segment_text}`,
476477
}}
477478
>
478479
{segment.text}
@@ -497,8 +498,6 @@ export const SegmentsList: React.FC<{
497498
const segmentsStyle = css({
498499
display: "flex",
499500
flexDirection: "row",
500-
// paddingTop: "10px",
501-
height: "50%",
502501
});
503502

504503
return (
@@ -627,7 +626,7 @@ export const CutMark: React.FC<{
627626
/**
628627
* Generates waveform images and displays them
629628
*/
630-
export const Waveforms: React.FC<{ timelineHeight: number; }> = ({ timelineHeight }) => {
629+
export const Waveforms: React.FC<{ timelineHeight: number; topOffset?: number }> = ({ timelineHeight, topOffset }) => {
631630

632631
const { t } = useTranslation();
633632

@@ -649,7 +648,7 @@ export const Waveforms: React.FC<{ timelineHeight: number; }> = ({ timelineHeigh
649648
...(images.length <= 0) && { alignItems: "center" }, // Only center during loading
650649
width: "100%",
651650
height: timelineHeight + "px", // CHECK IF height: "100%",
652-
// paddingTop: "10px",
651+
paddingTop: topOffset,
653652
filter: `${theme.invert_wave}`,
654653
color: `${theme.inverted_text}`,
655654
});

0 commit comments

Comments
 (0)