TextColor for ToolBarButtons

Answered
0
0

Hello,

The Problem

we are looking to change the TextColor of some ToolBarButtons within our ToolBars, but were  not successful so far.

Our last attempt was to create an appearance key within our theme and assign the appearance key to the buttons that we ant to be painted with red text.
Unfortunately, this did not work and the Buttons did not change the textcolor.

We used your example with the buttons as reference, but i think there is a difference between components and controls, so hopefully you can assist us in that matter.

The Questions

  1. Is it even possible to change the textcolor of components like the ToolBarButton?
  2. How would i add an appearance key for a component like the toolbarbutton, that only changes the textcolor and inherits all other properties, similiar to the buttons in your example?

 

Thank you very much in advance!

  • You must to post comments
Best Answer
0
0

Hi Florian,

you can use e.g. the following mixin and assign “button-green” as appearance key.

{
 "appearances":
 { 
   "button-green":
   {
     "inherit": "button",
     "states": 
   {
     "default": 
     {
       "properties":
       {
         "cursor": "pointer",
         "opacity": 1,
         "padding": [5, 5, 5, 5],
         "textColor": "green"
       },
       "styles": 
       {
          "width": [1, 1, 1, 1],
          "color": "transparent",
          "backgroundColor": "transparent"
       }
     },
     "hovered": 
     {
       "styles": 
       {
         "backgroundColor": "hotTrack"
       }
     }, 
     "disabled": 
     {
       "properties": 
       {
         "opacity": 0.5,
         "cursor": "default"
       }
     }
   }
 }
 }
}

Hope that helps,
Frank

  • Florian Bogner
    Thank you! This is exactly what we needed.
  • You must to post comments
0
0

Hi Florian,

ToolBarButton.ForeColor property is included in the latest Wisej dev build (2.1.41).

Best regards
Frank

  • You must to post comments
0
0

Hi Florian,

following up on this we decided to add a ForeColor property to ToolBarButtons,
so you can set the color directly.

It´s logged as enhancement request #2165 and will be included in the next Wisej build.

I´ll notify you when it´s available.

Best regards
Frank

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.