tkfluent 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
tkflu/slider.py CHANGED
@@ -1,85 +1,75 @@
1
- from tkdeft.windows.draw import DSvgDraw
2
1
  from tkdeft.windows.canvas import DCanvas
2
+ from tkdeft.windows.draw import DSvgDraw
3
3
  from tkdeft.windows.drawwidget import DDrawWidget
4
4
 
5
5
  from .designs.slider import slider
6
6
 
7
7
 
8
8
  class FluSliderDraw(DSvgDraw):
9
- def create_slider(
9
+ def create_track(
10
10
  self,
11
- x1, y1, x2, y2,
12
- x3, # 滑块的x坐标
13
- r1, # 滑块外圆半径
14
- r2, # 滑块内圆半径
11
+ width, height, width2,
15
12
  temppath=None,
16
- fill="transparent", fill_opacity=1, # 滑块外圆的背景颜色、透明度
17
13
  radius=3, # 滑块进度条圆角大小
18
- outline="transparent", outline_opacity=1, # 滑块伪阴影的渐变色中的第一个渐变颜色、透明度
19
- outline2="transparent", outline2_opacity=1, # 滑块伪阴影的渐变色中的第二个渐变颜色、透明度
20
- inner_fill="transparent", inner_fill_opacity=1, # 滑块内圆的背景颜色、透明度
21
- track_fill="transparent", track_height=4, track_opacity=1, # 滑块进度条的选中部分矩形的背景颜色、高度、透明度
14
+ track_fill="transparent", track_opacity=1, # 滑块进度条的选中部分矩形的背景颜色、高度、透明度
22
15
  rail_fill="transparent", rail_opacity=1 #
23
16
  ):
24
- drawing = self.create_drawing(x2 - x1, y2 - y1, temppath=temppath, fill_opacity=0)
25
-
26
- border = drawing[1].linearGradient(start=(r1, 1), end=(r1, r1 * 2 - 1), id="DButton.Border",
27
- gradientUnits="userSpaceOnUse")
28
- border.add_stop_color(0.500208, outline, outline_opacity)
29
- border.add_stop_color(0.954545, outline2, outline2_opacity)
30
- drawing[1].defs.add(border)
31
- stroke = f"url(#{border.get_id()})"
32
- #print("x1:", x1, "\n", "y1:", y1, "\n", "x2:", x2, "\n", "y2:", y2, "\n", "r1:", r1, "\n", sep="")
33
-
34
- x = x1 + r1 - 4
35
- xx = x2 - r1 + 4
36
-
37
- #print("track_x1:", x, "\n", "track_x2:", xx, sep="")
38
-
39
- #print("")
17
+ drawing = self.create_drawing(width, height, temppath=temppath, fill_opacity=0)
40
18
 
41
19
  drawing[1].add(
42
20
  drawing[1].rect(
43
- (x, (y2 - y1) / 2 - track_height / 2),
44
- # 矩形x位置:画布最左的x坐标 + 滑块外半径 - 滑块内半径
45
- # 矩形y位置:画布高度(画布最上的y坐标 - 画布最上的y坐标)一半 - 进度条的高度的一半
46
- (xx - x, track_height),
47
- # 矩形宽度:画布最右的x坐标 - 滑块外半径 + 滑块内半径 | 矩形高度:进度条的高度
21
+ (0, 0), (width2, height),
48
22
  rx=radius,
49
- fill=rail_fill, fill_opacity=rail_opacity
23
+ fill=track_fill, fill_opacity=track_opacity, fill_rule="evenodd"
50
24
  )
51
- ) # 滑块进度未选中区域 (占全部)
25
+ ) # 滑块进度左边的选中区域 (只左部分)
52
26
 
