Skip to content

Commit 838c927

Browse files
committed
Add focused prop to TextButton
Replaced emphasized with focused in NodeCatalog
1 parent 39bbf67 commit 838c927

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

frontend/src/components/floating-menus/NodeCatalog.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@
125125
return;
126126
}
127127
128-
setTimeout(() => document.querySelector(".node-catalog button.emphasized")?.scrollIntoView({ block: "nearest" }), 0);
128+
setTimeout(() => document.querySelector(".node-catalog button.focused")?.scrollIntoView({ block: "nearest" }), 0);
129129
}
130130
131131
onMount(() => {
@@ -147,7 +147,7 @@
147147
{disabled}
148148
label={nodeType.name}
149149
tooltip={$nodeGraph.nodeDescriptions.get(nodeType.name)}
150-
emphasized={nodeType == flatNodeList[focusedNodeIndex]}
150+
focused={nodeType == flatNodeList[focusedNodeIndex]}
151151
action={() => dispatch("selectNodeType", nodeType.name)}
152152
/>
153153
{/each}

frontend/src/components/widgets/buttons/TextButton.svelte

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
export let icon: IconName | undefined = undefined;
1616
export let hoverIcon: IconName | undefined = undefined;
1717
export let emphasized = false;
18+
export let focused = false;
1819
export let flush = false;
1920
export let minWidth = 0;
2021
export let disabled = false;
@@ -54,6 +55,7 @@
5455
class:open={self?.open}
5556
class:hover-icon={hoverIcon && !disabled}
5657
class:emphasized
58+
class:focused
5759
class:disabled
5860
class:narrow
5961
class:flush
@@ -118,7 +120,8 @@
118120
}
119121
120122
&:hover,
121-
&.open {
123+
&.open,
124+
&.focused {
122125
--button-background-color: var(--color-6-lowergray);
123126
--button-text-color: var(--color-f-white);
124127
}
@@ -143,7 +146,8 @@
143146
--button-text-color: var(--color-2-mildblack);
144147
145148
&:hover,
146-
&.open {
149+
&.open,
150+
&.focused {
147151
--button-background-color: var(--color-f-white);
148152
}
149153
@@ -157,7 +161,8 @@
157161
--button-text-color: var(--color-e-nearwhite);
158162
159163
&:hover,
160-
&.open {
164+
&.open,
165+
&.focused {
161166
--button-background-color: var(--color-5-dullgray);
162167
}
163168
}

0 commit comments

Comments
 (0)