Forum > LCL

'Black on black' combobox items with certain *nix desktops

<< < (2/3) > >>

winni:
Hi Sieben!

I can't test your code because I get an compiler error:

bigimage1.pas(102,5) Error: Internal error 2014010312
It shows the line with the begin

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{------------------------------------------------------------------------------  procedure TCustomComboBox.LMDrawListItem(var TheMessage : TLMDrawListItem);   Handler for custom drawing items. ------------------------------------------------------------------------------}procedure TCustomComboBox.LMDrawListItem(var TheMessage : TLMDrawListItem);begin   // <===== 

fpc 3.04  laz 2.0.10 gtk2 lin64

Winni

Sieben:

--- Quote from: winni ---I can't test your code because I get an compiler error:
--- End quote ---

I'm afraid there is not much I can do about that...

But to continue with this little saga - two or maybe three more conditions:

4) only non-selected items are concerned

5) happens only with certain Linux desktops

6) - unfortunately I'm not sure here - happens only with Gtk2

Is there anyone out there who can confirm this really is an issue restricted to Gtk2 only? And anyone knows why


--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$IFDEF LCLGTK2}// code here...{$ENDIF}
does not gray out the code in between in the editor but doesn't compile it either...?

Edit: Sorry for my premature posting earlier this week - I was so absorbed by this graphics stuff and that I finally seemed to have a hold on that that I totally forgot on the conditions when to interfere with font color settings at all.

wp:

--- Quote from: Sieben on December 27, 2020, 07:24:14 pm ---
--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---{$IFDEF LCLGTK2}  WriteLn(1+);   // Note the missing '1' at the end.{$ENDIF}
--- End quote ---
Above snippet will not compile if you are on gtk2. It will compile, when you replace the WriteLn argument by (1+1).

But note that gtk2 alone is not your issue because there are other Linux systems using gtk2 where your issue does not occur. You must also detect the type and version of your Linux system, eg. 'Ubuntu 16.04' - Linux specialists will be able to tell you how to do this from Lazarus.

Sieben:

--- Quote from: wp ---Above snippet will not compile if you are on gtk2. It will compile, when you replace the WriteLn argument by (1+1).
--- End quote ---

Hm, what's the rule behind that...? It seems I can't get any code to compile in this here context with said condition...


--- Quote from: wp ---But note that gtk2 alone is not your issue because there are other Linux systems using gtk2 where your issue does not occur. You must also detect the type and version of your Linux system, eg. 'Ubuntu 16.04' - Linux specialists will be able to tell you how to do this from Lazarus.

--- End quote ---

What about 'SESSION=Ubuntu', 'XDG_CURRENT_DESKTOP= Unity' or 'UPSTART_JOB=unity7' (environment variables) or any sensible combination as a valid condition for this? Can you possibly confirm that any of these are true as well with the 18.04 Ubuntu you installed, but not for other linux installations?

That said it would of course be most desirable to have a sufficient condition, but if it turns out there is none a number of necessary conditions must be sought that a) turn down the probability of interfering without necessity and b) even if so to not make any settings that hurt. For the latter it would help to know if condition 1) as mentioned earlier is true: font color for this will in any case either be clWindowText or clHighLightText, tertium non datur.

wp:

--- Quote from: Sieben on December 27, 2020, 09:33:08 pm ---
--- Quote from: wp ---Above snippet will not compile if you are on gtk2. It will compile, when you replace the WriteLn argument by (1+1).
--- End quote ---

Hm, what's the rule behind that...? It seems I can't get any code to compile in this here context with said condition...

--- End quote ---
The idea is that when you are on gtk2 the compiler sees the code within the{$IFDEF LCLGTK2}..{$ENDIF}. To test this you can put some faulty code in there, and the compilation will stop here.


--- Quote from: Sieben on December 27, 2020, 09:33:08 pm ---What about 'SESSION=Ubuntu', 'XDG_CURRENT_DESKTOP= Unity' or 'UPSTART_JOB=unity7' (environment variables) or any sensible combination as a valid condition for this? Can you possibly confirm that any of these are true as well with the 18.04 Ubuntu you installed, but not for other linux installations?

--- End quote ---
First of all: I am not a Linux man, so maybe this is far easier than what I am saying...

Anyway, here is the excerpt of the env command in all my Linuxes:

Ubuntu 16.04 (Combobox behaviour as you describe)
  SESSION=ubuntu
  XDG_CURRENT_DESKTOP=Unity
  UPSTART_JOB=Unity7

Ubuntu 18.04 (Combobox behaviour as you describe)
  GDMSESSION=ubuntu
  XDG_CURRENT_DESKTOP=ubuntu:GNOME
  (UPSTART_JOB ... not found)

Ubuntu 20.10 (Combobox behaviour CORRECT! But LCL system colors are not extracted from theme correctly: In dark mode, clWindow is still bright, but the background of TCombobox or TEdit is dark -- what a mess!)
  GDMSESSION=ubuntu
  XDG_CURRENT_DESKTOP=ubuntu:GNOME

Lubuntu 20.10 (correct, but I was not able to switch into some kind of "dark mode")
  DESKTOP_SESSION=Lubuntu
  XDG_CURRENT_DESTKOP=LXQt

LMDE 4 Cinnamon (correct theme support)
  GDMSESSION=cinnamon
  DESKTOP_SESSION=cinnamon
  XDG_CURRENT_DESKTOP=X-Cinnamon

My impression is that theme support in the various Linuxes is much more multi-facetted and is not mapped on the LCL system colors. But as I said, I am not a Linux man...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version