Recent

Author Topic: [SOLVED] Lazarus IDE 4 UI fails to sync on dark mode under Fedora KDE 6  (Read 1233 times)

Psacla_63

  • Newbie
  • Posts: 6
Under Fedora KDE 6 in dark mode some widgets (button, popup, text field, dialogs) seems to stay in light mode and bigger than theme. Particulary fonts are in white on light gray background and some button's icons buttons are stuck on Breeze light. It looks like some part of the UI on Lazarus switch to dark mode (following theme) and other stay stuck on light mode, it's very weird.

Under XFCE, Gnome, Cinnamon, no problem.

I tried Lazarus under some other recent KDE distros (Neon, Kubuntu, Mageia, Manjaro, MX) without this problem, installing Lazarus either from distro package and the offical one from sourceforge (.rpm ).

I tried to install mannually KDE (dnf group install kde-desktop) on Fedora Workstation 42 edition (Gnome)... same problem.

I tried to install some stable dark themes for Gtk, Qt and Plasma,... problem is still same.


No problem on "old" soft using GTK UI like
  • GNATstudio
  • Dia
  • LibreCAD.
Geany works perfectly (Using GTK+ v3.24.49 and GLib v2.84.2 runtime libraries)!


NOTE:
on Fedora scientific KDE version 39, Lazarus just ignores dark theme. So version 42 its a little bit better, but pretty unusable.
I tried to use Wayland and X11 on version 39: no differences.

So I thought that problem origin is Fedora and not Lazarus, but it seems that is more complicated. I'm probably missing something, but Lazarus IDE fails on Fedora KDE standard installation.

UPDATE: after a lot of tests, it looks like Lazarus try to use some default UI parts and doesn't follow whole GTK theme. On other distro (Neon,kubuntu,Manjaro,etc) Lazarus follows the whole theme. So, I think there is probably a Lazarus parameter with a wrong value.   
   
I think that the Manjaro and Arch teams may have an explanation because apparently they have compiled Plasma with different options.

For now the only 2 options I found is
  • use Fedora with XFCE.
    use Fedora KDE in ligth theme.

[SOLVED]
Edit .gtkrc-2.0-kde4 and replace line 13

Code: Bash  [Select][+][-]
  1. include "/usr/share/themes/Adwaita/gtk-2.0/gtkrc"
  2.  

by

Code: Bash  [Select][+][-]
  1. include "/usr/share/themes/Breeze-Dark/gtk-2.0/gtkrc"
  2.  

It looks like Fedora does not update correctly this file when a dark theme is selected.  >:D
Some other GTK apps are not impacted by that but Lazarus is... If someone could have an explanation?


Config
Lazarus 4.0 (rev Unknown) FPC 3.2.2 x86_64-linux-gtk2

Operating System: Fedora Linux 42
KDE Plasma Version: 6.3.5
KDE Frameworks Version: 6.14.0
Qt Version: 6.9.0
Kernel Version: 6.14.6-300.fc42.x86_64 (64-bit)
Graphics Platform: Wayland
Processors: 8 × Intel® Core™ i9-9900K CPU @ 3.60GHz
Memory: 31.3 GiB of RAM
Graphics Processor: NVIDIA GeForce GTX 1080 Ti
« Last Edit: July 07, 2025, 11:17:30 pm by Psacla_63 »

dbannon

  • Hero Member
  • *****
  • Posts: 3407
    • tomboy-ng, a rewrite of the classic Tomboy
....
So I thought that problem origin is Fedora and not Lazarus, but it seems that is more complicated.
....

Its more likely some interaction between KDE and Lazarus.

You have to understand that Fedora is really a platform for RedHat to test ideas that may, at some time make it into its core product, RedHat Linux.  Sure, its been tested by the Fedora developers but they cannot possibly test every possible combination.

In the past, I was a big KDE user. But at some point (long before I discovered Lazarus incidentally) I got sick of the "surprises" I'd get on every update.  Back then, at least, 'they' were willing to take risks that did not suit my workstyle !

So, my point, a combination of Fedora and KDE ? Expect the occasional issue ! Probably be fixed in next release.

Other distros and Desktops are sure not guaranteed to be issue free, but just might be better IMHO ?

Davo
Lazarus 3, Linux (and reluctantly Win10/11, OSX Monterey)
My Project - https://github.com/tomboy-notes/tomboy-ng and my github - https://github.com/davidbannon

Psacla_63

  • Newbie
  • Posts: 6
Thank you for the advice.

I need a distro that uses rpm, has a good user interface, works well with KDE applications and allows users to install applications easily and has an acceptable privacy policy. Personally, my favorites are Manjaro and MX. But I have to use an rpm-based system, so RedHat and Fedora.
Fedora has done the job well so far. I know Lazarus isn't the most widely used, but I have projects to do in Pascal. Fedora is widely used, KDE popular. So far Lazarus works well under Fedora, the only big problem is that it doesn't follow themes and here the dark theme. This problem can't be too complicated to solve?

dsiders

  • Hero Member
  • *****
  • Posts: 1452
Thank you for the advice.

