diff --git a/fyrox-ui/src/inspector/editors/hashmap/dialog.rs b/fyrox-ui/src/inspector/editors/hashmap/dialog.rs index a236e3d92..080a6d1ec 100644 --- a/fyrox-ui/src/inspector/editors/hashmap/dialog.rs +++ b/fyrox-ui/src/inspector/editors/hashmap/dialog.rs @@ -18,7 +18,6 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE // SOFTWARE. -use crate::message::MessageData; use crate::{ button::{Button, ButtonBuilder, ButtonMessage}, control_trait_proxy_impls, @@ -31,11 +30,11 @@ use crate::{ }, InspectorEnvironmentContainer, PropertyAction, }, - message::UiMessage, + message::{MessageData, UiMessage}, stack_panel::StackPanelBuilder, widget::{Widget, WidgetBuilder}, window::{Window, WindowBuilder, WindowMessage}, - BuildContext, Control, Orientation, Thickness, UiNode, UserInterface, + BuildContext, Control, HorizontalAlignment, Orientation, Thickness, UiNode, UserInterface, }; use fxhash::FxHashSet; use std::{ @@ -205,17 +204,30 @@ impl SelectHashMapKeyDialogWindowBuilder { }) .unwrap_or_default(); - let ok = ButtonBuilder::new(WidgetBuilder::new().with_margin(Thickness::uniform(1.0))) - .with_text("OK") - .build(ctx); - let cancel = ButtonBuilder::new(WidgetBuilder::new().with_margin(Thickness::uniform(1.0))) - .with_text("Cancel") - .build(ctx); + let ok = ButtonBuilder::new( + WidgetBuilder::new() + .with_height(24.0) + .with_width(60.0) + .with_margin(Thickness::uniform(1.0)), + ) + .with_text("OK") + .build(ctx); + let cancel = ButtonBuilder::new( + WidgetBuilder::new() + .with_height(24.0) + .with_width(60.0) + .with_margin(Thickness::uniform(1.0)), + ) + .with_text("Cancel") + .build(ctx); + let buttons = StackPanelBuilder::new( WidgetBuilder::new() + .with_margin(Thickness::uniform(1.0)) .on_row(1) .with_child(ok) - .with_child(cancel), + .with_child(cancel) + .with_horizontal_alignment(HorizontalAlignment::Right), ) .with_orientation(Orientation::Horizontal) .build(ctx); diff --git a/fyrox-ui/src/inspector/editors/hashmap/editor.rs b/fyrox-ui/src/inspector/editors/hashmap/editor.rs index 4b4865fe4..f5c10ce2b 100644 --- a/fyrox-ui/src/inspector/editors/hashmap/editor.rs +++ b/fyrox-ui/src/inspector/editors/hashmap/editor.rs @@ -166,10 +166,10 @@ where if let Some(ButtonMessage::Click) = message.data_from(self.add) { self.dialog = SelectHashMapKeyDialogWindowBuilder::new( - WindowBuilder::new(WidgetBuilder::new()) + WindowBuilder::new(WidgetBuilder::new().with_width(250.0).with_height(80.0)) .with_remove_on_close(true) .open(false) - .with_title(WindowTitle::text("Select Key Value")), + .with_title(WindowTitle::text("Enter New Key Value")), self.property_editors.clone(), K::default(), )