Skip to content

Commit ffbbeaa

Browse files
committed
Add fingerprint checkbox
1 parent ed05cb5 commit ffbbeaa

File tree

3 files changed

+28
-11
lines changed

3 files changed

+28
-11
lines changed

src/components/features/bottom/BottomPanel.svelte

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import { Feature, hasFeature } from '../../../lib/FeatureToggles';
2222
2323
const devices = stores.getDevices();
24+
const enableFingerprint = stores.getEnableFingerprint();
2425
2526
let componentWidth: number;
2627
let connectDialogReference: ConnectDialogContainer;
@@ -38,6 +39,11 @@
3839
};
3940
4041
let isLive3DOpen = false;
42+
43+
$: isFingerprintEnabled = $enableFingerprint && hasFeature(Feature.FINGERPRINT);
44+
const toggleEnabled = (event: any) => {
45+
enableFingerprint.set(event.target.checked);
46+
};
4147
</script>
4248

4349
<div
@@ -81,16 +87,27 @@
8187
</div>
8288
</div>
8389

90+
<!-- Right part of live-graph -->
8491
<div
85-
class="absolute right-0 cursor-pointer w-45 hover:bg-secondary hover:bg-opacity-10 transition"
92+
class="absolute right-0 bottom-0 cursor-pointer h-full w-45 flex flex-col justify-between hover:bg-secondary hover:bg-opacity-10 transition"
8693
on:click={() => (isLive3DOpen = true)}>
87-
<div class="flex flex-row">
88-
{#if hasFeature(Feature.FINGERPRINT)}
89-
<div class="absolute h-full">
90-
<LiveDataFingerprint gestureName="Live" />
91-
</div>
92-
{/if}
93-
<View3DLive width={160} height={160} freeze={isLive3DOpen} />
94+
<div class="pt-2 pr-2 justify-end flex flex-row gap-2">
95+
<p>Fingerprint:</p>
96+
<input
97+
type="checkbox"
98+
checked={$enableFingerprint}
99+
on:change={e => toggleEnabled(e)}
100+
on:click|stopPropagation />
101+
</div>
102+
103+
{#if isFingerprintEnabled}
104+
<div class="absolute h-full">
105+
<LiveDataFingerprint gestureName="Live" />
106+
</div>
107+
{/if}
108+
109+
<div class="flex flex-row pl-4 justify-center">
110+
<View3DLive width={140} height={140} freeze={isLive3DOpen} />
94111
</div>
95112
</div>
96113

src/components/ui/recording/Recording.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
URL.revokeObjectURL(url);
6060
}
6161
62-
const shouldDisplayFingerprint = enableFingerprint && hasFeature(Feature.FINGERPRINT);
62+
$: shouldDisplayFingerprint = enableFingerprint && hasFeature(Feature.FINGERPRINT);
6363
</script>
6464

6565
<div

src/pages/validation/ValidationGestureRecordingsCard.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
const gestureValidationSet = stores.getValidationSets().getForGesture(gesture.getId());
1919
// Results are grouped by gestures then recordings [i][j](Gestures -> Recording)
2020
const results = stores.getValidationResults();
21-
const gestures = stores.getGestures();
21+
const enableFingerprint = stores.getEnableFingerprint();
2222
2323
$: recordings = $gestureValidationSet.recordings;
2424
@@ -47,7 +47,7 @@
4747
{#each recordings as recording}
4848
{#key recording.ID}
4949
<Recording
50-
enableFingerprint={true}
50+
enableFingerprint={$enableFingerprint}
5151
dot={$dotGetter(recording.ID)}
5252
gestureId={$gesture.ID}
5353
{recording}

0 commit comments

Comments
 (0)