mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-09-16 23:08:05 +08:00
Add properties panel entries for artboards (#572)
* Artboards can have properties * fix crash when renaming artboards * moved target document to utility types * moved import and added test for file version information * fixed missing import * fix error from merging * - typed properties message handler data - removed name from WidgetRow * clippy warnings * artboards have seperate properties section * - color input can be forced to have selection - crop tool shows on switch - select tool shows on switch * variable renamed * change to use PropType<boolean> instead of PropType<Boolean> * Add an artboard icon * Add the "Delete Artboard" hint * fix unselect glitch * even better * Remove the Transform properties group Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
use super::clipboards::Clipboard;
|
||||
use super::layer_panel::{layer_panel_entry, LayerDataTypeDiscriminant, LayerMetadata, LayerPanelEntry, RawBuffer};
|
||||
use super::properties_panel_message_handler::PropertiesPanelMessageHandlerData;
|
||||
use super::utility_types::TargetDocument;
|
||||
use super::utility_types::{AlignAggregate, AlignAxis, DocumentSave, FlipAxis};
|
||||
use super::{vectorize_layer_metadata, PropertiesPanelMessageHandler};
|
||||
use super::{ArtboardMessageHandler, MovementMessageHandler, OverlaysMessageHandler, TransformLayerMessageHandler};
|
||||
@@ -503,7 +505,6 @@ impl DocumentMessageHandler {
|
||||
impl PropertyHolder for DocumentMessageHandler {
|
||||
fn properties(&self) -> WidgetLayout {
|
||||
WidgetLayout::new(vec![LayoutRow::Row {
|
||||
name: "".into(),
|
||||
widgets: vec![
|
||||
WidgetHolder::new(Widget::OptionalInput(OptionalInput {
|
||||
checked: self.snapping_enabled,
|
||||
@@ -704,7 +705,14 @@ impl MessageHandler<DocumentMessage, &InputPreprocessorMessageHandler> for Docum
|
||||
}
|
||||
#[remain::unsorted]
|
||||
PropertiesPanel(message) => {
|
||||
self.properties_panel_message_handler.process_action(message, &self.graphene_document, responses);
|
||||
self.properties_panel_message_handler.process_action(
|
||||
message,
|
||||
PropertiesPanelMessageHandlerData {
|
||||
artwork_document: &self.graphene_document,
|
||||
artboard_document: &self.artboard_message_handler.artboards_graphene_document,
|
||||
},
|
||||
responses,
|
||||
);
|
||||
}
|
||||
|
||||
// Messages
|
||||
@@ -721,7 +729,13 @@ impl MessageHandler<DocumentMessage, &InputPreprocessorMessageHandler> for Docum
|
||||
if selected_paths.is_empty() {
|
||||
responses.push_back(PropertiesPanelMessage::ClearSelection.into())
|
||||
} else {
|
||||
responses.push_back(PropertiesPanelMessage::SetActiveLayers { paths: selected_paths }.into())
|
||||
responses.push_back(
|
||||
PropertiesPanelMessage::SetActiveLayers {
|
||||
paths: selected_paths,
|
||||
document: TargetDocument::Artwork,
|
||||
}
|
||||
.into(),
|
||||
)
|
||||
}
|
||||
|
||||
// TODO: Correctly update layer panel in clear_selection instead of here
|
||||
|
||||
Reference in New Issue
Block a user