mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-04-16 23:49:28 +02:00
gtk: also use TPopupMenu.IsRightToLeft to determine the popup position
git-svn-id: trunk@22737 -
This commit is contained in:
parent
58c78a36ab
commit
de89e6efe0
@ -2475,8 +2475,8 @@ customise by choosing various menu items. <var>TPopupMenu</var> is a menu window
|
||||
<short>
|
||||
<var>TPopupAlignment</var> - enumerated type to describe the position of popup menu relative to the popup coordinate</short>
|
||||
<descr>
|
||||
<pre>paLeft - open popup menu left of the popup corrdinate
|
||||
paRight - open popup menu right of popup corrdinate
|
||||
<pre>paLeft - position popup menu so it left corner is at the popup coordinate
|
||||
paRight - position popup menu menu so it right corner is at the popup corrdinate
|
||||
paCenter - center popup menu around popup corrdinate
|
||||
</pre>
|
||||
</descr>
|
||||
|
@ -367,13 +367,25 @@ procedure GtkWS_Popup(menu: PGtkMenu; X, Y: pgint;
|
||||
WidgetInfo: PWidgetInfo); cdecl;
|
||||
var
|
||||
Requisition: TGtkRequisition;
|
||||
Alignment: TPopupAlignment;
|
||||
begin
|
||||
X^ := PPoint(WidgetInfo^.UserData)^.X;
|
||||
Y^ := PPoint(WidgetInfo^.UserData)^.Y;
|
||||
|
||||
if WidgetInfo^.LCLObject is TPopupMenu then
|
||||
begin
|
||||
case TPopupMenu(WidgetInfo^.LCLObject).Alignment of
|
||||
// get actual alignment
|
||||
Alignment := TPopupMenu(WidgetInfo^.LCLObject).Alignment;
|
||||
if TPopupMenu(WidgetInfo^.LCLObject).IsRightToLeft then
|
||||
begin
|
||||
if Alignment = paLeft then
|
||||
Alignment := paRight
|
||||
else
|
||||
if Alignment = paRight then
|
||||
Alignment := paLeft;
|
||||
end;
|
||||
|
||||
case Alignment of
|
||||
paCenter:
|
||||
begin
|
||||
gtk_widget_size_request(PGtkWidget(menu), @Requisition);
|
||||
|
Loading…
Reference in New Issue
Block a user