This commit is contained in:
Daniel Ledda
2024-06-02 15:52:01 +02:00
parent 53edc94a28
commit 275ebc2fd5
3 changed files with 60 additions and 13 deletions

View File

@@ -23,8 +23,11 @@
item-key="index">
<template #item="{ element }">
<div v-if="element.track.visible.value" class="beat-line">
<div class="track-actions">
<span class="handle track-action"><icon color="var(--color-ui-neutral-dark)" icon-name="list" /></span>
<span class="track-action" @click="applyToolToTrack(element.track)"><icon color="var(--color-ui-neutral-dark)" icon-name="snowflake" /></span>
</div>
<editable-text-field class="track-name" v-model="element.track.name.value" />
<span class="handle"><icon color="var(--color-ui-neutral-dark)" icon-name="list" /></span>
<track-view :beat-index="beatIndex"
:track-index="element.index" />
</div>
@@ -80,6 +83,10 @@
}
}
function applyToolToTrack(track: Track) {
track.applySelectedTool();
}
</script>
<style scoped lang="scss">
@@ -122,11 +129,11 @@
.handle {
cursor: move;
color: var(--color-ui-neutral-dark);
opacity: 0%;
}
&:hover {
opacity: 100%;
}
.track-actions {
opacity: 0%;
display: flex;
}
.beat-line {
@@ -134,6 +141,17 @@
flex-direction: row;
justify-content: flex-end;
align-items: center;
&:hover .track-actions {
opacity: 100%;
.track-action {
opacity: 30%;
&:hover {
opacity: 100%;
}
}
}
}
.dragging {

View File

@@ -83,14 +83,7 @@
}
function applyCurrentToolToTrackUnit(index: number) {
switch (selectedTool.value) {
case "sticking":
track.value?.setStickingType(index, activeStickingType.value);
break;
case "track-unit-type":
track.value?.updateUnit(index, { on: activeTrackUnitType.value === null ? false : true, type: activeTrackUnitType.value === null ? undefined : activeTrackUnitType.value });
break;
}
track.value?.applySelectedTool(index);
}
</script>