stevengharris/MarkupEditor

Customize toolbar

mediakon opened this issue · 2 comments

Hello,

I found possible problem. I would like to customize toolbar and I use following code:

`
MarkupEditor.style = .labeled
MarkupEditor.allowLocalImages = false

       let myToolbarContents = ToolbarContents(leftToolbar: false, correction: false, insert: false, style: true, format: true, rightToolbar: false, insertContents: InsertContents(link: false, image: false, table: false), styleContents: StyleContents(list: true, dent: false), formatContents: FormatContents(code: false, strike: false, subSuper: false))
       
       ToolbarContents.custom = myToolbarContents

`

but I still see button with select "normal", "header 1-6". 

a need to hide this button. (stay only LIST (ul and li) and B I U)

Zrzut ekranu 2022-09-1 o 10 55 58

Piotr

You can do this by adding a new var (like public var paragraph: Bool to StyleContents and then making the first view in the StyleToolbar conditional on it (as is done for list and dent). I'll add it as a pull request if you do it, or I will probably do this myself as I close down for Beta. I somehow thought - incorrect, it seems! - that the paragraph styling would be wanted even if the others weren't.

thanks