mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-04 04:18:25 +02:00
Fixed TrayIcon to work with the new image model.
git-svn-id: trunk@11905 -
This commit is contained in:
parent
d78802c30f
commit
bbe8152aa2
@ -29,8 +29,8 @@ unit WSGtk2TrayIcon;
|
||||
interface
|
||||
|
||||
uses
|
||||
Graphics, Classes, ExtCtrls, SysUtils, Forms, Controls, Dialogs,
|
||||
Menus, WSCommonTrayIcon, x, xlib, xutil, gtk2, gdk2, gdk2x, glib2, gtkdef;
|
||||
Graphics, Classes, ExtCtrls, SysUtils, Forms, Controls, Dialogs, Menus,
|
||||
WSCommonTrayIcon, x, xlib, xutil, gtk2, gdk2, gdk2x, glib2, gtkdef, gtkproc;
|
||||
|
||||
type
|
||||
|
||||
@ -322,6 +322,7 @@ end;
|
||||
procedure TWidgetTrayIcon.CreateForm(id: Integer);
|
||||
var
|
||||
AImage: PGtkWidget;
|
||||
AMask: PGdkBitmap;
|
||||
GDIObject: PgdiObject;
|
||||
begin
|
||||
{*******************************************************************
|
||||
@ -362,8 +363,15 @@ begin
|
||||
|
||||
GDIObject := PgdiObject(Icon.Handle);
|
||||
|
||||
AImage := gtk_image_new_from_pixmap(GDIObject^.GDIPixmapObject,
|
||||
GDIObject^.GDIBitmapMaskObject);
|
||||
GDIObject := PgdiObject(Icon.Handle);
|
||||
|
||||
AMask := CreateGdkMaskBitmap(
|
||||
GDIObject^.GDIPixmapObject.Mask,
|
||||
GDIObject^.GDIBitmapObject);
|
||||
|
||||
AImage := gtk_image_new_from_pixmap(GDIObject^.GDIPixmapObject.Image, AMask);
|
||||
|
||||
g_object_unref(AMask);
|
||||
|
||||
gtk_widget_show(AImage);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user