dankito / RichTextEditor

Rich text WYSIWYG editor for Android and JavaFX
Apache License 2.0
95 stars 36 forks source link

Double occurence of some tools in AllCommandsEditorToolbar #63

Closed wharnisch closed 3 years ago

wharnisch commented 3 years ago

There seems to be double occurence of some tools in AllCommandsEditorToolbar: grafik Regards from Austria

dankito commented 3 years ago

Hi,

actually these are (slightly) different commands, i just didn't have different icons for them.

If you take a look at the source code (AllCommandsEditorToolbar), the first icon each toggles text- / background color on / off, with the second one you can set the color:

        addCommand(SwitchTextColorOnOffCommand())
        addCommand(SetTextColorCommand())
        addCommand(SwitchTextBackgroundColorOnOffCommand())
        addCommand(SetTextBackgroundColorCommand())

The AllCommandsEditorToolbar is only meant as a show case, it's not meant for production use.

wharnisch commented 3 years ago

Sorry that I haven't investigated this better. Regards from Austria

wharnisch commented 3 years ago

Toggling text-/background color is exactly the functionality I was looking for. I didn't find it in GroupedCommandsEditToolbar.

So, if AllCommandsEditorToolbar is not meant for productive use, which toolbar class should be used for productive use? Or should I write my own toolbar class derived from EditorToolbar for productive use?

dankito commented 3 years ago

Yes, creating your own with exactly the commands you actually need is how it's meant to be. Simply take a look at GroupedCommandsEditToolbar or AllCommandsEditorToolbar how that's done (should actually be fairly easy).

If you like to, you can of course also use AllCommandsEditorToolbar. It's just not meant to be used that way :) (i think it's too overloaded and has a bad UX as you have to scroll to the right to see all commands).