hydraveil-gui/gui/v2/presenters/state/arrow_sync_state.py

17 lines
704 B
Python

from core.infrastructure.state_management.global_state_controller import is_synced
from gui.v2.presenters.image_tools.arrow_presenters import apply_green_glow, apply_arrow_images
from PyQt6.QtWidgets import QPushButton
from typing import Callable
def apply_arrow_state(sync_required: bool, button: QPushButton, direction: str, button_path: str):
if not sync_required:
apply_arrow_images(button=button, button_path=button_path, direction=direction)
return
if is_synced():
apply_arrow_images(button=button, button_path=button_path, direction=direction)
return
apply_green_glow(button=button, direction=direction)