Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions editor/src/messages/input_mapper/default_mapping.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ pub fn default_mapping() -> Mapping {
refresh_keys=[Control],
action_dispatch=NavigationMessage::PointerMove { snap_angle: Control, wait_for_snap_angle_release: true, snap_zoom: Control, zoom_from_viewport: None },
),
entry!(KeyDown(Lmb); action_dispatch=NavigationMessage::TransformFromMenuEnd { commit_key: Key::Lmb }),
entry!(KeyDown(Mmb); action_dispatch=NavigationMessage::TransformFromMenuEnd { commit_key: Key::Mmb }),
entry!(KeyDown(Rmb); action_dispatch=NavigationMessage::TransformFromMenuEnd { commit_key: Key::Rmb }),
entry!(KeyDown(Lmb); action_dispatch=NavigationMessage::TransformFromMenuEnd { commit_key: Key::Lmb }),
entry!(KeyDown(Mmb); action_dispatch=NavigationMessage::TransformFromMenuEnd { commit_key: Key::Mmb }),
entry!(KeyDown(Rmb); action_dispatch=NavigationMessage::TransformFromMenuEnd { commit_key: Key::Rmb }),
// NORMAL PRIORITY:
//
// NodeGraphMessage
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ pub struct NumberInput {

// Number presentation
#[serde(rename = "displayDecimalPlaces")]
#[derivative(Default(value = "3"))]
#[derivative(Default(value = "2"))]
pub display_decimal_places: u32,

pub unit: String,
Expand Down
1 change: 1 addition & 0 deletions frontend/src/components/floating-menus/ColorPicker.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -379,6 +379,7 @@
rangeMax={100}
unit="%"
mode="Range"
displayDecimalPlaces={1}
tooltip={`Scale from transparent (0%) to opaque (100%) for the color's alpha channel`}
/>
<LayoutRow class="leftover-space" />
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/widgets/WidgetSpan.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@
{/if}
{@const curvesInput = narrowWidgetProps(component.props, "CurveInput")}
{#if curvesInput}
<CurveInput {...exclude(curvesInput)} on:value={({ detail }) => debouncer((value) => updateLayout(index, value), { debounceTime: 120 }).updateValue(detail)} />
<CurveInput {...exclude(curvesInput)} on:value={({ detail }) => debouncer((value) => updateLayout(index, value), { debounceTime: 120 }).debounceUpdateValue(detail)} />
{/if}
{@const dropdownInput = narrowWidgetProps(component.props, "DropdownInput")}
{#if dropdownInput}
Expand Down Expand Up @@ -127,7 +127,7 @@
{#if numberInput}
<NumberInput
{...exclude(numberInput)}
on:value={({ detail }) => debouncer((value) => updateLayout(index, value)).updateValue(detail)}
on:value={({ detail }) => debouncer((value) => updateLayout(index, value)).debounceUpdateValue(detail)}
incrementCallbackIncrease={() => updateLayout(index, "Increment")}
incrementCallbackDecrease={() => updateLayout(index, "Decrement")}
sharpRightCorners={nextIsSuffix}
Expand Down
19 changes: 12 additions & 7 deletions frontend/src/components/widgets/inputs/FieldInput.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@

import LayoutRow from "@graphite/components/layout/LayoutRow.svelte";

// emits: ["update:value", "textFocused", "textChanged", "cancelTextChange"],
// emits: ["update:value", "textFocused", "textChanged", "textChangeCanceled"],
const dispatch = createEventDispatcher<{
value: string;
textFocused: undefined;
textChanged: undefined;
cancelTextChange: undefined;
textChangeCanceled: undefined;
}>();

let className = "";
Expand All @@ -27,6 +27,7 @@
export let tooltip: string | undefined = undefined;
export let sharpRightCorners = false;
export let placeholder: string | undefined = undefined;
export let hideContextMenu = false;

let inputOrTextarea: HTMLInputElement | HTMLTextAreaElement | undefined;
let id = `${Math.random()}`.substring(2);
Expand Down Expand Up @@ -78,13 +79,15 @@
{spellcheck}
{disabled}
{placeholder}
bind:value={inputValue}
bind:this={inputOrTextarea}
bind:value={inputValue}
on:focus={() => dispatch("textFocused")}
on:blur={() => dispatch("textChanged")}
on:change={() => dispatch("textChanged")}
on:keydown={(e) => e.key === "Enter" && dispatch("textChanged")}
on:keydown={(e) => e.key === "Escape" && dispatch("cancelTextChange")}
on:keydown={(e) => e.key === "Escape" && dispatch("textChangeCanceled")}
on:pointerdown
on:contextmenu={(e) => hideContextMenu && e.preventDefault()}
data-input-element
/>
{:else}
Expand All @@ -95,17 +98,19 @@
data-scrollable-y
{spellcheck}
{disabled}
bind:value={inputValue}
bind:this={inputOrTextarea}
bind:value={inputValue}
on:focus={() => dispatch("textFocused")}
on:blur={() => dispatch("textChanged")}
on:change={() => dispatch("textChanged")}
on:keydown={(e) => (macKeyboardLayout ? e.metaKey : e.ctrlKey) && e.key === "Enter" && dispatch("textChanged")}
on:keydown={(e) => e.key === "Escape" && dispatch("cancelTextChange")}
on:keydown={(e) => e.key === "Escape" && dispatch("textChangeCanceled")}
on:pointerdown
on:contextmenu={(e) => hideContextMenu && e.preventDefault()}
/>
{/if}
{#if label}
<label for={`field-input-${id}`}>{label}</label>
<label for={`field-input-${id}`} on:pointerdown>{label}</label>
{/if}
<slot />
</LayoutRow>
Expand Down
Loading