Implement the Properties panel with a transform section for layers (#527)

* initial layout system with tool options

* cargo fmt

* cargo fmt again

* document bar defined on the backend

* cargo fmt

* removed RC<RefCell>

* cargo fmt

* - fix increment behavior
- removed hashmap from layout message handler
- removed no op message from layoutMessage

* cargo fmt

* only send documentBar when zoom or rotation is updated

* ctrl-0 changes zoom properly

* unfinished layer hook in

* fix layerData name

* layer panel options bar

* basic x/y movment

* working transform section

* changed messages from tuples to structs

* hook up text input

* - fixed number input to be more clear
- fixed actions for properties message handler

* Add styling

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
mfish33
2022-02-12 08:22:57 -08:00
committed by Keavon Chambers
co-authored by Keavon Chambers
parent 45d41b1bd7
commit 5a3500d256
19 changed files with 659 additions and 45 deletions
@@ -23,6 +23,14 @@ impl LayoutMessageHandler {
layout_target,
layout: widget_layout.layout.clone(),
},
LayoutTarget::PropertiesOptionsPanel => FrontendMessage::UpdatePropertyPanelOptionsLayout {
layout_target,
layout: widget_layout.layout.clone(),
},
LayoutTarget::PropertiesSectionsPanel => FrontendMessage::UpdatePropertyPanelSectionsLayout {
layout_target,
layout: widget_layout.layout.clone(),
},
LayoutTarget::LayoutTargetLength => panic!("`LayoutTargetLength` is not a valid Layout Target and is used for array indexing"),
};
responses.push_back(message.into());
@@ -63,6 +71,7 @@ impl MessageHandler<LayoutMessage, ()> for LayoutMessageHandler {
let callback_message = (icon_button.on_update.callback)(icon_button);
responses.push_back(callback_message);
}
Widget::IconLabel(_) => {}
Widget::PopoverButton(_) => {}
Widget::OptionalInput(optional_input) => {
let update_value = value.as_bool().expect("OptionalInput update was not of type: bool");
@@ -76,6 +85,13 @@ impl MessageHandler<LayoutMessage, ()> for LayoutMessageHandler {
let callback_message = (radio_input.entries[update_value as usize].on_update.callback)(&());
responses.push_back(callback_message);
}
Widget::TextInput(text_input) => {
let update_value = value.as_str().expect("OptionalInput update was not of type: string");
text_input.value = update_value.into();
let callback_message = (text_input.on_update.callback)(text_input);
responses.push_back(callback_message);
}
Widget::TextLabel(_) => {}
};
self.send_layout(layout_target, responses);
}