# Copyright (C) 2026 BoundWare LLC. All rights reserved.
# SnacTrac is licensed under the Apache License, Version 2.0
# See Licenses/LICENSE.txt for details.


from get_display_dimensions import *


# Place window at center of display.
def move_window_center(window):

    offset_x = -8

    offset_y = -40

    display_width, display_height = get_display_dimensions()

    display_width_center = display_width / 2

    display_height_center = display_height / 2

    window_width_center = window.size[0] / 2

    window_height_center = window.size[1] / 2

    window_position_x = round((display_width_center - window_width_center) + offset_x)

    window_position_y = round((display_height_center - window_height_center) + offset_y)

    window.move(window_position_x, window_position_y)
