mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 01:39:25 +02:00
Qt: fix TPopupMenu.Alignment when we use RightToLeft.
git-svn-id: trunk@22740 -
This commit is contained in:
parent
756c8f3da5
commit
9cf4e736f0
@ -404,6 +404,7 @@ class procedure TQtWSPopupMenu.Popup(const APopupMenu: TPopupMenu; const X, Y: i
|
|||||||
var
|
var
|
||||||
Point: TQtPoint;
|
Point: TQtPoint;
|
||||||
Size: TSize;
|
Size: TSize;
|
||||||
|
Alignment: TPopupAlignment;
|
||||||
begin
|
begin
|
||||||
{$ifdef VerboseQt}
|
{$ifdef VerboseQt}
|
||||||
WriteLn('[TQtWSPopupMenu.Popup] APopupMenu.Handle ' + dbghex(APopupMenu.Handle)
|
WriteLn('[TQtWSPopupMenu.Popup] APopupMenu.Handle ' + dbghex(APopupMenu.Handle)
|
||||||
@ -414,7 +415,18 @@ begin
|
|||||||
|
|
||||||
Point.X := X;
|
Point.X := X;
|
||||||
Point.Y := Y;
|
Point.Y := Y;
|
||||||
case APopupMenu.Alignment of
|
Alignment := APopupMenu.Alignment;
|
||||||
|
|
||||||
|
if APopupMenu.IsRightToLeft then
|
||||||
|
begin
|
||||||
|
if Alignment = paLeft then
|
||||||
|
Alignment := paRight
|
||||||
|
else
|
||||||
|
if Alignment = paRight then
|
||||||
|
Alignment := paLeft;
|
||||||
|
end;
|
||||||
|
|
||||||
|
case Alignment of
|
||||||
paCenter:
|
paCenter:
|
||||||
begin
|
begin
|
||||||
QMenu_sizeHint(QMenuH(TQtMenu(APopupMenu.Handle).Widget), @Size);
|
QMenu_sizeHint(QMenuH(TQtMenu(APopupMenu.Handle).Widget), @Size);
|
||||||
|
Loading…
Reference in New Issue
Block a user