mirror of
https://github.com/GraphiteEditor/Graphite.git
synced 2026-10-02 12:38:12 +08:00
Refresh menu for path editable
This commit is contained in:
@@ -362,6 +362,7 @@ impl LayoutHolder for PathTool {
|
|||||||
impl<'a> MessageHandler<ToolMessage, &mut ToolActionMessageContext<'a>> for PathTool {
|
impl<'a> MessageHandler<ToolMessage, &mut ToolActionMessageContext<'a>> for PathTool {
|
||||||
fn process_message(&mut self, message: ToolMessage, responses: &mut VecDeque<Message>, context: &mut ToolActionMessageContext<'a>) {
|
fn process_message(&mut self, message: ToolMessage, responses: &mut VecDeque<Message>, context: &mut ToolActionMessageContext<'a>) {
|
||||||
let updating_point = message == ToolMessage::Path(PathToolMessage::SelectedPointUpdated);
|
let updating_point = message == ToolMessage::Path(PathToolMessage::SelectedPointUpdated);
|
||||||
|
let old_editable = self.tool_data.make_path_editable_is_allowed;
|
||||||
|
|
||||||
match message {
|
match message {
|
||||||
ToolMessage::Path(PathToolMessage::UpdateOptions { options }) => match options {
|
ToolMessage::Path(PathToolMessage::UpdateOptions { options }) => match options {
|
||||||
@@ -417,6 +418,11 @@ impl<'a> MessageHandler<ToolMessage, &mut ToolActionMessageContext<'a>> for Path
|
|||||||
if updating_point {
|
if updating_point {
|
||||||
self.send_layout(responses, LayoutTarget::ToolOptions);
|
self.send_layout(responses, LayoutTarget::ToolOptions);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if self.tool_data.make_path_editable_is_allowed != old_editable {
|
||||||
|
// It is necessary to update the menu bar's "make path editable" enabled state
|
||||||
|
responses.add(MenuBarMessage::SendLayout);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Different actions depending on state may be wanted:
|
// Different actions depending on state may be wanted:
|
||||||
|
|||||||
Reference in New Issue
Block a user