mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-05 15:57:18 +01:00
gtk: use GtkFrame isntead of GtkViewPort for gtk1 TPanel implementation widget
git-svn-id: trunk@19715 -
This commit is contained in:
parent
f3bff5ed70
commit
e43c119502
@ -4777,7 +4777,7 @@ begin
|
||||
if Handle = 0 then Exit;
|
||||
ARect.Left := 0;
|
||||
ARect.Top := 0;
|
||||
Widget := pgtkwidget(Handle);
|
||||
Widget := PGtkWidget(Handle);
|
||||
ClientWidget := GetFixedWidget(Widget);
|
||||
if (ClientWidget <> nil) then
|
||||
Widget := ClientWidget;
|
||||
|
||||
@ -611,16 +611,17 @@ var
|
||||
Widget: PGtkWidget;
|
||||
WidgetInfo: PWidgetInfo;
|
||||
TempWidget: PGtkWidget; // pointer to gtk-widget (local use when neccessary)
|
||||
Allocation: TGTKAllocation;
|
||||
begin
|
||||
// TPanel control is a area with frame around. Area can have its own color
|
||||
|
||||
// To implement that in gtk we need:
|
||||
// 1. GtkViewport to draw frame around area
|
||||
// 1. GtkFrame to draw frame around area
|
||||
// 2. GtkFixed to plaace controls and draw color area
|
||||
|
||||
Widget := gtk_viewport_new(nil, nil);
|
||||
Widget := gtk_frame_new(nil);
|
||||
WidgetInfo := CreateWidgetInfo(Widget, AWinControl, AParams);
|
||||
gtk_viewport_set_shadow_type(PGtkViewport(Widget), BorderStyleShadowMap[TCustomPanel(AWinControl).BorderStyle]);
|
||||
gtk_frame_set_shadow_type(PGtkFrame(Widget), BorderStyleShadowMap[TCustomPanel(AWinControl).BorderStyle]);
|
||||
TempWidget := CreateFixedClientWidget;
|
||||
gtk_container_add(GTK_CONTAINER(Widget), TempWidget);
|
||||
gtk_widget_show(TempWidget);
|
||||
@ -631,6 +632,13 @@ begin
|
||||
{$IFDEF DebugLCLComponents}
|
||||
DebugGtkWidgets.MarkCreated(Widget, dbgsName(AWinControl));
|
||||
{$ENDIF}
|
||||
// set allocation
|
||||
Allocation.X := AParams.X;
|
||||
Allocation.Y := AParams.Y;
|
||||
Allocation.Width := AParams.Width;
|
||||
Allocation.Height := AParams.Height;
|
||||
gtk_widget_size_allocate(Widget, @Allocation);
|
||||
|
||||
Result := TLCLIntfHandle(PtrUInt(Widget));
|
||||
Set_RC_Name(AWinControl, Widget);
|
||||
SetCallBacks(Widget, WidgetInfo);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user