2012/05/28

Pesky Etching

While working with Qt buttons I've came across a very nasty behaviour - when you disable a button, it's label receives a pretty ugly shadow that makes the font rather unreadable. This effect is called 'etching'. There is a reminant of a CSS property that controls that behaviour called etch-disabled-text, but it's undocumented and actually doesn't work at all.

There is NO documented way of removing that shadow. Pretty crappy, especially for a very configurable toolkit like Qt.

Anyways, here's a workaround. It'll set the proper global palette rules that will apply this fix to all the buttons.
The first line sets the color of the disabled text, the second - removes the etching.