mirror of
https://github.com/TxtDot/vigi.git
synced 2024-11-21 19:16:20 +03:00
fix: draggable block
This commit is contained in:
parent
7545a586b5
commit
42762f591c
4 changed files with 14 additions and 7 deletions
|
@ -46,7 +46,7 @@ body {
|
||||||
}
|
}
|
||||||
|
|
||||||
.block {
|
.block {
|
||||||
@apply p-3 rounded-xl bg-block;
|
@apply p-2 rounded-xl bg-block;
|
||||||
}
|
}
|
||||||
|
|
||||||
.sidebar {
|
.sidebar {
|
||||||
|
|
|
@ -3,6 +3,12 @@
|
||||||
export let draggable = false;
|
export let draggable = false;
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="block{className ? ` ${className}` : ''}">
|
{#if draggable}
|
||||||
|
<div class="block{className ? ` ${className}` : ''}" data-tauri-drag-region>
|
||||||
<slot />
|
<slot />
|
||||||
</div>
|
</div>
|
||||||
|
{:else}
|
||||||
|
<div class="block{className ? ` ${className}` : ''}">
|
||||||
|
<slot />
|
||||||
|
</div>
|
||||||
|
{/if}
|
||||||
|
|
|
@ -4,6 +4,7 @@
|
||||||
import Reload from "$lib/icons/Reload.svelte";
|
import Reload from "$lib/icons/Reload.svelte";
|
||||||
import SidebarLeft from "$lib/icons/SidebarLeft.svelte";
|
import SidebarLeft from "$lib/icons/SidebarLeft.svelte";
|
||||||
import SidebarRight from "$lib/icons/SidebarRight.svelte";
|
import SidebarRight from "$lib/icons/SidebarRight.svelte";
|
||||||
|
import Block from "./Block.svelte";
|
||||||
import Button from "./Button.svelte";
|
import Button from "./Button.svelte";
|
||||||
|
|
||||||
export let onSidebarToggle = () => {};
|
export let onSidebarToggle = () => {};
|
||||||
|
@ -18,7 +19,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="top-bar">
|
<div class="top-bar">
|
||||||
<div class="flex bg-block p-2 rounded-xl">
|
<Block className="flex">
|
||||||
<Button onClick={onSidebarToggle}>
|
<Button onClick={onSidebarToggle}>
|
||||||
{#if sidebarOpen}
|
{#if sidebarOpen}
|
||||||
<SidebarLeft />
|
<SidebarLeft />
|
||||||
|
@ -29,7 +30,7 @@
|
||||||
<Button onClick={onBack}><ArrowLeft /></Button>
|
<Button onClick={onBack}><ArrowLeft /></Button>
|
||||||
<Button onClick={onForward}><ArrowRight /></Button>
|
<Button onClick={onForward}><ArrowRight /></Button>
|
||||||
<Button onClick={onInput}><Reload /></Button>
|
<Button onClick={onInput}><Reload /></Button>
|
||||||
</div>
|
</Block>
|
||||||
|
|
||||||
<input
|
<input
|
||||||
type="text"
|
type="text"
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="common-window" data-tauri-drag-region>
|
<div class="common-window" data-tauri-drag-region>
|
||||||
<Block className={`sidebar${sidebarOpen ? "" : " collapsed"}`}>
|
<Block className={`sidebar${sidebarOpen ? "" : " collapsed"}`} draggable>
|
||||||
{#if sidebarOpen}
|
{#if sidebarOpen}
|
||||||
<div transition:slide={{ axis: "x", duration: 100 }}>
|
<div transition:slide={{ axis: "x", duration: 100 }}>
|
||||||
<WindowControls />
|
<WindowControls />
|
||||||
|
|
Loading…
Add table
Reference in a new issue