Colors do not work for some components lazarus / 21-General ---------------------------------------------------------------------- franzala · 2021-03-27 20:54 I installed recently Lazarus 2.0.6 with FPC 3.0.4 on Ubuntu 20.04 with the proposed package and several components (for instance buttons and edit) do not  show the colors which I have assigned with the object inspector while others work properly (for instance Panel, and RadioGroup). The property in the Objectinspector shows the color I have choosen but on the form the button remains white. Did I miss something or did I change unvolunteerly an option somewhere? ---------------------------------------------------------------------- lucamar · 2021-03-27 21:13 Some controls are painted in the system's theme by the underlying widgtset and can't be easily changed. There are workarounds (e.g. using custom drawn styles) but usually these work only for some systems or even some specific versions thereof. There is a brief explanation on the wiki: Lazarus For Delphi Users: TControl.Font/TControl.ParentFont, which while talking about fonts applies also to other UI elements. ---------------------------------------------------------------------- winni · 2021-03-27 21:28 Hi! Have a look in the ObjectInspector at Tab #4: "Restricted" There is shown that  Windows doesn't like colors on TButtons. Winni ---------------------------------------------------------------------- Fred vS · 2021-03-27 21:46 QuoteThe property in the Objectinspector shows the color I have choosen but on the form the button remains white. If you want total control for each widget, you could use fpGUI or mseide-msegui Fre;D ---------------------------------------------------------------------- franzala · 2021-03-28 10:47 Thanks to all for your quick and usefull replies. I've used previously lazarus with Ubuntu 18.04 and 16.04 and before with Mageia; I never faced such a problem and I'm convinced that components like Buttons or Edit should normally apply the colors defined with the objectinspector. Following your hint, I had a look on tab #4 which I never used up to now; but it looked no very easy to understand to me. I could not find documentation on that subject on the net and if somebody has a hint for that, he will be welcome. The attached file shows the currents settings (in french) which I did not change, at least not volunteery. Under "Restrictions générales des ensembles" I see 3 pictures followed by a number; the last one refers probaby to Windows, but I'm not able to guess the meaning of the 2 first. (Linux?, Apple?) I notice also that under "restrictions des composants" there is indicated no restriction. I will also study the suggested alternatives, but basicely I'd prefer to remain with as less added packages as possible. ---------------------------------------------------------------------- lucamar · 2021-03-28 11:26 Quote from: franzala on March 28, 2021, 12:47:26 pmUnder "Restrictions générales des ensembles" I see 3 pictures followed by a number; the last one refers probaby to Windows, but I'm not able to guess the meaning of the 2 first. (Linux?, Apple?) I notice also that under "restrictions des composants" there is indicated no restriction. The first two icons (the red-blue-green "cubes") correspond to GTK and GTK2 widget sets and the last, as you guessed, is for Windows. The number after each is the number of restrictions that apply to that widget set. Note that while there appear to be no restrictions for the component, there are in fact the three (for TForm) which appear afterwards, which depend on the widgetset. In the attached image, for example, you'll see that while it says that there are no restrictions for TButton, one appears below: in Windows you cannot change its Color. ---------------------------------------------------------------------- franzala · 2021-03-28 17:28 Is there a documentation on Restrictions? How do I change the existing restrictions? ---------------------------------------------------------------------- lucamar · 2021-03-28 17:56 Quote from: franzala on March 28, 2021, 07:28:35 pmIs there a documentation on Restrictions? Kind of, somewhat dispersed throughout the docs and in the wiki. But not all in one place, IIRC. QuoteHow do I change the existing restrictions? Creating a solution or a workaround for the restriction in the RTL/FCL/LCL, building a patch, posting in the bug tracker and hoping the devs will aprove and introduce your changes in the code. The real problem is that those restrictions don't come from FPC/Lazarus but from shortcomings and differences in the underlying widgetset, and it's usually difficult to find solutions that can be applied: a) without breaking existing code, b) working more or less the same on all supported systems, and c) needing no extraordinary maintenance. Or did you mean how do you edit the restrictions that appear in the OI? I so, I've no idea, sorry ---------------------------------------------------------------------- winni · 2021-03-28 18:01 Hi! Workaround: Use a BitBtn or a SpeedButton. Both own the property glyph which is nothing but a TBitmap. You can insert an icon in the ObjectInspektor. Or you can draw on the canvas of the glyph. Winni