Recent

Author Topic: Lazarus Dark theme...  (Read 9862 times)

jex

  • New Member
  • *
  • Posts: 31
Re: Lazarus Dark theme...
« Reply #15 on: February 28, 2022, 12:43:41 am »
If build lazarus with qt5 for windows and using https://github.com/doublecmd/doublecmd/blob/master/src/platform/win/udarkstyle.pas you can get a dark theme

Can you please provide steps on how to achieve that or maybe release a compiled binary?

zamtmn

  • Sr. Member
  • ****
  • Posts: 494
Re: Lazarus Dark theme...
« Reply #16 on: February 28, 2022, 03:50:53 am »
https://disk.yandex.ru/d/_LWZvwTJG0x7vw

Copy darklazqt5/lazarus to your lazarus directory (this contains 64bit qt dll and udarkstyle.pas)
Apply darklazqt5/lazarus.pp.patch
Build Lazarus with qt5 widget type

contains only 64bit dll

jex

  • New Member
  • *
  • Posts: 31
Re: Lazarus Dark theme...
« Reply #17 on: February 28, 2022, 01:03:21 pm »
https://disk.yandex.ru/d/_LWZvwTJG0x7vw

Copy darklazqt5/lazarus to your lazarus directory (this contains 64bit qt dll and udarkstyle.pas)
Apply darklazqt5/lazarus.pp.patch
Build Lazarus with qt5 widget type

contains only 64bit dll

Perfect! Thank you so much for the help!
Got it working, looks great.

More info that might help others, I also used "Delphi IDE Theme Editor" tool and using "yggdrasil" theme.
What it means to "Apply lazarus.pp.patch" is that you need Git, copy the patch file to the lazarus installation folder and use CMD to get to the same folder and use "git apply lazarus.pp.patch" and that's it. Now launch lazarus normally. To get docked style IDE, I used these packages packages (from menu Packages Install/Uninstall packages): "AnchorDocking 1.0," "AnchorDockingDsgn 1.0" and "DockedFormEditor 0.0".

If you try to compile a project you may get an error if you don't have qt5 installed, you can use LCL by going to Project options > Config and targets > I chose win32 wigetset because I'm on Windows. --- Waiting for M$ implements an actual win32 GLOBAL dark theme  ::)

Hope this helps.
« Last Edit: March 01, 2022, 12:20:31 am by jex »

Frate

  • New Member
  • *
  • Posts: 30
Re: Lazarus Dark theme...
« Reply #18 on: April 05, 2022, 10:15:47 am »
Hi,

I'm trying to build lazarus v2.2.0 with qt5 following your advice.
Unfortunately I'm having this issue when trying to build:

Code: Text  [Select][+][-]
  1. glqtcontext.pas(25,57) Fatal: Can't find unit X used by GLQTContext

probably related to this https://gitlab.com/freepascal.org/lazarus/lazarus/-/issues/38969, but if so how were you able to build it?
Do I need another version of Lazarus?
Maybe works only on 32bit (downloading now to try)?

I appreciate any help

Update:
I'm able to build the 32 bit version but when running lazarus.exe i get a Qt5Network.dll not found. I'm now downloading Qt following this wiki https://wiki.freepascal.org/Qt5_Interface
« Last Edit: April 05, 2022, 10:59:05 am by Frate »

zamtmn

  • Sr. Member
  • ****
  • Posts: 494
Re: Lazarus Dark theme...
« Reply #19 on: April 05, 2022, 11:35:30 am »
LazOpenGLContext support only GLX, not true qt opengl control. this is old issue((

Only uninstall LazOpenGLContext((

Frate

  • New Member
  • *
  • Posts: 30
Re: Lazarus Dark theme...
« Reply #20 on: April 05, 2022, 01:35:59 pm »
Thanks zamtmn for your reply.

I was able to build and run the 32 bit version with qt.
Now I have to figure out how to enable dark mode in windows 11 (I've tested on a win 10 machine and works fine).

Frate

  • New Member
  • *
  • Posts: 30
Re: Lazarus Dark theme...
« Reply #21 on: April 05, 2022, 01:57:40 pm »
If build lazarus with qt5 for windows and using https://github.com/doublecmd/doublecmd/blob/master/src/platform/win/udarkstyle.pas you can get a dark theme

Well, using this defintely works! I think that on windows 11 os dark mode is not detected correctly (my guess).

For some reason opening the online package manager makes the IDE crash, but its a minor thing. I can easily install packages manually.

Thank you so much! Maybe one day we will have an out of the box solution.

LeoBruno

  • New Member
  • *
  • Posts: 47
Re: Lazarus Dark theme...
« Reply #22 on: July 03, 2022, 12:17:22 am »
Thank you guys!!

Specially zamtmn and jex.
Lazarus 2.2.2 FPC 3.2.2 Windows (qt5) Anchor Docking

LeoBruno

  • New Member
  • *
  • Posts: 47
Re: Lazarus Dark theme...
« Reply #23 on: July 16, 2022, 03:04:37 pm »
Can you provide the "yggdrasil" theme?

Couldn´t find it.
Lazarus 2.2.2 FPC 3.2.2 Windows (qt5) Anchor Docking

LeoBruno

  • New Member
  • *
  • Posts: 47
Re: Lazarus Dark theme...
« Reply #24 on: August 07, 2022, 10:52:02 pm »
Where can I find up to date dlls?
Is there a official repository for 64bit dlls?

https://disk.yandex.ru/d/_LWZvwTJG0x7vw

Copy darklazqt5/lazarus to your lazarus directory (this contains 64bit qt dll and udarkstyle.pas)
Apply darklazqt5/lazarus.pp.patch
Build Lazarus with qt5 widget type

contains only 64bit dll
Lazarus 2.2.2 FPC 3.2.2 Windows (qt5) Anchor Docking

madel

  • New Member
  • *
  • Posts: 12
Re: Lazarus Dark theme...
« Reply #25 on: August 14, 2022, 11:04:43 pm »
Does anyone know how to force qt5 dark mode on Windows 7 which doesn't have one unlike Win10 or 11 as qt5 simply follows the OS theme

madel

  • New Member
  • *
  • Posts: 12
Re: Lazarus Dark theme...
« Reply #26 on: August 15, 2022, 11:52:26 am »
Alright so I kinda found a way to force a specific style using qt5 widgets. Done by creating lazarus.exe shortcut (in taskbar or anywhere) and passing -style xxx, but so far only 'fusion' is working, does anyone know qt5 dark style names? I've looked but couldn't find anything.

Another possible way to force a style is by using stylesheets, by passing
Code: [Select]
-style default -stylesheet=path/to/style.qssexample: I put my style.qss in c:\lazarus\styles
Code: [Select]
-style default -stylesheet=styles/style.qss
But the problem with that is it doesn't match lazarus IDE, and I don't think any readily available stylesheet will since it probably must be made specifically for lazarus but I'm not sure and could be wrong but that's my experience.

EDIT: I found a way to get qt5 widget styles that are available on my system and only found ['windowsvista', 'windows', 'fusion'] so I guess I've got no option for a dark style. I might look more into it and I'll keep updating this comment with whatever I find hoping that it might help someone else moving the same path.

To find available widget styles:
Code: [Select]
python -c "from PyQt5.QtWidgets import QStyleFactory; print(QStyleFactory.keys())"from a command prompt, obviously needs python installed. I also have PyQt5 installed with pip. I'm not sure if its output is directly involved with lazarus qt5 styling or not.
« Last Edit: August 15, 2022, 12:54:40 pm by madel »

 

TinyPortal © 2005-2018