You will store the rulers enabled/disabled status next to pub view_mode: ViewMode, in document_message_handler.rs, as a boolean called rulers_visible: bool,.
Then you need to add a DocumentMessage message and its handler which enables/disables that, you can call it SetRulersVisible { visible: bool }.
Then add an entry in the view section of menu_bar_message_handler.rs for View > Rulers. It should display a checkbox to the left so take a look at how the other menu bar entries which do have a checkbox are implemented and use that approach to replicate how they tie the value to the rulers_visible: bool, field of the DocumentMessageHandler. Clicking that entry should call your new SetRulersVisible message.
You also need to add a FrontendMessage called UpdateRulersVisibility { visible: bool } and add a handler in the frontend for it in the correct place to hide the rulers from being rendered by the Document.rs svelte component.
You will store the rulers enabled/disabled status next to
pub view_mode: ViewMode,
indocument_message_handler.rs
, as a boolean calledrulers_visible: bool,
.Then you need to add a
DocumentMessage
message and its handler which enables/disables that, you can call itSetRulersVisible { visible: bool }
.Then add an entry in the view section of
menu_bar_message_handler.rs
for View > Rulers. It should display a checkbox to the left so take a look at how the other menu bar entries which do have a checkbox are implemented and use that approach to replicate how they tie the value to therulers_visible: bool,
field of theDocumentMessageHandler
. Clicking that entry should call your newSetRulersVisible
message.You also need to add a FrontendMessage called
UpdateRulersVisibility { visible: bool }
and add a handler in the frontend for it in the correct place to hide the rulers from being rendered by the Document.rs svelte component.