expand icon simplified

This commit is contained in:
Jan Prochazka
2021-03-01 18:26:01 +01:00
parent 565a60e638
commit a4387155e7
7 changed files with 44 additions and 39 deletions

View File

@@ -1,6 +1,9 @@
<script lang="ts">
import FontIcon from '../icons/FontIcon.svelte';
import contextMenu from '../utility/contextMenu';
import { createEventDispatcher } from 'svelte';
const dispatch = createEventDispatcher();
export let icon;
export let title;
@@ -11,10 +14,19 @@
export let statusTitle = undefined;
export let extInfo = undefined;
export let menu = undefined;
export let expandIcon = undefined;
function handleExpand() {
dispatch('expand');
}
</script>
<div class="main" class:isBold draggable on:click use:contextMenu={menu}>
<slot name="prefix" />
{#if expandIcon}
<span class="expand-icon" on:click={handleExpand}>
<FontIcon icon={expandIcon} />
</span>
{/if}
{#if isBusy}
<FontIcon icon="icon loading" />
{:else}
@@ -55,4 +67,7 @@
margin-left: 5px;
color: var(--theme-font-3);
}
.expand-icon {
margin-right: 3px;
}
</style>