# decompyle3 version 3.9.0
# Python bytecode version base 3.7.0 (3394)
# Decompiled from: Python 3.7.16 (default, Jan 17 2023, 09:28:58)
# [Clang 14.0.6 ]
# Embedded file name: output/Live/mac_universal_64_static/Release/python-bundle/MIDI Remote Scripts/Launchpad_MK2/SessionZoomingComponent.py
# Compiled at: 2023-11-21 10:21:18
# Size of source mod 2**32: 1188 bytes
from _Framework import SessionComponent
from _Framework.SessionZoomingComponent import SessionZoomingComponent as SessionZoomingComponentBase

from .ComponentUtils import skin_scroll_component


class SessionZoomingComponent(SessionZoomingComponentBase):
    def _enable_skinning(self):
        super()._enable_skinning()
        list(map(skin_scroll_component, (self._horizontal_scroll, self._vertical_scroll)))

    def register_component(self, component):
        self._sub_components.append(component)
        return component

    def on_enabled_changed(self):
        self.update()

    def set_enabled(self, enable):
        self._explicit_is_enabled = bool(enable)
        self._update_is_enabled()
        for component in self._sub_components:
            if not isinstance(component, SessionComponent):
                component._set_enabled_recursive(self.is_enabled())
