Skip to content

Commit

Permalink
configuration -> definition
Browse files Browse the repository at this point in the history
  • Loading branch information
Frizi committed Apr 21, 2023
1 parent 6f31125 commit 1846acf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions app/gui/src/controller/graph/widget/metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ fn to_metadata(resp: response::WidgetDefinition) -> widget::Metadata {
widget::Metadata { display: resp.display, config: to_config(resp.inner), has_port: true }
}

fn to_config(inner: response::WidgetKindConfiguration) -> widget::Config {
fn to_config(inner: response::WidgetKindDefinition) -> widget::Config {
match inner {
response::WidgetKindConfiguration::SingleChoice { label, values } =>
response::WidgetKindDefinition::SingleChoice { label, values } =>
widget::single_choice::Config {
label: label.map(Into::into),
entries: Rc::new(to_entries(&values)),
}
.into(),
response::WidgetKindConfiguration::ListEditor { item_editor, item_default } =>
response::WidgetKindDefinition::ListEditor { item_editor, item_default } =>
widget::list_editor::Config {
item_editor: Some(Rc::new(to_metadata(*item_editor))),
item_default: item_default.into(),
Expand Down
8 changes: 4 additions & 4 deletions app/gui/src/controller/graph/widget/response.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ pub(super) struct WidgetDefinition<'a> {
#[serde(default)]
pub display: widget::Display,
#[serde(borrow, flatten)]
pub inner: WidgetKindConfiguration<'a>,
pub inner: WidgetKindDefinition<'a>,
}

/// Part of [`WidgetConfiguration`] that is dependant on widget kind.
/// Part of [`WidgetDefinition`] that is dependant on widget kind.
#[derive(Debug, serde::Deserialize)]
#[serde(tag = "constructor")]
pub(super) enum WidgetKindConfiguration<'a> {
pub(super) enum WidgetKindDefinition<'a> {
/// A single value widget (dropdown).
#[serde(rename = "Single_Choice")]
SingleChoice {
Expand Down Expand Up @@ -103,7 +103,7 @@ pub(super) enum WidgetKindConfiguration<'a> {
#[serde(rename = "Text_Input")]
TextInput,

/// Describes a folder chooser.
/// A folder chooser.
#[serde(rename = "Folder_Browse")]
FolderBrowse,

Expand Down

0 comments on commit 1846acf

Please sign in to comment.