mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-11 12:19:26 +02:00
LCL-GTK3: Improve menu position and RadioItems. Issue #37740, patch from Anton Kavalenka.
git-svn-id: trunk@63896 -
This commit is contained in:
parent
f9814634a0
commit
2e27713e66
@ -1495,7 +1495,7 @@ begin
|
|||||||
|
|
||||||
Msg.SizeType := Msg.SizeType or Size_SourceIsInterface;
|
Msg.SizeType := Msg.SizeType or Size_SourceIsInterface;
|
||||||
|
|
||||||
if ACtl.WidgetType*[wtEntry,wtComboBox,wtScrollBar,wtSpinEdit]<>[] then
|
if ACtl.WidgetType*[wtEntry,wtComboBox,wtScrollBar,wtSpinEdit,wtHintWindow]<>[] then
|
||||||
begin
|
begin
|
||||||
Msg.Width := ACtl.LCLObject.Width;//Word(NewSize.cx);
|
Msg.Width := ACtl.LCLObject.Width;//Word(NewSize.cx);
|
||||||
Msg.Height := ACtl.LCLObject.Height;//Word(NewSize.cy);
|
Msg.Height := ACtl.LCLObject.Height;//Word(NewSize.cy);
|
||||||
@ -1512,7 +1512,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
ACtl.DeliverMessage(Msg);
|
ACtl.DeliverMessage(Msg);
|
||||||
|
|
||||||
if (wtWindow in ACtl.WidgetType) and
|
(* if (wtWindow in ACtl.WidgetType) and
|
||||||
((AGdkRect^.x <> ACtl.LCLObject.Left) or (AGdkRect^.y <> ACtl.LCLObject.Top)) then
|
((AGdkRect^.x <> ACtl.LCLObject.Left) or (AGdkRect^.y <> ACtl.LCLObject.Top)) then
|
||||||
begin
|
begin
|
||||||
FillChar(MoveMsg, SizeOf(MoveMsg), #0);
|
FillChar(MoveMsg, SizeOf(MoveMsg), #0);
|
||||||
@ -1524,7 +1524,7 @@ begin
|
|||||||
DebugLn('SEND MOVE MESSAGE X=',dbgs(AGdkRect^.x),' Y=',dbgs(AGdkRect^.y),' control ',dbgsName(ACtl.LCLObject));
|
DebugLn('SEND MOVE MESSAGE X=',dbgs(AGdkRect^.x),' Y=',dbgs(AGdkRect^.y),' control ',dbgsName(ACtl.LCLObject));
|
||||||
{$ENDIF}
|
{$ENDIF}
|
||||||
ACtl.DeliverMessage(MoveMsg);
|
ACtl.DeliverMessage(MoveMsg);
|
||||||
end;
|
end; *)
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function Gtk3ResizeEvent(AWidget: PGtkWidget; AEvent: PGdkEvent; Data: gpointer): gboolean; cdecl;
|
function Gtk3ResizeEvent(AWidget: PGtkWidget; AEvent: PGdkEvent; Data: gpointer): gboolean; cdecl;
|
||||||
@ -4622,17 +4622,21 @@ begin
|
|||||||
if (ndx>0) then
|
if (ndx>0) then
|
||||||
begin
|
begin
|
||||||
ParentMenu:=menuItem.Parent.Items[ndx-1];
|
ParentMenu:=menuItem.Parent.Items[ndx-1];
|
||||||
if (MenuItem.GroupIndex>0) and (ParentMenu.GroupIndex=MenuItem.GroupIndex) then
|
if (MenuItem.GroupIndex>=0) and (ParentMenu.GroupIndex=MenuItem.GroupIndex) then
|
||||||
begin
|
begin
|
||||||
pl:=PGtkRadioMenuItem(TGtk3MenuItem(ParentMenu.Handle).Widget)^.get_group;
|
pl:=PGtkRadioMenuItem(TGtk3MenuItem(ParentMenu.Handle).Widget)^.get_group;
|
||||||
PGtkRadioMenuItem(Result)^.set_group(pl);
|
PGtkRadioMenuItem(Result)^.set_group(pl);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
//PGtkRadioMenuItem(Result)^.set_active(MenuItem.Checked);
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if MenuItem.IsCheckItem and not MenuItem.HasIcon then
|
if MenuItem.IsCheckItem and not MenuItem.HasIcon then
|
||||||
Result := TGtkCheckMenuItem.new
|
begin
|
||||||
|
Result := TGtkCheckMenuItem.new;
|
||||||
|
PGtkCheckMenuItem(Result)^.set_active(MenuItem.Checked);
|
||||||
|
end
|
||||||
else
|
else
|
||||||
Result := TGtkMenuItem.new;
|
Result := TGtkMenuItem.new;
|
||||||
|
|
||||||
|
@ -116,7 +116,12 @@ begin
|
|||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
if Gtk3IsGdkWindow(AWidget.Widget^.window) then
|
if Gtk3IsGdkWindow(AWidget.Widget^.window) then
|
||||||
gdk_window_get_origin(AWidget.Widget^.window, @Pt.X, @Pt.Y)
|
begin
|
||||||
|
gdk_window_get_origin(AWidget.Widget^.window, @Pt.X, @Pt.Y);
|
||||||
|
gtk_widget_get_allocation(AWidget.Widget, @TempAlloc);
|
||||||
|
Pt.X += TempAlloc.x;
|
||||||
|
Pt.Y += TempAlloc.y;
|
||||||
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
gtk_widget_get_allocation(AWidget.Widget, @TempAlloc);
|
gtk_widget_get_allocation(AWidget.Widget, @TempAlloc);
|
||||||
|
Loading…
Reference in New Issue
Block a user