Skip to content

Commit 63cce26

Browse files
committed
Tweak the design of the RadioInput widget
1 parent 8a8e496 commit 63cce26

File tree

8 files changed

+55
-49
lines changed

8 files changed

+55
-49
lines changed

frontend/src/components/panels/Spreadsheet.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
width: calc(100% + 2 * 4px);
4343
margin-top: 8px;
4444
45-
span {
45+
.text-label {
4646
white-space: wrap;
4747
}
4848
}

frontend/src/components/views/Graph.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -994,7 +994,7 @@
994994
{/if}
995995
<div class="details">
996996
<!-- TODO: Allow the user to edit the name, just like in the Layers panel -->
997-
<span>{node.displayName}</span>
997+
<TextLabel>{node.displayName}</TextLabel>
998998
</div>
999999
<div class="solo-drag-grip" title="Drag only this layer without pushing others outside the stack"></div>
10001000
<IconButton
@@ -1585,7 +1585,7 @@
15851585
.details {
15861586
margin: 0 8px;
15871587
1588-
span {
1588+
.text-label {
15891589
white-space: nowrap;
15901590
line-height: 48px;
15911591
}

frontend/src/components/widgets/WidgetLayout.svelte

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<script lang="ts">
22
import { isWidgetSpanColumn, isWidgetSpanRow, isWidgetSection, type WidgetLayout, isWidgetTable } from "@graphite/messages";
33
4+
import TextLabel from "@graphite/components/widgets/labels/TextLabel.svelte";
45
import WidgetSection from "@graphite/components/widgets/WidgetSection.svelte";
56
import WidgetSpan from "@graphite/components/widgets/WidgetSpan.svelte";
67
import WidgetTable from "@graphite/components/widgets/WidgetTable.svelte";
@@ -19,7 +20,7 @@
1920
{:else if isWidgetTable(layoutGroup)}
2021
<WidgetTable widgetData={layoutGroup} layoutTarget={layout.layoutTarget} />
2122
{:else}
22-
<span style="color: #d6536e">Error: The widget layout that belongs here has an invalid layout group type</span>
23+
<TextLabel styles={{ color: "#d6536e" }}>Error: The widget layout that belongs here has an invalid layout group type</TextLabel>
2324
{/if}
2425
{/each}
2526

frontend/src/components/widgets/WidgetSection.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@
6565
{#if isWidgetSpanRow(layoutGroup)}
6666
<WidgetSpan widgetData={layoutGroup} {layoutTarget} />
6767
{:else if isWidgetSpanColumn(layoutGroup)}
68-
<span style="color: #d6536e">Error: The WidgetSpan used here should be a row not a column</span>
68+
<TextLabel styles={{ color: "#d6536e" }}>Error: The WidgetSpan used here should be a row not a column</TextLabel>
6969
{:else if isWidgetSection(layoutGroup)}
7070
<svelte:self widgetData={layoutGroup} {layoutTarget} />
7171
{:else}
72-
<span style="color: #d6536e">Error: The widget that belongs here has an invalid layout group type</span>
72+
<TextLabel styles={{ color: "#d6536e" }}>Error: The widget that belongs here has an invalid layout group type</TextLabel>
7373
{/if}
7474
{/each}
7575
</LayoutCol>

frontend/src/components/widgets/inputs/DropdownInput.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
&.disabled {
156156
background: var(--color-2-mildblack);
157157
158-
span {
158+
.text-label {
159159
color: var(--color-8-uppergray);
160160
}
161161

frontend/src/components/widgets/inputs/FontInput.svelte

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@
156156
&.open {
157157
background: var(--color-6-lowergray);
158158
159-
span {
159+
.text-label {
160160
color: var(--color-f-white);
161161
}
162162
}
@@ -168,7 +168,7 @@
168168
&.disabled {
169169
background: var(--color-2-mildblack);
170170
171-
span {
171+
.text-label {
172172
color: var(--color-8-uppergray);
173173
}
174174
}

frontend/src/components/widgets/inputs/RadioInput.svelte

Lines changed: 44 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -24,27 +24,32 @@
2424
}
2525
</script>
2626

27-
<LayoutRow class="radio-input" classes={{ disabled }} styles={{ ...(minWidth > 0 ? { "min-width": `${minWidth}px` } : {}) }}>
27+
<LayoutRow class="radio-input" classes={{ disabled, mixed }} styles={{ ...(minWidth > 0 ? { "min-width": `${minWidth}px` } : {}) }}>
2828
{#each entries as entry, index}
29-
<button class:active={index === selectedIndex} class:mixed class:disabled on:click={() => handleEntryClick(entry)} title={entry.tooltip} tabindex={index === selectedIndex ? -1 : 0} {disabled}>
29+
<button class:active={!mixed ? index === selectedIndex : undefined} on:click={() => handleEntryClick(entry)} title={entry.tooltip} tabindex={index === selectedIndex ? -1 : 0} {disabled}>
3030
{#if entry.icon}
3131
<IconLabel icon={entry.icon} />
3232
{/if}
3333
{#if entry.label}
34-
<TextLabel italic={mixed}>{entry.label}</TextLabel>
34+
<TextLabel>{entry.label}</TextLabel>
3535
{/if}
3636
</button>
3737
{/each}
3838
</LayoutRow>
3939

4040
<style lang="scss" global>
4141
.radio-input {
42+
background: var(--color-5-dullgray);
43+
border-radius: 2px;
44+
height: 24px;
45+
4246
button {
4347
background: var(--color-5-dullgray);
4448
fill: var(--color-e-nearwhite);
45-
height: 24px;
46-
margin: 0;
49+
border-radius: 2px;
50+
height: 20px;
4751
padding: 0;
52+
margin: 2px 1px;
4853
border: none;
4954
display: flex;
5055
align-items: center;
@@ -54,8 +59,12 @@
5459
min-width: fit-content;
5560
flex: 1 1 0;
5661
57-
&.mixed {
58-
background: var(--color-4-dimgray);
62+
&:first-of-type {
63+
margin-left: 2px;
64+
}
65+
66+
&:last-of-type {
67+
margin-right: 2px;
5968
}
6069
6170
&:hover {
@@ -76,7 +85,34 @@
7685
}
7786
}
7887
79-
&.disabled {
88+
.icon-label {
89+
margin: 2px;
90+
91+
+ .text-label {
92+
margin-left: 0;
93+
}
94+
}
95+
96+
.text-label {
97+
margin: 0 8px;
98+
overflow: hidden;
99+
flex: 0 0 auto;
100+
}
101+
}
102+
103+
&.mixed {
104+
background: var(--color-4-dimgray);
105+
106+
button:not(:hover),
107+
&.disabled button:hover {
108+
background: var(--color-5-dullgray);
109+
}
110+
}
111+
112+
&.disabled {
113+
background: var(--color-4-dimgray);
114+
115+
button {
80116
background: var(--color-4-dimgray);
81117
color: var(--color-8-uppergray);
82118
@@ -93,37 +129,6 @@
93129
}
94130
}
95131
}
96-
97-
& + button {
98-
margin-left: 1px;
99-
}
100-
101-
&:first-of-type {
102-
border-radius: 2px 0 0 2px;
103-
}
104-
105-
&:last-of-type {
106-
border-radius: 0 2px 2px 0;
107-
}
108-
109-
.icon-label {
110-
margin: 0 4px;
111-
112-
+ .text-label {
113-
margin-left: 0;
114-
}
115-
}
116-
117-
.text-label {
118-
margin: 0 8px;
119-
overflow: hidden;
120-
flex: 0 0 auto;
121-
}
122-
}
123-
124-
&.combined-before button:first-of-type,
125-
&.combined-after button:last-of-type {
126-
border-radius: 0;
127132
}
128133
}
129134
</style>

frontend/src/components/window/workspace/Panel.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
}
249249
}
250250
251-
span {
251+
.text-label {
252252
flex: 1 1 100%;
253253
overflow-x: hidden;
254254
white-space: nowrap;

0 commit comments

Comments
 (0)