mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-06-24 06:48:32 +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
|
interface
|
||||||
|
|
||||||
uses
|
uses
|
||||||
Graphics, Classes, ExtCtrls, SysUtils, Forms, Controls, Dialogs,
|
Graphics, Classes, ExtCtrls, SysUtils, Forms, Controls, Dialogs, Menus,
|
||||||
Menus, WSCommonTrayIcon, x, xlib, xutil, gtk2, gdk2, gdk2x, glib2, gtkdef;
|
WSCommonTrayIcon, x, xlib, xutil, gtk2, gdk2, gdk2x, glib2, gtkdef, gtkproc;
|
||||||
|
|
||||||
type
|
type
|
||||||
|
|
||||||
@ -322,6 +322,7 @@ end;
|
|||||||
procedure TWidgetTrayIcon.CreateForm(id: Integer);
|
procedure TWidgetTrayIcon.CreateForm(id: Integer);
|
||||||
var
|
var
|
||||||
AImage: PGtkWidget;
|
AImage: PGtkWidget;
|
||||||
|
AMask: PGdkBitmap;
|
||||||
GDIObject: PgdiObject;
|
GDIObject: PgdiObject;
|
||||||
begin
|
begin
|
||||||
{*******************************************************************
|
{*******************************************************************
|
||||||
@ -362,8 +363,15 @@ begin
|
|||||||
|
|
||||||
GDIObject := PgdiObject(Icon.Handle);
|
GDIObject := PgdiObject(Icon.Handle);
|
||||||
|
|
||||||
AImage := gtk_image_new_from_pixmap(GDIObject^.GDIPixmapObject,
|
GDIObject := PgdiObject(Icon.Handle);
|
||||||
GDIObject^.GDIBitmapMaskObject);
|
|
||||||
|
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);
|
gtk_widget_show(AImage);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user