Add a button to refresh the input (#926)
* Add a button to refresh the input * Align left of refresh button Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
af7779769a
commit
dbd6a032f7
|
|
@ -73,7 +73,7 @@ static DOCUMENT_NODE_TYPES: &[DocumentNodeType] = &[
|
||||||
default: NodeInput::Network,
|
default: NodeInput::Network,
|
||||||
}],
|
}],
|
||||||
outputs: &[FrontendGraphDataType::Raster],
|
outputs: &[FrontendGraphDataType::Raster],
|
||||||
properties: |_document_node, _node_id, _context| node_properties::string_properties("The graph's input is the artwork under the frame layer".to_string()),
|
properties: node_properties::input_properties,
|
||||||
},
|
},
|
||||||
DocumentNodeType {
|
DocumentNodeType {
|
||||||
name: "Output",
|
name: "Output",
|
||||||
|
|
|
||||||
|
|
@ -144,6 +144,18 @@ fn number_widget(document_node: &DocumentNode, node_id: NodeId, index: usize, na
|
||||||
widgets
|
widgets
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Properties for the input node, with information describing how frames work and a refresh button
|
||||||
|
pub fn input_properties(_document_node: &DocumentNode, _node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||||
|
let information = WidgetHolder::text_widget("The graph's input is the artwork under the frame layer");
|
||||||
|
let refresh_button = WidgetHolder::new(Widget::TextButton(TextButton {
|
||||||
|
label: "Refresh Input".to_string(),
|
||||||
|
tooltip: "Refresh the artwork under the frame".to_string(),
|
||||||
|
on_update: WidgetCallback::new(|_| DocumentMessage::NodeGraphFrameGenerate.into()),
|
||||||
|
..Default::default()
|
||||||
|
}));
|
||||||
|
vec![LayoutGroup::Row { widgets: vec![information] }, LayoutGroup::Row { widgets: vec![refresh_button] }]
|
||||||
|
}
|
||||||
|
|
||||||
pub fn adjust_hsl_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
pub fn adjust_hsl_properties(document_node: &DocumentNode, node_id: NodeId, _context: &mut NodePropertiesContext) -> Vec<LayoutGroup> {
|
||||||
let hue_shift = number_widget(document_node, node_id, 1, "Hue Shift", NumberInput::new().min(-180.).max(180.).unit("°"), true);
|
let hue_shift = number_widget(document_node, node_id, 1, "Hue Shift", NumberInput::new().min(-180.).max(180.).unit("°"), true);
|
||||||
let saturation_shift = number_widget(document_node, node_id, 2, "Saturation Shift", NumberInput::new().min(-100.).max(100.).unit("%"), true);
|
let saturation_shift = number_widget(document_node, node_id, 2, "Saturation Shift", NumberInput::new().min(-100.).max(100.).unit("%"), true);
|
||||||
|
|
|
||||||
|
|
@ -95,6 +95,10 @@
|
||||||
margin-bottom: calc(4px - 1px);
|
margin-bottom: calc(4px - 1px);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
> .text-button:first-child {
|
||||||
|
margin-left: 16px;
|
||||||
|
}
|
||||||
|
|
||||||
> .text-label:first-of-type {
|
> .text-label:first-of-type {
|
||||||
flex: 0 0 25%;
|
flex: 0 0 25%;
|
||||||
margin-left: 16px;
|
margin-left: 16px;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue