mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-24 00:08:12 +08:00
Add a dropdown for resource selection and adopt it in the 'Image' node (#4543)
* Add a dropdown for resource selection and adopt it in the Image node * Route every image upload through a new ResourceUpload handler with desktop support and migrate wired 'Image' node inputs * Show each resource's user count in the resource picker dropdown * Send a picked resource file to the document that requested it, list every non-font resource in the picker, and link sibling message docs
This commit is contained in:
@@ -2,6 +2,7 @@ use crate::application::Editor;
|
||||
use crate::messages::input_mapper::utility_types::keyboard::ModifierKeys;
|
||||
use crate::messages::input_mapper::utility_types::pointer::{EditorPointerState, MouseKeys, ViewportPosition};
|
||||
use crate::messages::portfolio::document::node_graph::document_node_definitions::DefinitionIdentifier;
|
||||
use crate::messages::portfolio::resource_upload::utility_types::UploadTarget;
|
||||
use crate::messages::prelude::*;
|
||||
use crate::messages::tool::tool_messages::tool_prelude::Key;
|
||||
use crate::messages::tool::utility_types::ToolType;
|
||||
@@ -242,11 +243,10 @@ impl EditorTestUtils {
|
||||
}
|
||||
|
||||
pub async fn create_raster_image(&mut self, image: graphene_std::raster::Image<Color>, mouse: Option<(f64, f64)>) {
|
||||
self.handle_message(PortfolioMessage::InsertImage {
|
||||
self.handle_message(ResourceUploadMessage::Upload {
|
||||
name: None,
|
||||
image,
|
||||
mouse,
|
||||
parent_and_insert_index: None,
|
||||
data: image.to_png().into(),
|
||||
target: UploadTarget::Layer { mouse, parent_and_insert_index: None },
|
||||
})
|
||||
.await;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user