Bug 158838 - UNO action to toggle applied styles like <emphasis> and <strong>
Summary: UNO action to toggle applied styles like <emphasis> and <strong>
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
7.6.4.1 release
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords: needsDevAdvice
Depends on:
Blocks: UNO-Command-New
  Show dependency treegraph
 
Reported: 2023-12-23 13:55 UTC by j.a.swami
Modified: 2024-06-17 22:02 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description j.a.swami 2023-12-23 13:55:17 UTC
Since LO Writer is meant to be a style-based word processor, we should be able to use <emphasis> and <strong> as easily as italic and bold. 

But italic and bold are easier to use because the keys to invoke them toggle whereas keys assigned for styles do not. 

Suppose, for example, I assign Ctrl-I to "<emphasis>." If while typing I type Ctrl-I, the following text will be emphasized, as expected. But, contrary to expectations, typing Ctrl-I will not return me to non-emphasized text.

The same with selected text: Ctrl-I will emphasize it, but a second Ctrl-I will not remove the emphasis. 

I suggest that the keys assigned to these styles should toggle, so that (using the same example) Ctrl-I works with <emphasis> the same way it works with italic.
Comment 1 V Stuart Foote 2023-12-23 14:45:11 UTC
Applied char styles don't really toggle, rather we have .uno:DefaultCharStyle "No Character Style" to remove an applied Style from an active selection.

You can see this in use on the alternate View -> Toolbars 'Formatting (Styles)' toolbar, the "A" icon with tooltip "Remove applied character style". Likewise on the Styles menu.

It can also be assigned by Tools -> Customize... dialog  as a Keyboard or Context menu shortcut. Just note that it is held with other 'Style' -> 'Character' category functions.

Guess there could be benefit to implementing a style toggle (apply|remove) for the current TB buttons for users of the 'Formatting (Styles)' and if that provided a hook for keyboard, menu customization even better.

Throwing it in the UX-advise pool.
Comment 2 j.a.swami 2023-12-23 15:25:32 UTC
The approach of using "remove applied character style," if not ideal, seems like at least something. But "remove applied character style" has no effect on <emphasis> and <strong>. (When I made a word emphatic or strong and then clicked the "A" icon, nothing happened.)

And as I said, even if this approach would work it would be less than ideal. For italic I can toggle with Ctrl-I and Ctrl+!. For <emphasis> I'd need something like, say, Ctrl-I, Ctrl-R. Uninuitive.

Let's see what the UX people say.
Comment 3 Heiko Tietze 2024-01-03 10:57:47 UTC
Turning the .uno:StyleApply?<styles> command into toggle functions sounds reasonable. Any blocker, Maxim?