Skip to content

Commit

Permalink
Keep subtitle tools visible for enabled tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrews54757 committed Jan 25, 2024
1 parent 3824fc2 commit 46c3cb5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
13 changes: 3 additions & 10 deletions chrome/player/assets/fluidplayer/css/fluidplayer.css
Original file line number Diff line number Diff line change
Expand Up @@ -1689,11 +1689,7 @@ body {
color: var(--subtitles-track-enabled-color);
}

.subtitle-resync-tool,
.subtitle-download-tool,
.subtitle-remove-tool,
.subtitle-shiftl-tool,
.subtitle-shiftr-tool {
.subtitle-tool {
display: none;
position: absolute !important;
cursor: pointer;
Expand Down Expand Up @@ -1721,11 +1717,8 @@ body {
height: 20px;
}

.subtitle-track-element:hover .subtitle-resync-tool,
.subtitle-track-element:hover .subtitle-download-tool,
.subtitle-track-element:hover .subtitle-remove-tool,
.subtitle-track-element:hover .subtitle-shiftl-tool,
.subtitle-track-element:hover .subtitle-shiftr-tool {
.subtitle-track-element:hover .subtitle-tool,
.subtitle-track-element.subtitle-track-active .subtitle-tool {
display: block;
}

Expand Down
7 changes: 5 additions & 2 deletions chrome/player/ui/subtitles/SubtitlesManager.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ export class SubtitlesManager extends EventEmitter {

const resyncTool = document.createElement('div');
resyncTool.title = Localize.getMessage('player_subtitlesmenu_resynctool_label');
resyncTool.className = 'fluid_button fluid_button_wand subtitle-resync-tool';
resyncTool.className = 'fluid_button fluid_button_wand subtitle-resync-tool subtitle-tool';
trackElement.appendChild(resyncTool);
// svg use
const svg = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
Expand All @@ -309,7 +309,7 @@ export class SubtitlesManager extends EventEmitter {

const downloadTrack = document.createElement('div');
downloadTrack.title = Localize.getMessage('player_subtitlesmenu_savetool_label');
downloadTrack.className = 'fluid_button fluid_button_download subtitle-download-tool';
downloadTrack.className = 'fluid_button fluid_button_download subtitle-download-tool subtitle-tool';

// svg use
const svg2 = document.createElementNS('http://www.w3.org/2000/svg', 'svg');
Expand Down Expand Up @@ -347,6 +347,7 @@ export class SubtitlesManager extends EventEmitter {

const removeTrack = document.createElement('div');
removeTrack.classList.add('subtitle-remove-tool');
removeTrack.classList.add('subtitle-tool');
removeTrack.title = Localize.getMessage('player_subtitlesmenu_removetool_label');
trackElement.appendChild(removeTrack);

Expand All @@ -358,6 +359,7 @@ export class SubtitlesManager extends EventEmitter {

const shiftLTrack = document.createElement('div');
shiftLTrack.classList.add('subtitle-shiftl-tool');
shiftLTrack.classList.add('subtitle-tool');
shiftLTrack.title = Localize.getMessage('player_subtitlesmenu_shifttool_label', ['-0.2']);
trackElement.appendChild(shiftLTrack);

Expand All @@ -371,6 +373,7 @@ export class SubtitlesManager extends EventEmitter {

const shiftRTrack = document.createElement('div');
shiftRTrack.classList.add('subtitle-shiftr-tool');
shiftRTrack.classList.add('subtitle-tool');
shiftRTrack.title = Localize.getMessage('player_subtitlesmenu_shifttool_label', ['+0.2']);
trackElement.appendChild(shiftRTrack);

Expand Down

0 comments on commit 46c3cb5

Please sign in to comment.