53
27
  drawing[1].add(
54
28
  drawing[1].rect(
55
- (x, (y2 - y1) / 2 - track_height / 2),
56
- # 矩形x位置:画布最左的x坐标 + 滑块外半径 - 滑块内半径
57
- # 矩形y位置:画布高度(画布最上的y坐标 - 画布最上的y坐标)一半 - 进度条的高度的一半
58
- (x3 - x, track_height),
59
- # 矩形宽度:(滑块的x坐标 - 矩形x位置) | 矩形高度:进度条的高度
29
+ (width2, 0), (width-width2, height),
60
30
  rx=radius,
61
- fill=track_fill, fill_opacity=track_opacity, fill_rule="evenodd"
31
+ fill=rail_fill, fill_opacity=rail_opacity
62
32
  )
63
- ) # 滑块进度左边的选中区域 (只左部分)
33
+ ) # 滑块进度未选中区域 (占全部)
34
+
35
+ drawing[1].save()
36
+ return drawing[0]
37
+
38
+ def create_thumb(
39
+ self,
40
+ width, height,
41
+ r1, # 滑块外圆半径
42
+ r2, # 滑块内圆半径
43
+ temppath=None,
44
+ fill="transparent", fill_opacity=1, # 滑块外圆的背景颜色、透明度
45
+ outline="transparent", outline_opacity=1, # 滑块伪阴影的渐变色中的第一个渐变颜色、透明度
46
+ outline2="transparent", outline2_opacity=1, # 滑块伪阴影的渐变色中的第二个渐变颜色、透明度
47
+ inner_fill="transparent", inner_fill_opacity=1, # 滑块内圆的背景颜色、透明度
48
+ ):
49
+ drawing = self.create_drawing(width, height, temppath=temppath, fill_opacity=0)
64
50
 
65
- x = x3
66
- y = (y2 - y1) / 2
51
+ border = drawing[1].linearGradient(start=(r1, 1), end=(r1, r1 * 2 - 1), id="DButton.Border",
52
+ gradientUnits="userSpaceOnUse")
53
+ border.add_stop_color(0.500208, outline, outline_opacity)
54
+ border.add_stop_color(0.954545, outline2, outline2_opacity)
55
+ drawing[1].defs.add(border)
56
+ stroke = f"url(#{border.get_id()})"
67
57
 
68
58
  drawing[1].add(
69
59
  drawing[1].circle(
70
- (x, y), r1,
60
+ (width / 2, height / 2), r1,
71
61
  fill=stroke, fill_opacity=1, fill_rule="evenodd"
72
62
  )
73
63
  ) # 圆形滑块的伪阴影边框
74
64
  drawing[1].add(
75
65
  drawing[1].circle(
76
- (x, y), r1 - 1,
66
+ (width / 2, height / 2), r1 - 1,
77
67
  fill=fill, fill_opacity=fill_opacity, fill_rule="nonzero"
78
68
  )
79
69
  ) # 圆形滑块的外填充
80
70
  drawing[1].add(
81
71
  drawing[1].circle(
82
- (x, y), r2,
72
+ (width / 2, height / 2), r2,
83
73
  fill=inner_fill, fill_opacity=inner_fill_opacity, fill_rule="nonzero"
84
74
  )
85
75
  ) # 圆形滑块的内填充
@@ -90,23 +80,35 @@ class FluSliderDraw(DSvgDraw):
90
80
  class FluSliderCanvas(DCanvas):
91
81
  draw = FluSliderDraw
92
82
 
