#810 hide non active tool strip containers

This commit is contained in:
Jan Prochazka
2024-07-30 09:36:57 +02:00
parent 74b0216714
commit fad8e91c7e
2 changed files with 24 additions and 4 deletions

View File

@@ -1,9 +1,12 @@
import { getContext } from 'svelte';
import { get_current_component, onMount, setContext } from 'svelte/internal';
import invalidateCommands from '../commands/invalidateCommands';
import { writable } from 'svelte/store';
const lastActiveDictionary = {};
export const isComponentActiveStore = writable((key: string, component) => false as boolean);
function isParent(parent, child) {
while (child && child.activator) {
if (parent == child) return true;
@@ -54,7 +57,7 @@ export default function createActivator(
}
// console.log('toDelete', toDelete);
for (const del of toDelete) {
delete lastActiveDictionary[del];
}
@@ -63,6 +66,10 @@ export default function createActivator(
parentActivatorInstance.activator.activate();
}
// console.log('Active components', lastActiveDictionary);
isComponentActiveStore.set((key, component) => {
return lastActiveDictionary[key] == component;
});
};
const getTabVisible = () => tabVisibleValue;