mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-26 20:16:00 +00:00
add connection style
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
export let icon;
|
export let icon;
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
|
export let fillHorizontal = false;
|
||||||
|
|
||||||
const dispatch = createEventDispatcher();
|
const dispatch = createEventDispatcher();
|
||||||
|
|
||||||
@@ -12,7 +13,7 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<div class="button" on:click={handleClick} class:disabled>
|
<div class="button" on:click={handleClick} class:disabled class:fillHorizontal>
|
||||||
<div class="icon">
|
<div class="icon">
|
||||||
<FontIcon {icon} />
|
<FontIcon {icon} />
|
||||||
</div>
|
</div>
|
||||||
@@ -31,6 +32,11 @@
|
|||||||
background-color: var(--theme-bg-1);
|
background-color: var(--theme-bg-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.button.fillHorizontal {
|
||||||
|
width: auto;
|
||||||
|
margin: 0px 10px;
|
||||||
|
}
|
||||||
|
|
||||||
.button:not(.disabled):hover {
|
.button:not(.disabled):hover {
|
||||||
background-color: var(--theme-bg-2);
|
background-color: var(--theme-bg-2);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
export let label;
|
export let label;
|
||||||
export let icon;
|
export let icon;
|
||||||
export let component = ToolStripButton;
|
export let component = ToolStripButton;
|
||||||
|
export let disabled = false;
|
||||||
|
|
||||||
function handleClick(e) {
|
function handleClick(e) {
|
||||||
const rect = e.detail.target.getBoundingClientRect();
|
const rect = e.detail.target.getBoundingClientRect();
|
||||||
@@ -18,6 +19,6 @@
|
|||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<ToolStripSplitButton {title} {icon} on:splitclick={handleClick} on:click>
|
<ToolStripSplitButton {title} {icon} {disabled} on:splitclick={handleClick} on:click>
|
||||||
<slot />
|
<slot />
|
||||||
</ToolStripSplitButton>
|
</ToolStripSplitButton>
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
import FontIcon from '../icons/FontIcon.svelte';
|
import FontIcon from '../icons/FontIcon.svelte';
|
||||||
import CloseSearchButton from '../buttons/CloseSearchButton.svelte';
|
import CloseSearchButton from '../buttons/CloseSearchButton.svelte';
|
||||||
import { apiCall } from '../utility/api';
|
import { apiCall } from '../utility/api';
|
||||||
|
import LargeButton from '../buttons/LargeButton.svelte';
|
||||||
|
|
||||||
const connections = useConnectionList();
|
const connections = useConnectionList();
|
||||||
const serverStatus = useServerStatus();
|
const serverStatus = useServerStatus();
|
||||||
@@ -59,8 +60,11 @@
|
|||||||
passProps={{ connectionColorFactory: $connectionColorFactory, showPinnedInsteadOfUnpin: true }}
|
passProps={{ connectionColorFactory: $connectionColorFactory, showPinnedInsteadOfUnpin: true }}
|
||||||
/>
|
/>
|
||||||
{#if $connections && $connections.length == 0 && $commandsCustomized['new.connection']?.enabled}
|
{#if $connections && $connections.length == 0 && $commandsCustomized['new.connection']?.enabled}
|
||||||
<ToolbarButton icon="icon new-connection" on:click={() => runCommand('new.connection')}>
|
<LargeButton icon="icon new-connection" on:click={() => runCommand('new.connection')} fillHorizontal
|
||||||
|
>Add new connection</LargeButton
|
||||||
|
>
|
||||||
|
<!-- <ToolbarButton icon="icon new-connection" on:click={() => runCommand('new.connection')}>
|
||||||
Add new connection
|
Add new connection
|
||||||
</ToolbarButton>
|
</ToolbarButton> -->
|
||||||
{/if}
|
{/if}
|
||||||
</WidgetsInnerContainer>
|
</WidgetsInnerContainer>
|
||||||
|
|||||||
Reference in New Issue
Block a user