Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ message PBUiInput {
optional common.Font font = 11; // default=0
optional int32 font_size = 12; // default=10
optional string value = 13;
optional bool multi_line = 14; // default=false; when true, the input accepts newlines and behaves as a textarea
}
2 changes: 2 additions & 0 deletions crates/scene_runner/src/update_world/scene_ui/ui_input.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ pub fn set_ui_input(
components::common::Font::FMonospace => FontName::Mono,
};
let font_size = input.0.font_size.unwrap_or(10).max(1) as f32;
let multiline = input.0.multi_line.unwrap_or(false);

let ui_entity = link.ui_entity;
let root = scene_ent.root;
Expand Down Expand Up @@ -118,6 +119,7 @@ pub fn set_ui_input(
enabled: !input.0.disabled,
content: input.0.value.clone().unwrap_or_default(),
accept_line: true,
multiline: if multiline { 2 } else { 1 },
text_style: Some((
TextFont {
font: user_font(font_name, ui_core::WeightName::Regular),
Expand Down
Loading