ui/cocoa: Fix pause label coordinates
A subview is positioned in the superview so the superview's frame should be used instead of one of the window to determine the coordinates. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> Tested-by: Rene Engel <ReneEngel80@emailn.de> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Message-ID: <20240224-cocoa-v12-5-e89f70bdda71@daynix.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
This commit is contained in:
parent
fcb03de7e1
commit
1a4b64a5f5
@ -1451,8 +1451,8 @@ static CGEventRef handleTapEvent(CGEventTapProxy proxy, CGEventType type, CGEven
|
||||
{
|
||||
/* Coordinates have to be calculated each time because the window can change its size */
|
||||
int xCoord, yCoord, width, height;
|
||||
xCoord = ([normalWindow frame].size.width - [pauseLabel frame].size.width)/2;
|
||||
yCoord = [normalWindow frame].size.height - [pauseLabel frame].size.height - ([pauseLabel frame].size.height * .5);
|
||||
xCoord = ([cocoaView frame].size.width - [pauseLabel frame].size.width)/2;
|
||||
yCoord = [cocoaView frame].size.height - [pauseLabel frame].size.height - ([pauseLabel frame].size.height * .5);
|
||||
width = [pauseLabel frame].size.width;
|
||||
height = [pauseLabel frame].size.height;
|
||||
[pauseLabel setFrame: NSMakeRect(xCoord, yCoord, width, height)];
|
||||
|
Loading…
Reference in New Issue
Block a user