diff --git a/Cargo.toml b/Cargo.toml index 5ced7c8f8..8ebca382d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -94,7 +94,6 @@ objc2-foundation = { version = "0.2", features = ["NSArray", "NSURL", "NSString" iced_core = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" } iced_widget = { git = "https://github.com/iced-rs/iced.git", rev = "23604ff22ab0aad9e00b9327cb7b8546ed84db39" } - [target.'cfg(not(target_arch = "wasm32"))'.dependencies] getrandom = "0.3" ocs_plugin_api = { path = "crates/ocs_plugin_api", features = ["host"] } diff --git a/src/entities/attribute.rs b/src/entities/attribute.rs index aa382cc08..43d87f683 100644 --- a/src/entities/attribute.rs +++ b/src/entities/attribute.rs @@ -713,7 +713,7 @@ impl PropertyEditable for AttributeDefinition { return; } match field { - "att_tag" => self.tag = value.trim().to_string(), + "att_tag" => self.tag = value.trim().to_uppercase(), "att_prompt" if !self.flags.constant => self.prompt = value.to_string(), "att_default" => { self.default_value = value.to_string(); diff --git a/src/ui/window/attdef_dialog.rs b/src/ui/window/attdef_dialog.rs index c74c81f08..df548fcf8 100644 --- a/src/ui/window/attdef_dialog.rs +++ b/src/ui/window/attdef_dialog.rs @@ -116,8 +116,12 @@ fn input<'a>(value: &str, enabled: bool, on: fn(String) -> AttdefDialogMsg) -> E } /// The small button beside a field that takes the value from the drawing. -fn pick<'a>(glyph: &'static str, tip: String, message: Option) -> Element<'a, Message> { - let b = button(text(glyph).size(13).align_x(iced::Center).width(Fill)) +fn pick<'a>( + face: Element<'a, Message>, + tip: String, + message: Option, +) -> Element<'a, Message> { + let b = button(container(face).center_x(Fill)) .style(button_style(false)) .padding([4, 0]) .width(Length::Fixed(28.0)); @@ -146,7 +150,7 @@ fn error_band<'a>(error: &Option) -> Option> { crate::ui::icons::semantic(ICON_WARN, 14.0), text(error).size(11), Space::new().width(Fill), - button(text("×").size(12)) + button(crate::ui::icons::themed(crate::ui::icons::CLOSE, 10.0)) .on_press(msg(AttdefDialogMsg::DismissError)) .style(button_style(false)) .padding([1, 6]), @@ -165,6 +169,11 @@ fn error_band<'a>(error: &Option) -> Option> { ) } +/// The face of the buttons that take a value from the drawing. +fn screen_pick<'a>() -> Element<'a, Message> { + crate::ui::icons::themed(crate::ui::icons::SNAP, 14.0) +} + static ICON_WARN: &[u8] = include_bytes!("../../../assets/icons/ui/warning_triangle.svg"); fn footer<'a>(action: std::borrow::Cow<'static, str>, ok: AttdefDialogMsg) -> Element<'a, Message> { @@ -234,13 +243,13 @@ pub fn view<'a>(state: &'a AttdefDialogState, sizing: crate::ui::modal::ModalSiz let mut value = row![input(&state.default, true, AttdefDialogMsg::Default)].spacing(6); if multiline { value = value.push(pick( - "…", + text("...").size(13).into(), t!("Multiline editor").into_owned(), Some(AttdefDialogMsg::EditValue), )); } // No field picker in this application yet. - value.push(pick("ƒ", t!("Insert field").into_owned(), None)) + value.push(pick(text("fx").size(12).into(), t!("Insert field").into_owned(), None)) } .spacing(6) .into(), @@ -293,7 +302,7 @@ pub fn view<'a>(state: &'a AttdefDialogState, sizing: crate::ui::modal::ModalSiz t!("Text height").into_owned(), row![ input(&state.height, size_on, AttdefDialogMsg::Height), - pick("⌖", t!("Specify on-screen").into_owned(), size_on.then_some(AttdefDialogMsg::PickHeight)), + pick(screen_pick(), t!("Specify on-screen").into_owned(), size_on.then_some(AttdefDialogMsg::PickHeight)), ] .spacing(6) .into(), @@ -303,7 +312,7 @@ pub fn view<'a>(state: &'a AttdefDialogState, sizing: crate::ui::modal::ModalSiz t!("Rotation").into_owned(), row![ input(&state.rotation, rot_on, AttdefDialogMsg::Rotation), - pick("⌖", t!("Specify on-screen").into_owned(), rot_on.then_some(AttdefDialogMsg::PickRotation)), + pick(screen_pick(), t!("Specify on-screen").into_owned(), rot_on.then_some(AttdefDialogMsg::PickRotation)), ] .spacing(6) .into(), @@ -314,7 +323,7 @@ pub fn view<'a>(state: &'a AttdefDialogState, sizing: crate::ui::modal::ModalSiz row![ input(&state.width, text_on && multiline, AttdefDialogMsg::Width), pick( - "⌖", + screen_pick(), t!("Specify on-screen").into_owned(), (text_on && multiline).then_some(AttdefDialogMsg::PickWidth) ), @@ -372,7 +381,7 @@ pub fn view_edit<'a>(state: &'a AttdefEditState, sizing: crate::ui::modal::Modal true, AttdefDialogMsg::EditDefault ), - pick("ƒ", t!("Insert field").into_owned(), None), + pick(text("fx").size(12).into(), t!("Insert field").into_owned(), None), ] .spacing(6) .align_y(iced::Center),