def move_close_to_menubar(obj):
    """Move widgets which are closer to menubar up or down.

    The orientation (up or down) is chosen according to the
    position of the first widget. The widgets were chosen
    arbitrarily, taking into account what would look better.

    obj (obj containing widgets as attributes)
    """
    menubar_rect = obj.menubar.rect

    if SCREEN_RECT.contains(menubar_rect):
        obj.separator.rect.topleft = menubar_rect.bottomleft

    else:
        obj.separator.rect.bottomleft = menubar_rect.bottomleft

    for switch in obj.switches:
        switch.snap_switch_to_widget()
Move widgets which are closer to menubar up or down.

    The orientation (up or down) is chosen according to the
    position of the first widget. The widgets were chosen
    arbitrarily, taking into account what would look better.

    obj (obj containing widgets as attributes)
    
nodezator/winman/switch.py