Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IDEA] It should be possible to hide edit toolbar buttons, but keep the keyboard shortcut active #8607

Open
pmario opened this issue Sep 16, 2024 · 3 comments

Comments

@pmario
Copy link
Member

pmario commented Sep 16, 2024

It should be possible to hide edit toolbar buttons, but keep the keyboard shortcut active

If we deactivate editor toolbar buttons in the ControlPanel, the keyboard shortcut will also be deactivated.

image

That's OK.

It is proposed to add a second option, that hides the button, but keeps the keyboard shortcut.
This can be done with some CSS as seen at: https://talk.tiddlywiki.org/t/how-to-use-preview-shortcut-keys-when-the-editor-button-is-hidden/10680/2?u=pmario

The following code hides the Preview-button, but keeps the shortcut

title: hide-edit-button-styles
tags: $:/tags/Stylesheet

.tc-text-editor-toolbar-item-wrapper :has(.tc-image-preview-closed)
{
  display:none;
}

@Jermolene -- What do you think?

@pmario
Copy link
Member Author

pmario commented Sep 16, 2024

We also need to deal with the More dropdown. With the CSS above, we will basically "loose" the button. So we need to deal with that edge-case too.

image

@Jermolene
Copy link
Member

Hi @pmario using CSS to hide the buttons while keeping them available for shortcut handling is a useful approach for plugins, but I think would not be a reasonable approach for the core.

Instead, if we are really absolutely certain that this needs to be fixed as a matter of urgency, then we should refactor the keyboard handling to fix this problem (eg by having a separate set of buttons that are exclusively used for keyboard shortcuts).

@pmario
Copy link
Member Author

pmario commented Sep 16, 2024

I think it is not urgent, since there is a relatively simple workaround.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants