mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-15 14:18:04 +08:00
* New overlay system that reimplements how overlays are drawn * Fix overlay message declaration * Fix small mistake * WIP (broken) changes to plumb the overlay document * Fix confusion over messaging system architecture * Removed log * Overlay system working * (broken) WIP overlay association * Finish the overlay system (except test failure) * Change back IDs in test * Fixed test, but stilled fails due to revealed real problem with layer reordering selection * Disable broken test that has a bug in issue #444 Co-authored-by: Dennis <dennis@kobert.dev> Co-authored-by: otdavies <oliver@psyfer.io>
42 lines
1.6 KiB
Rust
42 lines
1.6 KiB
Rust
use crate::document::layer_panel::{LayerPanelEntry, RawBuffer};
|
|
use crate::message_prelude::*;
|
|
use crate::misc::HintData;
|
|
use crate::tool::tool_options::ToolOptions;
|
|
use crate::Color;
|
|
use serde::{Deserialize, Serialize};
|
|
|
|
#[derive(PartialEq, Clone, Deserialize, Serialize, Debug)]
|
|
pub struct FrontendDocumentDetails {
|
|
pub is_saved: bool,
|
|
pub name: String,
|
|
pub id: u64,
|
|
}
|
|
|
|
#[impl_message(Message, Frontend)]
|
|
#[derive(PartialEq, Clone, Deserialize, Serialize, Debug)]
|
|
pub enum FrontendMessage {
|
|
DisplayFolderTreeStructure { data_buffer: RawBuffer },
|
|
SetActiveTool { tool_name: String, tool_options: Option<ToolOptions> },
|
|
SetActiveDocument { document_id: u64 },
|
|
UpdateOpenDocumentsList { open_documents: Vec<FrontendDocumentDetails> },
|
|
UpdateInputHints { hint_data: HintData },
|
|
DisplayError { title: String, description: String },
|
|
DisplayPanic { panic_info: String, title: String, description: String },
|
|
DisplayConfirmationToCloseDocument { document_id: u64 },
|
|
DisplayConfirmationToCloseAllDocuments,
|
|
DisplayAboutGraphiteDialog,
|
|
UpdateLayer { data: LayerPanelEntry },
|
|
UpdateArtwork { svg: String },
|
|
UpdateOverlays { svg: String },
|
|
UpdateScrollbars { position: (f64, f64), size: (f64, f64), multiplier: (f64, f64) },
|
|
UpdateRulers { origin: (f64, f64), spacing: f64, interval: f64 },
|
|
ExportDocument { document: String, name: String },
|
|
SaveDocument { document: String, name: String },
|
|
AutoSaveDocument { document: String, details: FrontendDocumentDetails },
|
|
RemoveAutoSaveDocument { document_id: u64 },
|
|
OpenDocumentBrowse,
|
|
UpdateWorkingColors { primary: Color, secondary: Color },
|
|
SetCanvasZoom { new_zoom: f64 },
|
|
SetCanvasRotation { new_radians: f64 },
|
|
}
|