mirror of
https://github.com/eliasstepanik/egui_node_graph.git
synced 2026-01-11 05:48:27 +00:00
commit
0594981326
@ -610,7 +610,12 @@ where
|
|||||||
let outputs = self.graph[self.node_id].outputs.clone();
|
let outputs = self.graph[self.node_id].outputs.clone();
|
||||||
for (param_name, _param) in outputs {
|
for (param_name, _param) in outputs {
|
||||||
let height_before = ui.min_rect().bottom();
|
let height_before = ui.min_rect().bottom();
|
||||||
ui.label(¶m_name);
|
responses.extend(
|
||||||
|
self.graph[self.node_id]
|
||||||
|
.user_data
|
||||||
|
.output_ui(ui, self.node_id, self.graph, user_state, ¶m_name)
|
||||||
|
.into_iter(),
|
||||||
|
);
|
||||||
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);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,6 +127,25 @@ where
|
|||||||
Default::default()
|
Default::default()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// UI to draw for each output
|
||||||
|
///
|
||||||
|
/// Defaults to showing param_name as a simple label.
|
||||||
|
fn output_ui(
|
||||||
|
&self,
|
||||||
|
ui: &mut egui::Ui,
|
||||||
|
_node_id: NodeId,
|
||||||
|
_graph: &Graph<Self, Self::DataType, Self::ValueType>,
|
||||||
|
_user_state: &mut Self::UserState,
|
||||||
|
param_name: &str,
|
||||||
|
) -> Vec<NodeResponse<Self::Response, Self>>
|
||||||
|
where
|
||||||
|
Self::Response: UserResponseTrait,
|
||||||
|
{
|
||||||
|
ui.label(param_name);
|
||||||
|
|
||||||
|
Default::default()
|
||||||
|
}
|
||||||
|
|
||||||
/// Set background color on titlebar
|
/// Set background color on titlebar
|
||||||
/// If the return value is None, the default color is set.
|
/// If the return value is None, the default color is set.
|
||||||
fn titlebar_color(
|
fn titlebar_color(
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user