Rename "options/top bar" terminology to "control bar" and update comments

This commit is contained in:
Keavon Chambers
2025-01-07 17:33:45 -08:00
parent 1c880daea2
commit 9eb544df74
21 changed files with 83 additions and 92 deletions
+1 -1
View File
@@ -77,7 +77,7 @@ impl Dispatcher {
pub fn handle_message<T: Into<Message>>(&mut self, message: T, process_after_all_current: bool) {
let message = message.into();
// Add all aditional messages to the buffer if it exists (except from the end buffer message)
// Add all additional messages to the buffer if it exists (except from the end buffer message)
if !matches!(message, Message::EndBuffer(_)) {
if let Some(buffered_queue) = &mut self.buffered_queue {
Self::schedule_execution(buffered_queue, true, [message]);
@@ -110,7 +110,7 @@ pub enum FrontendMessage {
#[serde(rename = "copyText")]
copy_text: String,
},
// TODO: Eventually remove this (probably starting late 2024)
// TODO: Eventually remove this document upgrade code
TriggerUpgradeDocumentToVectorManipulationFormat {
#[serde(rename = "documentId")]
document_id: DocumentId,
@@ -234,7 +234,7 @@ pub enum FrontendMessage {
#[serde(rename = "hintData")]
hint_data: HintData,
},
UpdateLayersPanelOptionsLayout {
UpdateLayersPanelControlBarLayout {
#[serde(rename = "layoutTarget")]
layout_target: LayoutTarget,
diff: Vec<WidgetDiff>,
@@ -251,7 +251,7 @@ pub enum FrontendMessage {
nodes: Vec<FrontendNode>,
wires: Vec<FrontendNodeWire>,
},
UpdateNodeGraphBarLayout {
UpdateNodeGraphControlBarLayout {
#[serde(rename = "layoutTarget")]
layout_target: LayoutTarget,
diff: Vec<WidgetDiff>,
@@ -401,9 +401,9 @@ impl LayoutMessageHandler {
LayoutTarget::DialogColumn2 => FrontendMessage::UpdateDialogColumn2 { layout_target, diff },
LayoutTarget::DocumentBar => FrontendMessage::UpdateDocumentBarLayout { layout_target, diff },
LayoutTarget::DocumentMode => FrontendMessage::UpdateDocumentModeLayout { layout_target, diff },
LayoutTarget::LayersPanelOptions => FrontendMessage::UpdateLayersPanelOptionsLayout { layout_target, diff },
LayoutTarget::LayersPanelControlBar => FrontendMessage::UpdateLayersPanelControlBarLayout { layout_target, diff },
LayoutTarget::MenuBar => unreachable!("Menu bar is not diffed"),
LayoutTarget::NodeGraphBar => FrontendMessage::UpdateNodeGraphBarLayout { layout_target, diff },
LayoutTarget::NodeGraphControlBar => FrontendMessage::UpdateNodeGraphControlBarLayout { layout_target, diff },
LayoutTarget::PropertiesSections => FrontendMessage::UpdatePropertyPanelSectionsLayout { layout_target, diff },
LayoutTarget::ToolOptions => FrontendMessage::UpdateToolOptionsLayout { layout_target, diff },
LayoutTarget::ToolShelf => FrontendMessage::UpdateToolShelfLayout { layout_target, diff },
@@ -33,11 +33,11 @@ pub enum LayoutTarget {
/// Contains the dropdown for design / select / guide mode found on the top left of the canvas.
DocumentMode,
/// Options for opacity seen at the top of the Layers panel.
LayersPanelOptions,
LayersPanelControlBar,
/// The dropdown menu at the very top of the application: File, Edit, etc.
MenuBar,
/// Bar at the top of the node graph containing the location and the "Preview" and "Hide" buttons.
NodeGraphBar,
NodeGraphControlBar,
/// The body of the Properties panel containing many collapsable sections.
PropertiesSections,
/// The bar directly above the canvas, left-aligned and to the right of the document mode dropdown.
@@ -275,10 +275,10 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
let data_buffer: RawBuffer = Self::default().serialize_root();
responses.add(FrontendMessage::UpdateDocumentLayerStructure { data_buffer });
// Clear the options bar
// Clear the control bar
responses.add(LayoutMessage::SendLayout {
layout: Layout::WidgetLayout(Default::default()),
layout_target: LayoutTarget::LayersPanelOptions,
layout_target: LayoutTarget::LayersPanelControlBar,
});
}
DocumentMessage::InsertBooleanOperation { operation } => {
@@ -350,7 +350,7 @@ impl MessageHandler<DocumentMessage, DocumentMessageData<'_>> for DocumentMessag
DocumentMessage::DocumentHistoryBackward => self.undo_with_history(ipp, responses),
DocumentMessage::DocumentHistoryForward => self.redo_with_history(ipp, responses),
DocumentMessage::DocumentStructureChanged => {
self.update_layers_panel_options_bar_widgets(responses);
self.update_layers_panel_control_bar_widgets(responses);
self.network_interface.load_structure();
let data_buffer: RawBuffer = self.serialize_root();
@@ -1901,7 +1901,7 @@ impl DocumentMessageHandler {
});
}
pub fn update_layers_panel_options_bar_widgets(&self, responses: &mut VecDeque<Message>) {
pub fn update_layers_panel_control_bar_widgets(&self, responses: &mut VecDeque<Message>) {
// Get an iterator over the selected layers (excluding artboards which don't have an opacity or blend mode).
let selected_nodes = self.network_interface.selected_nodes(&[]).unwrap();
let selected_layers_except_artboards = selected_nodes.selected_layers_except_artboards(&self.network_interface);
@@ -1969,7 +1969,7 @@ impl DocumentMessageHandler {
.selected_layers(self.metadata())
.all(|layer| self.network_interface.is_locked(&layer.to_node(), &[]));
let layers_panel_options_bar = WidgetLayout::new(vec![LayoutGroup::Row {
let layers_panel_control_bar = WidgetLayout::new(vec![LayoutGroup::Row {
widgets: vec![
DropdownInput::new(blend_mode_menu_entries)
.selected_index(blend_mode.and_then(|blend_mode| blend_mode.index_in_list_svg_subset()).map(|index| index as u32))
@@ -2037,8 +2037,8 @@ impl DocumentMessageHandler {
}]);
responses.add(LayoutMessage::SendLayout {
layout: Layout::WidgetLayout(layers_panel_options_bar),
layout_target: LayoutTarget::LayersPanelOptions,
layout: Layout::WidgetLayout(layers_panel_control_bar),
layout_target: LayoutTarget::LayersPanelControlBar,
});
}
@@ -2295,7 +2295,7 @@ impl Iterator for ClickXRayIter<'_> {
}
}
// TODO: Eventually remove this (probably starting late 2024)
// TODO: Eventually remove this document upgrade code
#[derive(Debug, serde::Serialize, serde::Deserialize)]
pub struct OldDocumentMessageHandler {
// ============================================
@@ -1637,11 +1637,11 @@ impl NodeGraphMessageHandler {
common
}
/// Send the cached layout to the frontend for the options bar at the top of the node panel
/// Send the cached layout to the frontend for the control bar at the top of the node panel
fn send_node_bar_layout(&self, responses: &mut VecDeque<Message>) {
responses.add(LayoutMessage::SendLayout {
layout: Layout::WidgetLayout(WidgetLayout::new(self.widgets.to_vec())),
layout_target: LayoutTarget::NodeGraphBar,
layout_target: LayoutTarget::NodeGraphControlBar,
});
}
@@ -3311,7 +3311,7 @@ impl NodeNetworkInterface {
node.implementation = implementation;
}
// TODO: Eventually remove this (probably starting late 2024)
// TODO: Eventually remove this document upgrade code
/// Keep metadata in sync with the new implementation if this is used by anything other than the upgrade scripts
pub fn replace_implementation_metadata(&mut self, node_id: &NodeId, network_path: &[NodeId], metadata: DocumentNodePersistentMetadata) {
let Some(network_metadata) = self.network_metadata_mut(network_path) else {
@@ -407,7 +407,7 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
}
};
// TODO: Eventually remove this (probably starting late 2024)
// TODO: Eventually remove this document upgrade code
// Upgrade all old nodes to support editable subgraphs introduced in #1750
if upgrade_from_before_editable_subgraphs {
// This can be used, if uncommented, to upgrade demo artwork with outdated document node internals from their definitions. Delete when it's no longer needed.
@@ -461,7 +461,7 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
};
// Upgrade Fill nodes to the format change in #1778
// TODO: Eventually remove this (probably starting late 2024)
// TODO: Eventually remove this document upgrade code
let Some(ref reference) = node_metadata.persistent_metadata.reference.clone() else {
continue;
};
@@ -616,7 +616,7 @@ impl MessageHandler<PortfolioMessage, PortfolioMessageData<'_>> for PortfolioMes
}
}
// TODO: Eventually remove this (probably starting late 2024)
// TODO: Eventually remove this document upgrade code
// Upgrade document to the new vector manipulation format introduced in #1676
let document_serialized_content = document.serialize_document();
if upgrade_vector_manipulation_format && !document_serialized_content.is_empty() {
@@ -974,7 +974,7 @@ impl PortfolioMessageHandler {
fn load_document(&mut self, new_document: DocumentMessageHandler, document_id: DocumentId, responses: &mut VecDeque<Message>) {
let new_document = new_document;
self.document_ids.push(document_id);
new_document.update_layers_panel_options_bar_widgets(responses);
new_document.update_layers_panel_control_bar_widgets(responses);
self.documents.insert(document_id, new_document);
@@ -795,7 +795,7 @@ impl ShapeState {
while let Some((anchor, handles)) = missing_anchors.keys().next().copied().and_then(|id| missing_anchors.remove_entry(&id)) {
visited.push(anchor);
// If the adgacent point is just this point then skip
// If the adjacent point is just this point then skip
let mut handles = handles.map(|handle| (handle.1 != anchor).then_some(handle));
// If the adjacent points are themselves being deleted, then repeatedly visit the newest agacent points.
+1 -2
View File
@@ -63,8 +63,7 @@ pub trait Fsm {
/// The implementing tool must set this to a struct designed to store the internal values stored in the tool.
/// For example, it might be used to store the starting location of a point when a drag began so the displacement distance can be calculated.
type ToolData;
/// The implementing tool must set this to a struct (or `()` if none) designed to store the values of the tool options set by the user in the Options Bar
/// (located above the viewport, below the document's tab).
/// The implementing tool must set this to a struct (or `()` if none) designed to store the values of the tool options set by the user in the tool controls portion on the left of the control bar.
type ToolOptions;
/// Implementing this mandatory trait function lets a specific tool react accordingly (and potentially change its state or internal variables) upon receiving an event to do something.