93
- def create_slider(self,
94
- x1, y1, x2, y2, x3, r1, r2, temppath=None,
95
- fill="transparent", fill_opacity=1, radius=3,
96
- outline="transparent", outline_opacity=1,
97
- outline2="transparent", outline2_opacity=1,
98
- inner_fill="transparent", inner_fill_opacity=1,
99
- track_fill="transparent", track_height=4, track_opacity=1,
100
- rail_fill="transparent", rail_opacity=1
101
- ):
102
- self._img = self.svgdraw.create_slider(
103
- x1, y1, x2, y2, x3, r1, r2, temppath=temppath,
104
- fill=fill, fill_opacity=fill_opacity, radius=radius,
83
+ def create_track(
84
+ self,
85
+ x1, y1, width, height, width2, temppath=None, radius=3,
86
+ track_fill="transparent", track_opacity=1,
87
+ rail_fill="transparent", rail_opacity=1
88
+ ):
89
+ self._img2 = self.svgdraw.create_track(
90
+ width, height, width2, temppath=temppath, radius=radius,
91
+ track_fill=track_fill, track_opacity=track_opacity,
92
+ rail_fill=rail_fill, rail_opacity=rail_opacity
93
+ )
94
+ self._tkimg2 = self.svgdraw.create_tksvg_image(self._img2)
95
+ #print(self._img2)
96
+ return self.create_image(x1, y1, anchor="nw", image=self._tkimg2)
97
+
98
+ def create_thumb(
99
+ self,
100
+ x1, y1, width, height, r1, r2, temppath=None,
101
+ fill="transparent", fill_opacity=1,
102
+ outline="transparent", outline_opacity=1,
103
+ outline2="transparent", outline2_opacity=1,
104
+ inner_fill="transparent", inner_fill_opacity=1,
105
+ ):
106
+ self._img = self.svgdraw.create_thumb(
107
+ width, height, r1, r2, temppath=temppath,
108
+ fill=fill, fill_opacity=fill_opacity,
105
109
  outline=outline, outline_opacity=outline_opacity,
106
110
  outline2=outline2, outline2_opacity=outline2_opacity,
107
111
  inner_fill=inner_fill, inner_fill_opacity=inner_fill_opacity,
108
- track_fill=track_fill, track_height=track_height, track_opacity=track_opacity,
109
- rail_fill=rail_fill, rail_opacity=rail_opacity
110
112
  )
111
113
  self._tkimg = self.svgdraw.create_tksvg_image(self._img)
112
114
  return self.create_image(x1, y1, anchor="nw", image=self._tkimg)
@@ -117,12 +119,15 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
117
119
  text="",
118
120
  width=70,
119
121
  height=28,
122
+ orient="horizontal",
123
+ tick=False, # 自动吸附
120
124
  font=None,
121
125
  mode="light",
122
126
  state="normal",
123
127
  value=20,
124
128
  max=100,
125
129
  min=0,
130
+ changed=None,
126
131
  **kwargs
127
132
  ):
128
133
 
@@ -146,13 +151,20 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
146
151
  state=state,
147
152
  value=value,
148
153
  max=max, min=min,
154
+ orient=orient, tick=tick, changed=changed,
149
155
  )
150
156
 
157
+
158
+
151
159
  super().__init__(*args, width=width, height=height, **kwargs)
152
160
 
153
161
  self.bind("<<Clicked>>", lambda event=None: self.focus_set(), add="+")
154
162
 
155
- self.bind("<Motion>", self._event_button1_motion)
163
+ #self.bind("<Left>", lambda event:print("asd1"))
164
+
165
+ self.bind("<B1-Motion>", self._event_button1_motion)
166
+
167
+ self.enter_thumb = False
156
168
 
157
169
  from .defs import set_default_font
158
170
  set_default_font(font, self.attributes)
