connection color in tabs panel

This commit is contained in:
Jan Prochazka
2021-12-04 09:23:37 +01:00
parent 86195b56ed
commit c39f11e2da
3 changed files with 46 additions and 15 deletions

View File

@@ -142,6 +142,7 @@
import getElectron from '../utility/getElectron';
import { getConnectionInfo, useConnectionList } from '../utility/metadataLoaders';
import { duplicateTab } from '../utility/openNewTab';
import { useConnectionColorFactory } from '../utility/useConnectionColor';
$: connectionList = useConnectionList();
@@ -165,6 +166,8 @@
$: scrollInViewTab($activeTabId);
const connectionColorFactory = useConnectionColorFactory(3, null, true);
const handleTabClick = (e, tabid) => {
if (e.target.closest('.tabCloseButton')) {
return;
@@ -259,6 +262,7 @@
class:selected={tabsByDb[dbKey][0].tabDbKey == currentDbKey}
on:click={() => handleSetDb(tabsByDb[dbKey][0].props)}
use:contextMenu={getDatabaseContextMenu(tabsByDb[dbKey])}
style={$connectionColorFactory(tabsByDb[dbKey][0].props, tabsByDb[dbKey][0].tabDbKey == currentDbKey ? 2 : 3)}
>
<FontIcon icon={getDbIcon(dbKey)} />
{tabsByDb[dbKey][0].tabDbName}