Recent

Author Topic: TSplitter color property have no effect  (Read 2481 times)

backprop

  • Full Member
  • ***
  • Posts: 216
TSplitter color property have no effect
« on: March 10, 2026, 04:59:12 pm »
Due some darker interface, it would be nice to change the color of TSplitter between two dark panels, but changing color have no effect at all.

Latest Lazarus and FPC on latest Kubuntu (set to X11) and GTK2.

In added example, instead clMaroon what is set, splitter color is still default. I have set width to 10 pixels to emphasize problem, but with 1 pixel width in this case as well do not looks well with default color.
« Last Edit: March 10, 2026, 05:37:05 pm by backprop »

cdbc

  • Hero Member
  • *****
  • Posts: 2726
    • http://www.cdbc.dk
Re: TSplitter color property have no effect
« Reply #1 on: March 10, 2026, 05:32:13 pm »
Hi
If the splitter is drawn by GTK2 and not the LCL then it might require jumping through some hoops, to acquire the expected result...
Follow the code in the LCL into the widgetset implementation, then you can see where exactly it's implemented... (Ctrl + left-click on the methods)
Regards Benny
If it ain't broke, don't fix it ;)
PCLinuxOS(rolling release) 64bit -> KDE6/QT6 -> FPC Release -> Lazarus Release &  FPC Main -> Lazarus Main

zeljko

  • Hero Member
  • *****
  • Posts: 1906
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TSplitter color property have no effect
« Reply #2 on: March 10, 2026, 05:39:09 pm »
AFAIR, in gtk2 TSplitter is just an TCustomControl, probably needs SetColor call in gtk2ws... splitter unit.

Hansvb

  • Hero Member
  • *****
  • Posts: 901
Re: TSplitter color property have no effect
« Reply #3 on: March 10, 2026, 06:33:57 pm »
Hi,

My solution (or workaround) is to use panels see the attachment. The thin blue lines are splitters. These are on a panel. If you give the panel a color, the splitter takes over.

backprop

  • Full Member
  • ***
  • Posts: 216
Re: TSplitter color property have no effect
« Reply #4 on: March 10, 2026, 08:02:01 pm »
AFAIR, in gtk2 TSplitter is just an TCustomControl, probably needs SetColor call in gtk2ws... splitter unit.

Can you fix it for next release?

backprop

  • Full Member
  • ***
  • Posts: 216
Re: TSplitter color property have no effect
« Reply #5 on: March 10, 2026, 08:04:11 pm »
My solution (or workaround) is to use panels see the attachment. The thin blue lines are splitters. These are on a panel. If you give the panel a color, the splitter takes over.

I have already tried that, but it doesn't work here...

Hansvb

  • Hero Member
  • *****
  • Posts: 901
Re: TSplitter color property have no effect
« Reply #6 on: March 10, 2026, 08:25:10 pm »
This works for me. (Windows 11 Lazarus 4.4)

Edit: I have to read the question a bit more carefully but this also works with Lazarus on Ubuntu with qt5. (just tested)
« Last Edit: March 10, 2026, 08:48:05 pm by Hansvb »

zeljko

  • Hero Member
  • *****
  • Posts: 1906
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TSplitter color property have no effect
« Reply #7 on: March 10, 2026, 08:27:18 pm »
AFAIR, in gtk2 TSplitter is just an TCustomControl, probably needs SetColor call in gtk2ws... splitter unit.

Can you fix it for next release?
I'll try, probably gtk3 also needs same patch, pls open issue so it won't be forgotten.

backprop

  • Full Member
  • ***
  • Posts: 216
Re: TSplitter color property have no effect
« Reply #8 on: March 10, 2026, 08:43:28 pm »
I'll try, probably gtk3 also needs same patch, pls open issue so it won't be forgotten.

Be my guest to add it. I do not have bugtrucker account anymore for some 20+ years now. And as well, you will know better to formulate.
« Last Edit: March 10, 2026, 08:46:23 pm by backprop »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1225
Re: TSplitter color property have no effect
« Reply #9 on: March 12, 2026, 09:20:11 pm »
AFAIR, in gtk2 TSplitter is just an TCustomControl, probably needs SetColor call in gtk2ws... splitter unit.
Can you fix it for next release?
I'll try, probably gtk3 also needs same patch, pls open issue so it won't be forgotten.

Done:

Gtk3 - TSplitter color property has no effect
https://gitlab.com/freepascal.org/lazarus/lazarus/-/work_items/42111

 

TinyPortal © 2005-2018