mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2025-07-07 15:55:00 +00:00
Improve node creation menu and categorization (#2719)
* Change node categories Signed-off-by: ezbaze <rybitwamateusz3@gmail.com> * Restore Ezbaze's other work that was lost in the rebase --------- Signed-off-by: ezbaze <rybitwamateusz3@gmail.com> Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
parent
59bb3194ca
commit
2ec0ff38f3
5 changed files with 11 additions and 10 deletions
|
@ -1211,16 +1211,16 @@ pub(crate) fn grid_properties(node_id: NodeId, context: &mut NodePropertiesConte
|
|||
}
|
||||
}
|
||||
|
||||
let rows = number_widget(
|
||||
ParameterWidgetsInfo::from_index(document_node, node_id, RowsInput::INDEX, true, context),
|
||||
NumberInput::default().min(1.),
|
||||
);
|
||||
let columns = number_widget(
|
||||
ParameterWidgetsInfo::from_index(document_node, node_id, ColumnsInput::INDEX, true, context),
|
||||
NumberInput::default().min(1.),
|
||||
);
|
||||
let rows = number_widget(
|
||||
ParameterWidgetsInfo::from_index(document_node, node_id, RowsInput::INDEX, true, context),
|
||||
NumberInput::default().min(1.),
|
||||
);
|
||||
|
||||
widgets.extend([LayoutGroup::Row { widgets: rows }, LayoutGroup::Row { widgets: columns }]);
|
||||
widgets.extend([LayoutGroup::Row { widgets: columns }, LayoutGroup::Row { widgets: rows }]);
|
||||
|
||||
widgets
|
||||
}
|
||||
|
|
|
@ -164,6 +164,7 @@
|
|||
.text-label {
|
||||
padding-left: 16px;
|
||||
position: relative;
|
||||
pointer-events: none;
|
||||
|
||||
&::before {
|
||||
content: "";
|
||||
|
|
|
@ -37,7 +37,7 @@ fn string_length(_: impl Ctx, #[implementations(String)] string: String) -> usiz
|
|||
string.len()
|
||||
}
|
||||
|
||||
#[node_macro::node(category("Text"))]
|
||||
#[node_macro::node(category("Math: Logic"))]
|
||||
async fn switch<T, C: Send + 'n + Clone>(
|
||||
#[implementations(Context)] ctx: C,
|
||||
condition: bool,
|
||||
|
|
|
@ -158,8 +158,8 @@ fn grid<T: GridSpacing>(
|
|||
#[implementations(f64, DVec2)]
|
||||
spacing: T,
|
||||
#[default(30., 30.)] angles: DVec2,
|
||||
#[default(10)] rows: u32,
|
||||
#[default(10)] columns: u32,
|
||||
#[default(10)] rows: u32,
|
||||
) -> VectorDataTable {
|
||||
let (x_spacing, y_spacing) = spacing.as_dvec2().into();
|
||||
let (angle_a, angle_b) = angles.into();
|
||||
|
|
|
@ -210,7 +210,7 @@ where
|
|||
vector_data
|
||||
}
|
||||
|
||||
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
|
||||
#[node_macro::node(category("Instancing"), path(graphene_core::vector))]
|
||||
async fn repeat<I: 'n + Send + Clone>(
|
||||
_: impl Ctx,
|
||||
// TODO: Implement other GraphicElementRendered types.
|
||||
|
@ -249,7 +249,7 @@ where
|
|||
result_table
|
||||
}
|
||||
|
||||
#[node_macro::node(category("Vector"), path(graphene_core::vector))]
|
||||
#[node_macro::node(category("Instancing"), path(graphene_core::vector))]
|
||||
async fn circular_repeat<I: 'n + Send + Clone>(
|
||||
_: impl Ctx,
|
||||
// TODO: Implement other GraphicElementRendered types.
|
||||
|
@ -284,7 +284,7 @@ where
|
|||
result_table
|
||||
}
|
||||
|
||||
#[node_macro::node(name("Copy to Points"), category("Vector"), path(graphene_core::vector))]
|
||||
#[node_macro::node(name("Copy to Points"), category("Instancing"), path(graphene_core::vector))]
|
||||
async fn copy_to_points<I: 'n + Send + Clone>(
|
||||
_: impl Ctx,
|
||||
points: VectorDataTable,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue