"""Utility mixin for restoring default slider values."""

from __future__ import annotations


class ResetMixin:
    def reset_sliders(self):
        self.hue_min.set(self.DEFAULTS["hue_min"])
        self.hue_max.set(self.DEFAULTS["hue_max"])
        self.sat_min.set(self.DEFAULTS["sat_min"])
        self.val_min.set(self.DEFAULTS["val_min"])
        self.val_max.set(self.DEFAULTS["val_max"])
        self.alpha.set(self.DEFAULTS["alpha"])
        self.update_preview()
        default_text = getattr(self, "status_default_text", None)
        if default_text is None:
            default_text = self._t("status.defaults_restored") if hasattr(self, "_t") else "Defaults restored."
        if hasattr(self, "status"):
            self.status.config(text=default_text)


__all__ = ["ResetMixin"]
