Skip to content

Commit

Permalink
Add additional depth to track panel title for fold button offset (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
ALevansSamsung authored Apr 2, 2024
1 parent 90579c4 commit 9407d38
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions ui/src/frontend/track_panel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,15 @@ class TrackShell implements m.ClassComponent<TrackShellAttrs> {
}
}

const depth = attrs.trackState.trackGroup === SCROLLING_TRACK_GROUP ?
const depth = (attrs.trackState.trackGroup === SCROLLING_TRACK_GROUP ?
0 :
getContainingTrackIds(globals.state, attrs.trackState.id)?.length ?? 0;
getContainingTrackIds(globals.state, attrs.trackState.id)?.length ?? 0) +
1;
const trackTitle = attrs.trackState.title ?? attrs.trackState.name;
const titleStyling: Record<string, string|undefined> = {
fontSize: getTitleSize(trackTitle),
};
if (depth > 0) {
titleStyling.marginLeft = `${depth/2}rem`;
}

const dragClass = this.dragging ? `drag` : '';
const dropClass = this.dropping ? `drop-${this.dropping}` : '';
Expand Down

0 comments on commit 9407d38

Please sign in to comment.