did someone know how to change the text color of a webtoolbar?
Public Sub ToolbarStyle(t As WebToolbar)
t.Style.Value("background") = "rgb(41,67,78)"
t.Style.Value("color") = "white" '???
t.Style.Value("text-shadow") = "2px 2px 4px #000000"
End Sub
i just wonder why ācolorā at label work and at toolbar not.
the text-shadow works in toolbar.
maybe i need a different keyword to access the toolbar text or its because the toolbar is not finished?
it is just a mini project to play with to test web 2.
The reason is that the color is already defined ābeforeā your style element will hit in. You can change it via CSS in HTML Header of your project in the IDE, as follows:
I had to change it today my self, and found your question. So I thought it might help others posting the current solution. I hope it will change in a future version. Especially tweaks in the web toolbar is most likely something many users want to be able to change in the IDE. ā¦ for instance my customers: I donāt want to tell them how to change CSS, this will easily end in a complete disaster .
Public Sub ToolbarStyle(t As WebToolbar)
Var myNewStyle As New WebStyle
myNewStyle.backgroundColor = &cff0000 // red
myNewStyle.Bold = True // etc..
t.style = myNewStyle // Assign it a new style so xojo knows it's changed.
End Sub
it does not change the text color. i guess this WebToolbarButton have its own Style. but this button .Style propertie there is not a WebStyle.
Public Sub ToolbarStyle(t As WebToolbar)
Var myNewStyle As New WebStyle
myNewStyle.backgroundColor = &cff0000 // red
myNewStyle.Bold = True // etc..
myNewStyle.ForegroundColor = Color.White
t.style = myNewStyle // Assign it a new style so xojo knows it's changed.
End Sub
Has there been any improved methods for this (styling the text associated with a WebToolbar item)? Right now I can set the color of the BootstrapIcon, but the associated caption is always āblackā. Love to be able to set it to match the BootstrapIcon. Currently using 2021 R3.1
This may be a bit off topic:
Is there a way to set style like bold, for a specific item in the toolbar that was clicked? or set the colour to highlight what was selected?
I can get the item that was clicked and the caption as per the WebToolBar example file but then trying to use that info to change the clicked items style