Skip to content

Commit

Permalink
Use has_* pattern for node style as well
Browse files Browse the repository at this point in the history
Done to be consistent with the existing has_body and has_footer, and to remove the exposure of ui in the style method, while still keeping unnecessary allocations away.
  • Loading branch information
juh9870 committed Jan 14, 2025
1 parent 13035d3 commit da2c390
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions src/ui/viewer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,23 @@ pub trait SnarlViewer<T> {
let _ = (node, inputs, outputs, snarl);
default
}
/// Checks if node has a custom egui style.
#[inline]
fn has_node_style(&mut self, node: &T) -> bool {
let _ = node;
false
}

/// Modifies the node's egui style
fn node_style(
fn apply_node_style(
&mut self,
ui: &mut Ui,
style: &mut Style,
node: NodeId,
inputs: &[InPin],
outputs: &[OutPin],
snarl: &Snarl<T>,
) {
let _ = (ui, node, inputs, outputs, snarl);
let _ = (style, node, inputs, outputs, snarl);
}

/// Returns layout override for the node.
Expand Down

0 comments on commit da2c390

Please sign in to comment.