From e54a426f3a4f2397f1841fbd9c7c0fdb7232fe32 Mon Sep 17 00:00:00 2001 From: Pozitronik Date: Thu, 7 Nov 2024 20:08:28 +0400 Subject: [PATCH] Restore inheritance from CTkSlider --- .../controls/FramePosition/SliderFramePosition.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sinner/gui/controls/FramePosition/SliderFramePosition.py b/sinner/gui/controls/FramePosition/SliderFramePosition.py index d89bd0a0..625265d5 100644 --- a/sinner/gui/controls/FramePosition/SliderFramePosition.py +++ b/sinner/gui/controls/FramePosition/SliderFramePosition.py @@ -1,12 +1,12 @@ from tkinter import Label, StringVar, Frame, X, TOP, NW, DISABLED, NORMAL, IntVar, Misc from typing import Union, Callable, Any, Dict +from customtkinter import CTkSlider from sinner.gui.controls.FramePosition.BaseFramePosition import BaseFramePosition -from sinner.gui.controls.FramePosition.SliderWithProgress import SliderWithProgress -class SliderFramePosition(BaseFramePosition, SliderWithProgress): +class SliderFramePosition(BaseFramePosition, CTkSlider): _container: Frame _position_label: Label _current_position: StringVar @@ -16,13 +16,13 @@ def __init__(self, master: Misc | None, **kwargs): # type: ignore[no-untyped-de self._container = Frame(master, borderwidth=2) self._current_position = StringVar() self._position_label = Label(master) - SliderWithProgress.__init__(self, self._container, **kwargs) + CTkSlider.__init__(self, self._container, **kwargs) self._position_label.configure(textvariable=self._current_position) self.update_position() def pack(self, **kwargs: Dict[str, Any]) -> Any: self._container.pack(fill=X) - result = SliderWithProgress.pack(self, **kwargs) + result = CTkSlider.pack(self, **kwargs) self._position_label.pack(anchor=NW, side=TOP, expand=False, fill=X, after=self) return result @@ -30,7 +30,7 @@ def pack_forget(self) -> Any: self._container.pack_forget() def _clicked(self, event: Any | None = None) -> None: - SliderWithProgress._clicked(self, event) + CTkSlider._clicked(self, event) self.update_position() def set(self, output_value: int, from_variable_callback: bool = False) -> None: @@ -86,7 +86,7 @@ def container(self) -> Frame: return self._container def disable(self) -> None: - SliderWithProgress.configure(self, True, state=DISABLED) + CTkSlider.configure(self, True, state=DISABLED) def enable(self) -> None: - SliderWithProgress.configure(self, True, state=NORMAL) + CTkSlider.configure(self, True, state=NORMAL)