@@ -164,6 +176,9 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
164
176
  {
165
177
  "command": None,
166
178
  "state": None,
179
+ "orient": "horizontal",
180
+ "tick": False,
181
+ "changed": None,
167
182
 
168
183
  "value": 20,
169
184
  "max": 100,
@@ -192,6 +207,11 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
192
207
 
193
208
  #print("")
194
209
 
210
+ if hasattr(self, "_e1"):
211
+ self.tag_unbind(self.element_track, "<Enter>", self._e1)
212
+ if hasattr(self, "_e2"):
213
+ self.tag_unbind(self.element_track, "<Leave>", self._e2)
214
+
195
215
  self.delete("all")
196
216
 
197
217
  state = self.dcget("state")
@@ -200,13 +220,16 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
200
220
 
201
221
  if state == "normal":
202
222
  if event:
203
- if self.enter:
204
- if self.button1:
205
- _dict = self.attributes.pressed
223
+ if self.enter: # 先检查是否在组件内
224
+ if self.enter_thumb: # 再检查是否在滑块上
225
+ if self.button1:
226
+ _dict = self.attributes.pressed
227
+ else:
228
+ _dict = self.attributes.hover
206
229
  else:
207
- _dict = self.attributes.hover
230
+ _dict = self.attributes.hover # 在组件内但不在滑块上
208
231
  else:
209
- _dict = self.attributes.rest
232
+ _dict = self.attributes.rest # 不在组件内
210
233
  else:
211
234
  _dict = self.attributes.rest
212
235
  else:
@@ -224,6 +247,8 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
224
247
  _thumb_radius = _dict.thumb.radius
225
248
  _thumb_inner_radius = _dict.thumb.inner_radius
226
249
 
250
+ _thumb_width = _dict.thumb.width
251
+
227
252
  _thumb_back_color = _dict.thumb.back_color
228
253
  _thumb_back_opacity = _dict.thumb.back_opacity
229
254
 
@@ -236,35 +261,91 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
236
261
  _thumb_inner_back_color = _dict.thumb.inner_back_color
237
262
  _thumb_inner_back_opacity = _dict.thumb.inner_back_opacity
238
263
 
239
- thumb_xp = self.attributes.value / (self.attributes.max - self.attributes.min) # 滑块对应数值的比例
240
- thumb_x = (self.winfo_width() - (_thumb_radius + 4) * 2) * thumb_xp # 滑块对应数值的x左边
241
-
242
- self.attributes["^r"] = _thumb_radius # 滑块进度条x坐标
243
- self.attributes["^x"] = _thumb_radius - 4 # 滑块进度条
244
- self.attributes["^xx"] = self.winfo_width() - _thumb_radius + 4
245
-
246
- self.element_thumb = self.create_slider(
247
- 0, 0, self.winfo_width(), self.winfo_height(), thumb_x, _thumb_radius, _thumb_inner_radius,
248
- temppath=self.temppath,
249
- fill=_thumb_back_color, fill_opacity=_thumb_back_opacity, radius=_radius,
250
- outline=_thumb_border_color, outline_opacity=_thumb_border_color_opacity,
251
- outline2=_thumb_border_color2, outline2_opacity=_thumb_border_color2_opacity,
252
- inner_fill=_thumb_inner_back_color, inner_fill_opacity=_thumb_inner_back_opacity,
253
- track_height=_track_height, track_fill=_track_back_color, track_opacity=_track_back_opacity,
254
- rail_fill=_rail_back_color, rail_opacity=_rail_back_opacity
255
- )
264
+ if self.attributes.orient == "horizontal":
265
+ thumb_xp = self.attributes.value / (self.attributes.max - self.attributes.min) # 滑块对应数值的比例
266
+ thumb_x = self.winfo_width() * thumb_xp # 滑块对应数值的x左边
267
+
268
+ width = self.winfo_width()
269
+ height = self.winfo_height()
270
+ # 修改滑块位置计算
271
+ thumb_width = _thumb_width
272
+ min_x = thumb_width / 2
273
+ max_x = self.winfo_width() - thumb_width / 2
274
+ track_length = max_x - min_x
275
+
276
+ # 计算轨道实际可用宽度(减去滑块宽度)
277
+ effective_track_width = self.winfo_width() - thumb_width
278
+
279
+ thumb_xp = (self.attributes.value - self.attributes.min) / (self.attributes.max - self.attributes.min)
280
+ thumb_center = thumb_width / 2 + thumb_xp * effective_track_width
281
+
282
+ thumb_width = _thumb_width
283
+ effective_width = self.winfo_width() - thumb_width
284
+ ratio = (self.attributes.value - self.attributes.min) / (self.attributes.max - self.attributes.min)
285
+ thumb_left = thumb_width / 2 + ratio * effective_width - thumb_width / 2
286
+
287
+ # 确保不会超出右边界
288
+ thumb_left = min(thumb_left, self.winfo_width() - thumb_width)
289
+
290
+ # 创建轨道时,width2 参数应为选中部分的宽度(滑块中心位置)
291
+ self.element_track = self.create_track(
292
+ _thumb_width / 4,
293
+ height / 2 - _track_height,
294
+ self.winfo_width() - _thumb_width / 2,
295
+ _track_height,
296
+ thumb_center - _thumb_width / 4, # 关键修正:使用滑块中心相对于轨道起点的距离
297
+ temppath=self.temppath, radius=_radius,
298
+ track_fill=_track_back_color, track_opacity=_track_back_opacity,
299
+ rail_fill=_rail_back_color, rail_opacity=_rail_back_opacity
300
+ )
301
+
302
+ self.element_thumb = self.create_thumb(
303
+ thumb_left, 0, # 直接使用计算出的左上角位置
304
+ thumb_width, thumb_width,
305
+ _thumb_radius, _thumb_inner_radius,
306
+ temppath=self.temppath2, fill=_thumb_back_color, fill_opacity=_thumb_back_opacity,
307
+ outline=_thumb_border_color, outline_opacity=_thumb_border_color_opacity,
308
+ outline2=_thumb_border_color2, outline2_opacity=_thumb_border_color2_opacity,
309
+ inner_fill=_thumb_inner_back_color, inner_fill_opacity=_thumb_inner_back_opacity,
310
+ )
311
+
312
+ self._e1 = self.tag_bind(self.element_thumb, "<Enter>", self._event_enter_thumb, add="+")
313
+ self._e2 = self.tag_bind(self.element_thumb, "<Leave>", self._event_leave_thumb, add="+")
256
314
 
257
315
  def pos(self, event):
258
- if self.enter:
259
- if self.button1:
260
- valuep = (event.x - self.attributes["^x"]) / (self.attributes["^xx"] - self.attributes["^x"]) # 数值的比例:(鼠标点击的x坐标 - 滑块进度条的x坐标) ÷ 滑块进度条的宽度
261
- value = (event.x - self.attributes["max"] - self.attributes["min"]) # 数值的比例 × 数值范围(最大数值 - 最小数值)
262
- value = ((event.x + self.attributes["^r"]) / (self.winfo_width())) * self.attributes.max
263
- self.dconfigure(
264
- value=value
265
- )
266
- #print("value:", value, sep="")
267
- #print("")
316
+ if self.attributes.state == "normal":
317
+ #print(event.x, event.y)
318
+ #if self.enter and self.button1:
319
+ # 获取滑块宽度
320
+ thumb_width = self.attributes.pressed.thumb.width
321
+
322
+ # 计算有效轨道长度
323
+ effective_width = self.winfo_width() - thumb_width
324
+
325
+ # 计算滑块位置比例(考虑滑块宽度边界)
326
+ ratio = (event.x - thumb_width/2) / effective_width
327
+ ratio = max(0, min(1, ratio)) # 限制在0-1范围内
328
+
329
+ # 计算实际值
330
+ value = self.attributes.min + ratio * (self.attributes.max - self.attributes.min)
331
+ if self.attributes.tick:
332
+ value = round(value)
333
+ self.dconfigure(value=value)
334
+ self._draw()
335
+ #print(self.focus_get())
336
+
337
+ def _event_off_button1(self, event=None):
338
+ if self.attributes.state == "normal":
339
+ if self.attributes.changed:
340
+ self.attributes.changed()
341
+
342
+
343
+ def _event_enter_thumb(self, event=None):
344
+ self.enter_thumb = True
345
+ self.update()
346
+
347
+ def _event_leave_thumb(self, event=None):
348
+ self.enter_thumb = False
268
349
 
269
350
  def _event_button1_motion(self, event):
270
351
  self.pos(event)
@@ -293,6 +374,8 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
293
374
  "radius": r["thumb"]["radius"],
294
375
  "inner_radius": r["thumb"]["inner_radius"],
295
376
 
377
+ "width": r["thumb"]["width"],
378
+
296
379
  "back_color": r["thumb"]["back_color"],
297
380
  "back_opacity": r["thumb"]["back_opacity"],
298
381
 
@@ -320,6 +403,8 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
320
403
  "radius": h["thumb"]["radius"],
321
404
  "inner_radius": h["thumb"]["inner_radius"],
322
405
 
406
+ "width": r["thumb"]["width"],
407
+
323
408
  "back_color": h["thumb"]["back_color"],
324
409
  "back_opacity": h["thumb"]["back_opacity"],
325
410
 
@@ -347,6 +432,8 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
347
432
  "radius": p["thumb"]["radius"],
348
433
  "inner_radius": p["thumb"]["inner_radius"],
349
434
 
435
+ "width": r["thumb"]["width"],
436
+
350
437
  "back_color": p["thumb"]["back_color"],
351
438
  "back_opacity": p["thumb"]["back_opacity"],
352
439
 
@@ -374,6 +461,8 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
374
461
  "radius": d["thumb"]["radius"],
375
462
  "inner_radius": d["thumb"]["inner_radius"],
376
463
 
464
+ "width": r["thumb"]["width"],
465
+
377
466
  "back_color": d["thumb"]["back_color"],
378
467
  "back_opacity": d["thumb"]["back_opacity"],
379
468
 
tkflu/text.py CHANGED
@@ -195,14 +195,7 @@ class FluText(FluTextCanvas, DDrawWidget, FluToolTipBase):
195
195
  )
