mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-30 10:58:12 +08:00
Integrate document-format storage into the editor (#4265)
* Integrate document-format storage into the editor * Address review feedback: drop redundant clones and dedupe metadata traversal * Extract DocumentHistory and move storage-metadata tests to their own file * Extract storage diffing/IO, gate validation and .gdd save behind preferences, restructure tests * Address PR review: save-format/path consistency, autosave persistence, and view-settings/diff fixes * Skip storage remount on .gdd open and split value/timestamp drift in attribute diff * Rename storage tests module and surface .gdd open failures with per-resource diff detail * Add debug-menu toggle to hide the storage preferences section * Hopefully fix async tests * Shorten comments * Fix tests * Review * Review * Review * Block on future mesages in tests * Review * Shorten comments --------- Co-authored-by: Timon <me@timon.zip>
This commit is contained in:
@@ -36,6 +36,13 @@ pub enum PreferencesMessage {
|
||||
DisableUIAcceleration {
|
||||
disable_ui_acceleration: bool,
|
||||
},
|
||||
ValidateStorageRoundTrip {
|
||||
enabled: bool,
|
||||
},
|
||||
SaveAsGdd {
|
||||
enabled: bool,
|
||||
},
|
||||
ToggleShowStoragePreferences,
|
||||
#[cfg(target_os = "macos")]
|
||||
VSync {
|
||||
vsync: bool,
|
||||
|
||||
@@ -23,6 +23,9 @@ pub struct PreferencesMessageHandler {
|
||||
pub ui_scale: f64,
|
||||
pub max_render_region_size: u32,
|
||||
pub disable_ui_acceleration: bool,
|
||||
pub validate_storage_round_trip: bool,
|
||||
pub save_as_gdd: bool,
|
||||
pub show_storage_preferences: bool,
|
||||
#[cfg(target_os = "macos")]
|
||||
pub vsync: bool,
|
||||
}
|
||||
@@ -66,6 +69,9 @@ impl Default for PreferencesMessageHandler {
|
||||
ui_scale: UI_SCALE_DEFAULT,
|
||||
max_render_region_size: EditorPreferences::default().max_render_region_size,
|
||||
disable_ui_acceleration: cfg!(target_os = "linux"), // TODO: Set this back to false once we have ui acceleration working more reliably on linux
|
||||
validate_storage_round_trip: false,
|
||||
save_as_gdd: false,
|
||||
show_storage_preferences: false,
|
||||
#[cfg(target_os = "macos")]
|
||||
vsync: false,
|
||||
}
|
||||
@@ -132,6 +138,16 @@ impl MessageHandler<PreferencesMessage, PreferencesMessageContext<'_>> for Prefe
|
||||
PreferencesMessage::DisableUIAcceleration { disable_ui_acceleration } => {
|
||||
self.disable_ui_acceleration = disable_ui_acceleration;
|
||||
}
|
||||
PreferencesMessage::ValidateStorageRoundTrip { enabled } => {
|
||||
self.validate_storage_round_trip = enabled;
|
||||
}
|
||||
PreferencesMessage::SaveAsGdd { enabled } => {
|
||||
self.save_as_gdd = enabled;
|
||||
}
|
||||
PreferencesMessage::ToggleShowStoragePreferences => {
|
||||
self.show_storage_preferences = !self.show_storage_preferences;
|
||||
responses.add(MenuBarMessage::SendLayout);
|
||||
}
|
||||
#[cfg(target_os = "macos")]
|
||||
PreferencesMessage::VSync { vsync } => {
|
||||
self.vsync = vsync;
|
||||
|
||||
Reference in New Issue
Block a user