Skip to content

Commit

Permalink
If menu already showing, do not set menuLastPos.
Browse files Browse the repository at this point in the history
This resolves a following bug: sometimes, cursor from the
menu does not return to the original position.
  • Loading branch information
horacekj committed Nov 2, 2024
1 parent 5a75958 commit f97264a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/panel/Panel.pas
Original file line number Diff line number Diff line change
Expand Up @@ -1636,9 +1636,10 @@ procedure TRelief.ORSprEdit(Sender: string; parsed: TStrings);
// technologie posle nejake menu a my ho zobrazime:
procedure TRelief.ORShowMenu(items: string);
begin
Self.menuLastpos := Self.CursorDraw.Pos;
if (not Self.menu.showing) then
Self.menuLastpos := Self.CursorDraw.Pos;
Self.dkRootMenuItem := '';
Self.Menu.ShowMenu(items, -1, Self.DrawObject.ClientToScreen(Point(0, 0)));
Self.menu.ShowMenu(items, -1, Self.DrawObject.ClientToScreen(Point(0, 0)));
end;

procedure TRelief.ORDkShowMenu(Sender: string; rootItem, menuItems: string);
Expand Down

0 comments on commit f97264a

Please sign in to comment.