196
196
  self.itemconfigure(self.element_line, width=_underline_width, fill=_underline_fill)
197
197
  """
198
- if hasattr(self, "element_line"):
199
- self.delete(self.element_line)
200
- if _underline_fill:
201
- self.element_line = self.create_line(
202
- _radius / 3 + _border_width, self.winfo_height() - _radius / 3,
203
- self.winfo_width() - _radius / 3 - _border_width * 2, self.winfo_height() - _radius / 3,
204
- width=_underline_width, fill=_underline_fill
205
- )
198
+
206
199
  """
207
200
  if not hasattr(self, "element_text"):
208
201
  self.element_text = self.create_window(
@@ -223,8 +216,16 @@ class FluText(FluTextCanvas, DDrawWidget, FluToolTipBase):
223
216
  width=self.winfo_width() - _border_width * 2 - _radius,
224
217
  height=self.winfo_height() - _border_width * 2 - _radius
225
218
  )
219
+ if hasattr(self, "element_line"):
220
+ self.delete(self.element_line)
221
+ if _underline_fill:
222
+ self.element_line = self.create_line(
223
+ _radius / 3 + _border_width, self.winfo_height() - _radius / 3,
224
+ self.winfo_width() - _radius / 3 - _border_width * 2, self.winfo_height() - _radius / 3,
225
+ width=_underline_width, fill=_underline_fill
226
+ )
226
227
  self.tag_raise(self.element_text, self.element_border)
