mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 22:28:10 +08:00
Make selected Text category nodes show a multi-line text area instead of one-line text field (#2816)
* Make String Value node input a TextArea Signed-off-by: ezbaze <68749104+Ezbaze@users.noreply.github.com> * Replace link to Tauri Signed-off-by: ezbaze <68749104+Ezbaze@users.noreply.github.com> * Make String Concatenate node & Replace String node inputs into a TextArea Signed-off-by: ezbaze <68749104+Ezbaze@users.noreply.github.com> --------- Signed-off-by: ezbaze <68749104+Ezbaze@users.noreply.github.com>
This commit is contained in:
@@ -3,6 +3,7 @@ use crate::Color;
|
||||
use crate::GraphicElement;
|
||||
use crate::GraphicGroupTable;
|
||||
use crate::gradient::GradientStops;
|
||||
use crate::graphene_core::registry::types::TextArea;
|
||||
use crate::raster_types::{CPU, GPU, RasterDataTable};
|
||||
use crate::vector::VectorDataTable;
|
||||
use crate::{Context, Ctx};
|
||||
@@ -14,12 +15,12 @@ fn to_string<T: std::fmt::Debug>(_: impl Ctx, #[implementations(String, bool, f6
|
||||
}
|
||||
|
||||
#[node_macro::node(category("Text"))]
|
||||
fn string_concatenate(_: impl Ctx, #[implementations(String)] first: String, #[implementations(String)] second: String) -> String {
|
||||
fn string_concatenate(_: impl Ctx, #[implementations(String)] first: String, second: TextArea) -> String {
|
||||
first.clone() + &second
|
||||
}
|
||||
|
||||
#[node_macro::node(category("Text"))]
|
||||
fn string_replace(_: impl Ctx, #[implementations(String)] string: String, from: String, to: String) -> String {
|
||||
fn string_replace(_: impl Ctx, #[implementations(String)] string: String, from: TextArea, to: TextArea) -> String {
|
||||
string.replace(&from, &to)
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,8 @@ pub mod types {
|
||||
pub type Resolution = glam::UVec2;
|
||||
/// DVec2 with px unit
|
||||
pub type PixelSize = glam::DVec2;
|
||||
/// String with one or more than one line
|
||||
pub type TextArea = String;
|
||||
}
|
||||
|
||||
// Translation struct between macro and definition
|
||||
|
||||
Reference in New Issue
Block a user