prevent a lag when opening a dropdown list
@@ -603,11 +603,11 @@ impl MaterialEditor {
if let Some(material) = self.material.clone() {
if let UiMessageData::DropdownList(msg) = message.data() {
- match msg {
- DropdownListMessage::SelectionChanged(Some(value)) => {
if message.destination() == self.available_shaders
&& message.direction() == MessageDirection::FromWidget
{
+ match msg {
+ DropdownListMessage::SelectionChanged(Some(value)) => {
sender
.send(Message::DoSceneCommand(SceneCommand::SetMaterialShader(
SetMaterialShaderCommand::new(
@@ -617,7 +617,6 @@ impl MaterialEditor {
)))
.unwrap();
}
- }
DropdownListMessage::Open => {
self.sync_available_shaders_list(engine.resource_manager.clone());
self.create_shaders_items(
@@ -628,6 +627,7 @@ impl MaterialEditor {
_ => (),
}
}
+ }
if let Some(property_name) = self.properties.key_of(&message.destination()) {
let property_value = match message.data() {
