Skip to content

Add a View > Rulers toggle to disable rulers #1416

@Keavon

Description

@Keavon

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.

Metadata

Metadata

Assignees

Labels

Good First IssueGood for newcomersWebInvolves web programming (TypeScript, Svelte, CSS)
No fields configured for Feature.

Projects

Status
Completed This Milestone

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions