fixed Dev mode
This commit is contained in:
@@ -16,6 +16,10 @@
|
||||
|
||||
const status = $derived(launcher.status);
|
||||
const checking = $derived(launcher.refreshing || status?.phase === "checking");
|
||||
// The licence, not a setting: an operator's launcher must show no trace of dev mode.
|
||||
const licensed = $derived((status?.dev ?? null) !== null);
|
||||
const devOn = $derived(launcher.devOn);
|
||||
const saving = $derived(launcher.busy === "settings");
|
||||
|
||||
function windowAction(task: () => Promise<void>) {
|
||||
return () => {
|
||||
@@ -80,6 +84,22 @@
|
||||
|
||||
<div class="drag" data-tauri-drag-region></div>
|
||||
|
||||
{#if licensed}
|
||||
<!-- Only on a PC that holds a dev licence. An operator's launcher never draws it, which
|
||||
is the whole point of the licence - so this sits behind `status.dev`, not a setting. -->
|
||||
<button
|
||||
class="icon-btn dev"
|
||||
class:on={devOn}
|
||||
aria-label={devOn ? "Dev mode is on" : "Turn dev mode on"}
|
||||
title={devOn ? "Dev mode is ON - ODIAN runs from your checkout" : "Dev mode"}
|
||||
aria-pressed={devOn}
|
||||
disabled={saving}
|
||||
onclick={() => launcher.setDev({ dev_mode: !devOn })}
|
||||
>
|
||||
<Icon name="code" />
|
||||
</button>
|
||||
{/if}
|
||||
|
||||
<button class="icon-btn market" aria-label="Marketplace" title="Marketplace" aria-haspopup="dialog" onclick={onOpenMarket}>
|
||||
<Icon name="market" />
|
||||
</button>
|
||||
@@ -107,6 +127,18 @@
|
||||
</header>
|
||||
|
||||
<style>
|
||||
/* The dev switch. Off it is one more grey icon button; on it is unmistakably GREEN,
|
||||
because "am I running my own build or the installed one" is the question this whole
|
||||
mode exists to answer, and guessing it wrong wastes an afternoon. */
|
||||
.icon-btn.dev.on {
|
||||
color: #46d17f;
|
||||
border-color: color-mix(in srgb, #46d17f 55%, transparent);
|
||||
background: color-mix(in srgb, #46d17f 16%, transparent);
|
||||
}
|
||||
.icon-btn.dev.on:hover:not(:disabled) {
|
||||
background: color-mix(in srgb, #46d17f 26%, transparent);
|
||||
}
|
||||
|
||||
.titlebar {
|
||||
position: relative;
|
||||
z-index: 20;
|
||||
|
||||
Reference in New Issue
Block a user