Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions app/components/CameraManager.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,7 @@ function handleClose() {
</script>

<template>
<ToolPanel
v-model="show"
title="Camera Positions"
:width="width"
:escapeFunction="handleClose"
style="top: 90px; right: 55px"
z-index="1"
>
<ToolPanel v-model="show" title="Camera Positions" :width="width" :escapeFunction="handleClose">
<v-card-text class="pa-0">
<Saver />
<v-divider />
Expand Down
2 changes: 0 additions & 2 deletions app/components/CameraOrientation.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,8 +174,6 @@ watch(hoveredFace, (newFace, oldFace) => {
title="Camera Orientations"
:width="width"
:escapeFunction="escapeFunction"
style="top: 90px; right: 55px"
z-index="1"
>
<div
class="pa-0 overflow-hidden position-relative"
Expand Down
2 changes: 1 addition & 1 deletion app/components/ToolPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function close() {
.tool-panel {
z-index: 1;
top: 90px;
right: 55px;
right: 70px;
}
:deep(.v-card-title) {
font-size: 0.9rem !important;
Expand Down
36 changes: 29 additions & 7 deletions app/components/ViewToolbar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,28 @@ onKeyStroke("Escape", () => {
}
});

function closeAllToolsExcept(toolRef) {
const tools = [
showCameraOrientation,
show_camera_manager,
take_screenshot,
showZScaling,
showClippingPlanes,
showShrinkFilter,
showRuler,
];
for (const tool of tools) {
if (tool !== toolRef) {
tool.value = false;
}
}
}

function toggleTool(toolRef) {
closeAllToolsExcept(toolRef);
toolRef.value = !toolRef.value;
}

const camera_options = computed(() => [
{
testId: "resetCameraButton",
Expand Down Expand Up @@ -118,7 +140,7 @@ const camera_options = computed(() => [
tooltip: "Camera orientation",
icon: "mdi-rotate-3d",
action: () => {
showCameraOrientation.value = !showCameraOrientation.value;
toggleTool(showCameraOrientation);
},
},
{
Expand All @@ -127,15 +149,15 @@ const camera_options = computed(() => [
icon: CameraBookmarkIcon,
iconSize: 34,
action: () => {
show_camera_manager.value = !show_camera_manager.value;
toggleTool(show_camera_manager);
},
},
{
testId: "screenshotButton",
tooltip: "Take a screenshot",
icon: "mdi-camera",
action: () => {
take_screenshot.value = !take_screenshot.value;
toggleTool(take_screenshot);
},
},
{
Expand Down Expand Up @@ -165,7 +187,7 @@ const camera_options = computed(() => [
tooltip: "Z Scaling Control",
icon: "mdi-sort",
action: () => {
showZScaling.value = !showZScaling.value;
toggleTool(showZScaling);
},
},
{
Expand All @@ -174,7 +196,7 @@ const camera_options = computed(() => [
icon: "mdi-content-cut",
color: showClippingPlanes.value ? "primary" : undefined,
action: () => {
showClippingPlanes.value = !showClippingPlanes.value;
toggleTool(showClippingPlanes);
},
},
{
Expand All @@ -183,7 +205,7 @@ const camera_options = computed(() => [
icon: "mdi-arrow-collapse-all",
color: showShrinkFilter.value ? "primary" : undefined,
action: () => {
showShrinkFilter.value = !showShrinkFilter.value;
toggleTool(showShrinkFilter);
},
},
{
Expand All @@ -192,7 +214,7 @@ const camera_options = computed(() => [
icon: "mdi-ruler",
color: showRuler.value ? "primary" : undefined,
action: () => {
showRuler.value = !showRuler.value;
toggleTool(showRuler);
},
},
]);
Expand Down
Loading