227
- self.tag_raise(self.element_line, self.element_border)
228
+ #self.tag_raise(self.element_line, self.element_text)
228
229
 
229
230
  #self.tag_raise(self.element_text)
230
231
 
tkflu/thememanager.py CHANGED
@@ -11,17 +11,18 @@ class FluThemeManager(object):
11
11
  from tkinter import _default_root
12
12
  self._window = _default_root
13
13
  self._mode = mode
14
- self.mode(self._mode)
15
- self._window.after(delay, lambda: self.mode(self._mode))
14
+ #self.mode(self._mode)
15
+ #self._window.after(delay, lambda: self.mode(self._mode))
16
16
 
17
- def mode(self, mode: str, delay: Union[int, None] = 50):
18
- def _():
17
+ def mode(self, mode: str, delay: Union[int, None] = None):
18
+ def update_window():
19
19
  self._mode = mode
20
20
  if hasattr(self._window, "theme"):
21
21
  self._window.theme(mode=mode)
22
22
  if hasattr(self._window, "_draw"):
23
23
  self._window._draw()
24
24
  self._window.update()
25
+ def update_children():
25
26
  for widget in self._window.winfo_children():
26
27
  if hasattr(widget, "theme"):
27
28
  widget.theme(mode=mode)
@@ -30,19 +31,18 @@ class FluThemeManager(object):
30
31
  if hasattr(widget, "update_children"):
31
32
  widget.update_children()
32
33
  #widget.update()
33
- if not delay == 0:
34
- self._window.after(delay, _)
35
- else:
36
- _()
37
- def __():
34
+ update_window()
35
+ update_children()
36
+
37
+ def update_children2():
38
38
  for widget in self._window.winfo_children():
39
39
  if hasattr(widget, "_draw"):
40
40
  widget._draw()
41
41
  if hasattr(widget, "update_children"):
42
42
  widget.update_children()
43
43
  widget.update()
44
- #print(len(self._window.winfo_children()))
45
- self._window.after(delay+len(self._window.winfo_children()), __)
44
+
45
+ #self._window.after(len(self._window.winfo_children())*50, update_children2)
46
46
 
47
47
  def toggle(self, delay: Union[int, None] = None):
48
48
  if self._mode == "light":