I need a distro that uses rpm, has a good user interface, works well with KDE applications and allows users to install applications easily and has an acceptable privacy policy. Personally, my favorites are Manjaro and MX. But I have to use an rpm-based system, so RedHat and Fedora.
Fedora has done the job well so far. I know Lazarus isn't the most widely used, but I have projects to do in Pascal. Fedora is widely used, KDE popular. So far Lazarus works well under Fedora, the only big problem is that it doesn't follow themes and here the dark theme. This problem can't be too complicated to solve?

I use OpenSUSE. What you don't mention is the Application style used in KDE. I've had problems with Breeze app style. Fusion works as expected.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

Psacla_63

  • Newbie
  • Posts: 6
Thank you for your comment.
Well, I use the default UI as a new user do. But, I tried to use Breeze and Fusion, even I installed and tried kvantum. This does not solve the problem: I can't find why but under Fedora, Lazarus has serious problems with dark mode and theme in general.

Do you know what is the cause of problem with Breeze in Application style in OpenSUSE?
« Last Edit: June 20, 2025, 12:00:08 am by Psacla_63 »

dsiders

  • Hero Member
  • *****
  • Posts: 1452
Thank you for your comment.
Well, I use the default UI as a new user do. But, I tried to use Breeze and Fusion, even I installed and tried kvantum. This does not solve the problem: I can't find why but under Fedora, Lazarus has serious problems with dark mode and theme in general.

Do you know what is the cause of problem with Breeze in Application style in OpenSUSE?

The problem I found was with drop-down style controls. The application style wanted to use a very narrow image for the drop down indicator. LCL tries to use a wider image. The result is that no image was drawn at all. I reported to the bug tracker and it was marked a a bug in KDE theming. I have  no such issue with the Fusion application style.
Preview the next Lazarus documentation release at: https://dsiders.gitlab.io/lazdocsnext

Psacla_63

  • Newbie
  • Posts: 6
Interesting, that could mean the problem is Lazarus. It looks like Lazarus uses not the whole selected GTK theme, but uses part of default theme, for some widgets.  :o

May be it is a compilation option?

BildatBoffin

  • New Member
  • *
  • Posts: 35
KDE does not support selecting a GTK2 theme anymore. Try to create ~/.gtkrc-2.0-kde4 and ~/.gtkrc-2.0 files with for content

Code: Text  [Select][+][-]
  1. gtk-enable-animations=1
  2. gtk-primary-button-warps-slider=1
  3. gtk-toolbar-style=3
  4. gtk-menu-images=1
  5. gtk-button-images=1
  6. gtk-cursor-theme-size=24
  7. gtk-cursor-theme-name="breeze_cursors"
  8. gtk-sound-theme-name="ocean"
  9. gtk-icon-theme-name="breeze"
  10. gtk-font-name="Noto Sans,  10"
  11.  
  12. gtk-theme-name="Arc-Dark"

And eventually update the last setting so that it matches something installed on your machine (take care to install themes for GTK2, e.g in dnf dragora if you type gtk2 you will find a lot of them). That works for me since years but as I copy my dot files since years I cant remember which of the two files had to be created / edited manually.

(P.S: you might have to close and reopen your desktop session.)
« Last Edit: July 05, 2025, 10:06:04 am by BildatBoffin »

Psacla_63

  • Newbie
  • Posts: 6
[SOLVED] Lazarus IDE 4 UI fails to sync on dark mode under Fedora KDE
« Reply #8 on: July 07, 2025, 11:03:06 pm »
Thank you BildatBoffin, it works!

It seems that the only file to modify is ~/.gtkrc-2.0-kde4. No need of ~/.gtkrc-2.0 (for Lazarus)

When I edited ~/.gtkrc-2.0-kde4 there was a line 13

Code: Text  [Select][+][-]
  1. gtk-cursor-blink-time=1000                                                                                                                    
  2. gtk-cursor-blink=1
  3. gtk-enable-animations=1
  4. gtk-primary-button-warps-slider=1
  5. gtk-toolbar-style=3
  6. gtk-menu-images=1
  7. gtk-button-images=1
  8. gtk-cursor-theme-size=30
  9. gtk-cursor-theme-name="breeze_cursors"
  10. gtk-sound-theme-name="ocean"
  11. gtk-icon-theme-name="breeze-dark"
  12. gtk-font-name="Noto Sans,  10"
  13. include "/usr/share/themes/Adwaita/gtk-2.0/gtkrc"
  14.  
  15. gtk-theme-name="Breeze-Dark"
  16.  

I just replaced line 13 by

Code: Text  [Select][+][-]
  1. include "/usr/share/themes/Adwaita-dark/gtk-2.0/gtkrc"
  2.  

And the problem is solved.

It works too if I replace line 13 with

Code: Text  [Select][+][-]
  1. include "/usr/share/themes/Breeze-Dark/gtk-2.0/gtkrc"
  2.  

So it looks like Fedora does not update this file correctly when setting up a dark mode...

The question is why this has an impact on Lazarus only and no other GTK apps?

 

TinyPortal © 2005-2018