mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-03 22:40:30 +02:00
gtk2: playing around transparent GtkFixed (no window + eventbox) part2
git-svn-id: trunk@12934 -
This commit is contained in:
parent
7309af00e9
commit
447a1b0035
@ -3190,7 +3190,7 @@ procedure TGtkWidgetSet.SetCallbackEx(const AMsg: LongInt;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
gObject, gFixed, gCore, Adjustment: PGTKObject;
|
gObject, gFixed, gCore, gTemp, Adjustment: PGTKObject;
|
||||||
Info: PWidgetInfo;
|
Info: PWidgetInfo;
|
||||||
gMain: PGtkObject;
|
gMain: PGtkObject;
|
||||||
gMouse: PGtkObject;
|
gMouse: PGtkObject;
|
||||||
@ -3226,20 +3226,20 @@ begin
|
|||||||
else
|
else
|
||||||
gMouse := gCore;
|
gMouse := gCore;
|
||||||
|
|
||||||
{$ifdef gtk2}
|
|
||||||
if GTK_IS_FIXED(gMouse) and not gtk_fixed_get_has_window(PGtkFixed(gMouse)) then
|
|
||||||
begin
|
|
||||||
DebugLn(gtk_type_name(g_object_type(gFixed)) + ' => ' + gtk_type_name(g_object_type(gCore)));
|
|
||||||
gMouse := gCore;
|
|
||||||
end;
|
|
||||||
{$endif}
|
|
||||||
|
|
||||||
if gMouse=nil then
|
if gMouse=nil then
|
||||||
DebugLn(['TGtkWidgetSet.SetCallback WARNING: gMouseWidget=nil ',DbgSName(ALCLObject)]);
|
DebugLn(['TGtkWidgetSet.SetCallback WARNING: gMouseWidget=nil ',DbgSName(ALCLObject)]);
|
||||||
|
|
||||||
{$IFDEF GTK1}
|
{$IFDEF GTK1}
|
||||||
if ALCLObject is TCustomListBox then
|
if ALCLObject is TCustomListBox then
|
||||||
gMouse:=gMain;
|
gMouse:=gMain;
|
||||||
|
{$ELSE}
|
||||||
|
if GTK_IS_FIXED(gMouse) and not gtk_fixed_get_has_window(PGtkFixed(gMouse)) then
|
||||||
|
begin
|
||||||
|
gTemp := PGtkObject(gtk_widget_get_parent(PGtkWidget(gMouse)));
|
||||||
|
//DebugLn(gtk_type_name(g_object_type(gMouse)) + ' => ' + gtk_type_name(g_object_type(gTemp)));
|
||||||
|
if GTK_IS_EVENT_BOX(gTemp) then
|
||||||
|
gMouse := gTemp;
|
||||||
|
end;
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
end;
|
end;
|
||||||
//DebugLn(['TGtkWidgetSet.SetCallbackSmart MouseWidget=',GetWidgetDebugReport(PGtkWidget(gMouse))]);
|
//DebugLn(['TGtkWidgetSet.SetCallbackSmart MouseWidget=',GetWidgetDebugReport(PGtkWidget(gMouse))]);
|
||||||
@ -4669,8 +4669,18 @@ var
|
|||||||
TempWidget: PGtkWidget;
|
TempWidget: PGtkWidget;
|
||||||
WinWidgetInfo: PWinWidgetInfo;
|
WinWidgetInfo: PWinWidgetInfo;
|
||||||
begin
|
begin
|
||||||
|
{$ifdef gtk1}
|
||||||
|
{$undef GtkNoWindowFixed}
|
||||||
|
{$endif}
|
||||||
|
|
||||||
|
{$ifndef GtkNoWindowFixed}
|
||||||
Result := gtk_hbox_new(false, 0);
|
Result := gtk_hbox_new(false, 0);
|
||||||
TempWidget := CreateFixedClientWidget;
|
TempWidget := CreateFixedClientWidget;
|
||||||
|
{$else}
|
||||||
|
Result := gtk_event_box_new;
|
||||||
|
gtk_event_box_set_visible_window(PGtkEventBox(Result), False);
|
||||||
|
TempWidget := CreateFixedClientWidget(False);
|
||||||
|
{$endif}
|
||||||
gtk_container_add(GTK_CONTAINER(Result), TempWidget);
|
gtk_container_add(GTK_CONTAINER(Result), TempWidget);
|
||||||
gtk_widget_show(TempWidget);
|
gtk_widget_show(TempWidget);
|
||||||
if NotOnParentsClientArea then
|
if NotOnParentsClientArea then
|
||||||
|
Loading…
Reference in New Issue
Block a user