Skip to content

Commit

Permalink
Merge pull request #637 from Kitware/chip-fix
Browse files Browse the repository at this point in the history
Fix label button layout and Layering
  • Loading branch information
floryst authored Aug 12, 2024
2 parents 7b721aa + 9cbc411 commit 40ff400
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/components/EditableChipList.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,7 @@ const itemsToRender = computed(() =>
@click="toggle"
>
<slot name="item-prepend" :key="key" :item="items[idx]"></slot>
<span class="overflow-hidden">{{ title }}</span>
<v-spacer />
<span class="text-truncate">{{ title }}</span>
<slot name="item-append" :key="key" :item="items[idx]"></slot>
</v-chip>
</v-item>
Expand All @@ -70,4 +69,8 @@ const itemsToRender = computed(() =>
background-color: rgb(var(--v-theme-selection-bg-color));
border-color: rgb(var(--v-theme-selection-border-color));
}
.v-chip:deep() .v-chip__content {
width: 100%;
}
</style>
10 changes: 9 additions & 1 deletion src/store/datasets-layers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ref } from 'vue';
import { computed, ref, unref } from 'vue';
import { until } from '@vueuse/core';
import vtkImageData from '@kitware/vtk.js/Common/DataModel/ImageData';
import vtkBoundingBox from '@kitware/vtk.js/Common/DataModel/BoundingBox';
import { defineStore } from 'pinia';
Expand All @@ -7,6 +8,7 @@ import { Maybe } from '@/src/types';
import { ensureSameSpace } from '@/src/io/resample/resample';
import { useErrorMessage } from '../composables/useErrorMessage';
import { Manifest, StateFile } from '../io/state-file/schema';
import useChunkStore from './chunks';

// differ from Image/Volume IDs with a branded type
export type LayerID = string & { __type: 'LayerID' };
Expand Down Expand Up @@ -66,6 +68,12 @@ export const useLayersStore = defineStore('layer', () => {
parent: DataSelection,
source: DataSelection
) {
// ensureSameSpace need final image array to resample, so wait for all chunks
const doneLoading = computed(
() => !unref(useChunkStore().chunkImageById[source].isLoading)
);
await until(doneLoading).toBe(true);

return useErrorMessage('Failed to build layer', async () => {
try {
await this._addLayer(parent, source);
Expand Down

0 comments on commit 40ff400

Please sign in to comment.