Skip to content

Commit 2376e76

Browse files
committed
Remove FontInput.svelte
1 parent 57055e3 commit 2376e76

File tree

8 files changed

+1
-322
lines changed

8 files changed

+1
-322
lines changed

editor/src/messages/layout/layout_message_handler.rs

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -264,44 +264,6 @@ impl LayoutMessageHandler {
264264

265265
responses.add(callback_message);
266266
}
267-
Widget::FontInput(font_input) => {
268-
let callback_message = match action {
269-
WidgetValueAction::Commit => (font_input.on_commit.callback)(&()),
270-
WidgetValueAction::Update => {
271-
let Some(update_value) = value.as_object() else {
272-
error!("FontInput update was not of type: object");
273-
return;
274-
};
275-
let Some(font_family_value) = update_value.get("fontFamily") else {
276-
error!("FontInput update does not have a fontFamily");
277-
return;
278-
};
279-
let Some(font_style_value) = update_value.get("fontStyle") else {
280-
error!("FontInput update does not have a fontStyle");
281-
return;
282-
};
283-
284-
let Some(font_family) = font_family_value.as_str() else {
285-
error!("FontInput update fontFamily was not of type: string");
286-
return;
287-
};
288-
let Some(font_style) = font_style_value.as_str() else {
289-
error!("FontInput update fontStyle was not of type: string");
290-
return;
291-
};
292-
293-
font_input.font_family = font_family.into();
294-
font_input.font_style = font_style.into();
295-
296-
responses.add(PortfolioMessage::LoadFont {
297-
font: Font::new(font_family.into(), font_style.into()),
298-
});
299-
(font_input.on_update.callback)(font_input)
300-
}
301-
};
302-
303-
responses.add(callback_message);
304-
}
305267
Widget::IconButton(icon_button) => {
306268
let callback_message = match action {
307269
WidgetValueAction::Commit => (icon_button.on_commit.callback)(&()),

editor/src/messages/layout/utility_types/layout_widget.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,6 @@ impl LayoutGroup {
367367
Widget::ColorInput(x) => &mut x.tooltip_label,
368368
Widget::CurveInput(x) => &mut x.tooltip_label,
369369
Widget::DropdownInput(x) => &mut x.tooltip_label,
370-
Widget::FontInput(x) => &mut x.tooltip_label,
371370
Widget::IconButton(x) => &mut x.tooltip_label,
372371
Widget::IconLabel(x) => &mut x.tooltip_label,
373372
Widget::ImageButton(x) => &mut x.tooltip_label,
@@ -403,7 +402,6 @@ impl LayoutGroup {
403402
Widget::ColorInput(x) => &mut x.tooltip_description,
404403
Widget::CurveInput(x) => &mut x.tooltip_description,
405404
Widget::DropdownInput(x) => &mut x.tooltip_description,
406-
Widget::FontInput(x) => &mut x.tooltip_description,
407405
Widget::IconButton(x) => &mut x.tooltip_description,
408406
Widget::IconLabel(x) => &mut x.tooltip_description,
409407
Widget::ImageButton(x) => &mut x.tooltip_description,
@@ -727,7 +725,6 @@ pub enum Widget {
727725
ColorInput(ColorInput),
728726
CurveInput(CurveInput),
729727
DropdownInput(DropdownInput),
730-
FontInput(FontInput),
731728
IconButton(IconButton),
732729
IconLabel(IconLabel),
733730
ImageButton(ImageButton),
@@ -782,7 +779,6 @@ impl DiffUpdate {
782779
Widget::CheckboxInput(widget) => widget.tooltip_shortcut.as_mut(),
783780
Widget::ColorInput(widget) => widget.tooltip_shortcut.as_mut(),
784781
Widget::DropdownInput(widget) => widget.tooltip_shortcut.as_mut(),
785-
Widget::FontInput(widget) => widget.tooltip_shortcut.as_mut(),
786782
Widget::IconButton(widget) => widget.tooltip_shortcut.as_mut(),
787783
Widget::NumberInput(widget) => widget.tooltip_shortcut.as_mut(),
788784
Widget::ParameterExposeButton(widget) => widget.tooltip_shortcut.as_mut(),

editor/src/messages/layout/utility_types/widgets/input_widgets.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -152,41 +152,6 @@ pub struct MenuListEntry {
152152
pub on_commit: WidgetCallback<()>,
153153
}
154154

155-
#[derive(Clone, serde::Serialize, serde::Deserialize, Derivative, WidgetBuilder, specta::Type)]
156-
#[derivative(Debug, PartialEq, Default)]
157-
pub struct FontInput {
158-
#[serde(rename = "fontFamily")]
159-
#[widget_builder(constructor)]
160-
pub font_family: String,
161-
162-
#[serde(rename = "fontStyle")]
163-
#[widget_builder(constructor)]
164-
pub font_style: String,
165-
166-
#[serde(rename = "isStyle")]
167-
pub is_style_picker: bool,
168-
169-
pub disabled: bool,
170-
171-
#[serde(rename = "tooltipLabel")]
172-
pub tooltip_label: String,
173-
174-
#[serde(rename = "tooltipDescription")]
175-
pub tooltip_description: String,
176-
177-
#[serde(rename = "tooltipShortcut")]
178-
pub tooltip_shortcut: Option<ActionShortcut>,
179-
180-
// Callbacks
181-
#[serde(skip)]
182-
#[derivative(Debug = "ignore", PartialEq = "ignore")]
183-
pub on_update: WidgetCallback<FontInput>,
184-
185-
#[serde(skip)]
186-
#[derivative(Debug = "ignore", PartialEq = "ignore")]
187-
pub on_commit: WidgetCallback<()>,
188-
}
189-
190155
#[derive(Clone, serde::Serialize, serde::Deserialize, Derivative, WidgetBuilder, specta::Type)]
191156
#[derivative(Debug, PartialEq, Default)]
192157
pub struct NumberInput {

editor/src/messages/portfolio/document/document_message_handler.rs

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2186,39 +2186,6 @@ impl DocumentMessageHandler {
21862186
}
21872187

21882188
pub fn update_document_widgets(&self, responses: &mut VecDeque<Message>, animation_is_playing: bool, time: Duration) {
2189-
// // Document mode (dropdown menu at the left of the bar above the viewport, before the tool options)
2190-
// let layout = Layout(vec![LayoutGroup::Row {
2191-
// widgets: vec![
2192-
// DropdownInput::new(
2193-
// vec![vec![
2194-
// MenuListEntry::new(format!("{:?}", DocumentMode::DesignMode))
2195-
// .label(DocumentMode::DesignMode.to_string())
2196-
// .icon(DocumentMode::DesignMode.icon_name()),
2197-
// // TODO: See issue #330
2198-
// MenuListEntry::new(format!("{:?}", DocumentMode::SelectMode))
2199-
// .label(DocumentMode::SelectMode.to_string())
2200-
// .icon(DocumentMode::SelectMode.icon_name())
2201-
// .on_commit(|_| todo!()),
2202-
// // TODO: See issue #331
2203-
// MenuListEntry::new(format!("{:?}", DocumentMode::GuideMode))
2204-
// .label(DocumentMode::GuideMode.to_string())
2205-
// .icon(DocumentMode::GuideMode.icon_name())
2206-
// .on_commit(|_| todo!()),
2207-
// ]])
2208-
// .selected_index(Some(self.document_mode as u32))
2209-
// .draw_icon(true)
2210-
// .interactive(false)
2211-
// .widget_instance(),
2212-
// Separator::new(SeparatorType::Section).widget_instance(),
2213-
// ],
2214-
// }]);
2215-
// responses.add(LayoutMessage::SendLayout {
2216-
// layout,
2217-
// layout_target: LayoutTarget::DocumentMode,
2218-
// });
2219-
2220-
// Document bar (right portion of the bar above the viewport)
2221-
22222189
let mut snapping_state = self.snapping_state.clone();
22232190
let mut snapping_state2 = self.snapping_state.clone();
22242191

frontend/src/components/panels/Layers.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@
627627
data-tooltip-description={(listing.entry.expanded
628628
? "Hide the layers nested within. (To affect all open descendants, perform the shortcut shown.)"
629629
: "Show the layers nested within. (To affect all closed descendants, perform the shortcut shown.)") +
630-
(listing.entry.ancestorOfSelected && !listing.entry.expanded ? "\n\nNote: a selected layer is currently contained within.\n" : "")}
630+
(listing.entry.ancestorOfSelected && !listing.entry.expanded ? "\n\nA selected layer is currently contained within.\n" : "")}
631631
data-tooltip-shortcut={altClickShortcut?.shortcut ? JSON.stringify(altClickShortcut.shortcut) : undefined}
632632
on:click={(e) => handleExpandArrowClickWithModifiers(e, listing.entry.id)}
633633
tabindex="0"

frontend/src/components/widgets/WidgetSpan.svelte

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import ColorInput from "@graphite/components/widgets/inputs/ColorInput.svelte";
1818
import CurveInput from "@graphite/components/widgets/inputs/CurveInput.svelte";
1919
import DropdownInput from "@graphite/components/widgets/inputs/DropdownInput.svelte";
20-
import FontInput from "@graphite/components/widgets/inputs/FontInput.svelte";
2120
import NumberInput from "@graphite/components/widgets/inputs/NumberInput.svelte";
2221
import RadioInput from "@graphite/components/widgets/inputs/RadioInput.svelte";
2322
import ReferencePointInput from "@graphite/components/widgets/inputs/ReferencePointInput.svelte";
@@ -111,10 +110,6 @@
111110
on:selectedIndex={({ detail }) => widgetValueCommitAndUpdate(index, detail)}
112111
/>
113112
{/if}
114-
{@const fontInput = narrowWidgetProps(component.props, "FontInput")}
115-
{#if fontInput}
116-
<FontInput {...exclude(fontInput)} on:changeFont={({ detail }) => widgetValueCommitAndUpdate(index, detail)} />
117-
{/if}
118113
{@const parameterExposeButton = narrowWidgetProps(component.props, "ParameterExposeButton")}
119114
{#if parameterExposeButton}
120115
<ParameterExposeButton {...exclude(parameterExposeButton)} action={() => widgetValueCommitAndUpdate(index, undefined)} />

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

Lines changed: 0 additions & 186 deletions
This file was deleted.

0 commit comments

Comments
 (0)