mirror of
https://github.com/eliasstepanik/egui_node_graph.git
synced 2026-01-11 05:48:27 +00:00
Add NodeDataTrait::separator
This commit is contained in:
parent
fad164b88c
commit
2976153046
@ -600,6 +600,13 @@ where
|
|||||||
responses.extend(node_responses.into_iter().map(NodeResponse::User));
|
responses.extend(node_responses.into_iter().map(NodeResponse::User));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.graph[self.node_id].user_data.separator(
|
||||||
|
ui,
|
||||||
|
self.node_id,
|
||||||
|
self.graph,
|
||||||
|
user_state,
|
||||||
|
);
|
||||||
|
|
||||||
self.graph[param_id].value = value;
|
self.graph[param_id].value = value;
|
||||||
|
|
||||||
let height_after = ui.min_rect().bottom();
|
let height_after = ui.min_rect().bottom();
|
||||||
@ -616,6 +623,14 @@ where
|
|||||||
.output_ui(ui, self.node_id, self.graph, user_state, ¶m_name)
|
.output_ui(ui, self.node_id, self.graph, user_state, ¶m_name)
|
||||||
.into_iter(),
|
.into_iter(),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
self.graph[self.node_id].user_data.separator(
|
||||||
|
ui,
|
||||||
|
self.node_id,
|
||||||
|
self.graph,
|
||||||
|
user_state,
|
||||||
|
);
|
||||||
|
|
||||||
let height_after = ui.min_rect().bottom();
|
let height_after = ui.min_rect().bottom();
|
||||||
output_port_heights.push((height_before + height_after) / 2.0);
|
output_port_heights.push((height_before + height_after) / 2.0);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -158,6 +158,22 @@ where
|
|||||||
None
|
None
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Separator to put between elements in the node.
|
||||||
|
///
|
||||||
|
/// Invoked between inputs, outputs and bottom UI. Useful for
|
||||||
|
/// complicated UIs that start to lose structure without explicit
|
||||||
|
/// separators.
|
||||||
|
///
|
||||||
|
/// Default implementation does nothing.
|
||||||
|
fn separator(
|
||||||
|
&self,
|
||||||
|
_ui: &mut egui::Ui,
|
||||||
|
_node_id: NodeId,
|
||||||
|
_graph: &Graph<Self, Self::DataType, Self::ValueType>,
|
||||||
|
_user_state: &mut Self::UserState,
|
||||||
|
) {
|
||||||
|
}
|
||||||
|
|
||||||
fn can_delete(
|
fn can_delete(
|
||||||
&self,
|
&self,
|
||||||
_node_id: NodeId,
|
_node_id: NodeId,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user