Recent

Author Topic: TrayIcon transparency  (Read 8453 times)

TrUsTeR

  • Newbie
  • Posts: 6
TrayIcon transparency
« on: April 12, 2009, 08:45:43 am »
Hi to all!

I use TrayIcon component, but there is no transparency on icon for linux/gtk2.
So I have these results:
There is no problem under win32 (icon is transparency).
I have no trayicon under win32/gtk2 at the same project.
And i have non-transparent icon (there is a white square at background) under Linux/gtk1 and Linux/gtk2.

Any ideas to fix this problem?

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: TrayIcon transparency
« Reply #1 on: May 16, 2009, 05:34:47 am »
Please make a bug report

TrUsTeR

  • Newbie
  • Posts: 6
Re: TrayIcon transparency
« Reply #2 on: November 06, 2009, 06:03:22 pm »
And i have non-transparent icon (there is a white square at background) under Linux/gtk1 and Linux/gtk2.
To solve this problem, rebuild Lazarus LCL with option -dUseStatusIcon, to use transparency in trayicon.

But after that i have no icon in tray at all. I spent some time with tests and learned that fEmbedded property in lcl/interfaces/gtk2/gtk2trayicon.inc is always False (in my case), when LCL compiled with UseStatusIcon option...
So i have wrote little workaround. Maybe it's not correct (I'm newbie in programming :)), but it works for me - icon in tray is transparent now. ;)
Code: [Select]
*** gtk2trayicon.inc 2009-04-19 06:59:22.000000000 +1300
--- gtk2trayicon.inc.1 2009-11-07 04:13:37.000000000 +1200
***************
*** 479,488 ****
--- 479,492 ----
    *  Now shows the GtkPlug
    *******************************************************************}
    TrayIconHandle.Show;
+ {$ifdef UseStatusIcon}
+   Result := True;
+ {$else}
    if TrayIconHandle.fEmbedded then
      Result := True
    else
      Hide(ATrayIcon);
+ {$endif}
  end;
  
  {*******************************************************************
« Last Edit: November 06, 2009, 06:06:59 pm by TrUsTeR »

robregonm

  • Newbie
  • Posts: 1
Re: TrayIcon transparency
« Reply #3 on: April 22, 2011, 02:33:08 am »
Amazing... 2 years later this patch is still valid. I applied it to Lazarus 0.9.30 in  Linux.
Thanks.

felipemdc

  • Administrator
  • Hero Member
  • *
  • Posts: 3538
Re: TrayIcon transparency
« Reply #4 on: April 22, 2011, 10:21:40 am »
I applied it a few days ago to Lazarus SVN

 

TinyPortal © 2005-2018