tkfluent 0.0.8__py3-none-any.whl → 0.0.9__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/__init__.py +1 -1
- tkflu/__main__.py +8 -2
- tkflu/badge.py +4 -1
- tkflu/button.py +3 -3
- tkflu/bwm.py +2 -0
- tkflu/constants.py +5 -0
- tkflu/demos/__init__.py +1 -0
- tkflu/demos/acrylic1.py +18 -0
- tkflu/demos/tooltip.py +13 -0
- tkflu/designs/tooltip.py +15 -0
- tkflu/entry.py +4 -1
- tkflu/label.py +2 -1
- tkflu/menu.py +2 -1
- tkflu/popupwindow.py +6 -4
- tkflu/slider.py +7 -7
- tkflu/text.py +4 -1
- tkflu/thememanager.py +20 -15
- tkflu/togglebutton.py +4 -1
- tkflu/tooltip.py +146 -3
- tkflu/window.py +14 -10
- tkfluent-0.0.9.dist-info/METADATA +82 -0
- {tkfluent-0.0.8.dist-info → tkfluent-0.0.9.dist-info}/RECORD +23 -19
- tkfluent-0.0.8.dist-info/METADATA +0 -29
- {tkfluent-0.0.8.dist-info → tkfluent-0.0.9.dist-info}/WHEEL +0 -0
tkflu/__init__.py
CHANGED
@@ -24,7 +24,7 @@ from .slider import FluSlider
|
|
24
24
|
from .text import FluText
|
25
25
|
from .thememanager import FluThemeManager
|
26
26
|
from .togglebutton import FluToggleButton
|
27
|
-
from .tooltip import FluToolTip
|
27
|
+
from .tooltip import FluToolTip, FluToolTip2, FluToolTipBase
|
28
28
|
from .toplevel import FluToplevel
|
29
29
|
from .window import FluWindow
|
30
30
|
|
tkflu/__main__.py
CHANGED
@@ -2,8 +2,6 @@ from tkflu import *
|
|
2
2
|
from tkinter import *
|
3
3
|
from tkinter.font import *
|
4
4
|
|
5
|
-
from tkflu.listbox import FluListBox
|
6
|
-
|
7
5
|
blue_primary_color()
|
8
6
|
|
9
7
|
def togglestate():
|
@@ -69,6 +67,14 @@ badge1.pack(padx=5, pady=5)
|
|
69
67
|
badge2 = FluBadge(frame, text="FluBadge (Accent)", width=120, style="accent")
|
70
68
|
badge2.pack(padx=5, pady=5)
|
71
69
|
|
70
|
+
label1 = FluLabel(frame, text="FluLabel(Hover Me)")
|
71
|
+
label1.tooltip(text="FluToolTip")
|
72
|
+
label1.pack(padx=5, pady=5)
|
73
|
+
|
74
|
+
label2 = FluLabel(frame, text="FluLabel2(Hover Me)")
|
75
|
+
label2.tooltip(text="FluToolTip2", way=1)
|
76
|
+
label2.pack(padx=5, pady=5)
|
77
|
+
|
72
78
|
button1 = FluButton(
|
73
79
|
frame, text="FluButton", command=lambda: print("FluButton -> Clicked")
|
74
80
|
)
|
tkflu/badge.py
CHANGED
@@ -51,7 +51,10 @@ class FluBadgeCanvas(DCanvas):
|
|
51
51
|
create_roundrect = create_round_rectangle
|
52
52
|
|
53
53
|
|
54
|
-
|
54
|
+
from .tooltip import FluToolTipBase
|
55
|
+
|
56
|
+
|
57
|
+
class FluBadge(FluBadgeCanvas, DDrawWidget, FluToolTipBase):
|
55
58
|
|
56
59
|
def __init__(self, *args,
|
57
60
|
text="",
|
tkflu/button.py
CHANGED
@@ -62,9 +62,9 @@ class FluButtonCanvas(DCanvas):
|
|
62
62
|
|
63
63
|
|
64
64
|
from .constants import MODE, STATE, BUTTONSTYLE
|
65
|
+
from .tooltip import FluToolTipBase
|
65
66
|
|
66
|
-
|
67
|
-
class FluButton(FluButtonCanvas, DDrawWidget):
|
67
|
+
class FluButton(FluButtonCanvas, DDrawWidget, FluToolTipBase):
|
68
68
|
def __init__(self, *args,
|
69
69
|
text="",
|
70
70
|
width=120,
|
@@ -98,7 +98,7 @@ class FluButton(FluButtonCanvas, DDrawWidget):
|
|
98
98
|
from .defs import set_default_font
|
99
99
|
set_default_font(font, self.attributes)
|
100
100
|
|
101
|
-
def _init(self, mode: MODE, style:
|
101
|
+
def _init(self, mode: MODE, style: BUTTONSTYLE):
|
102
102
|
|
103
103
|
from easydict import EasyDict
|
104
104
|
|
tkflu/bwm.py
CHANGED
@@ -126,6 +126,8 @@ class BWm(object):
|
|
126
126
|
def _theme(self, mode):
|
127
127
|
from .designs.window import window
|
128
128
|
n = window(mode)
|
129
|
+
"""if self.attributes.back_color is not None:
|
130
|
+
n["back_color"] = self.attributes.back_color"""
|
129
131
|
self.dconfigure(
|
130
132
|
back_color=n["back_color"],
|
131
133
|
text_color=n["text_color"],
|
tkflu/constants.py
CHANGED
tkflu/demos/__init__.py
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
# 这里没什么好东西,请不要在项目中导入,可以自行查看该文件夹中其他demo
|
tkflu/demos/acrylic1.py
ADDED
@@ -0,0 +1,18 @@
|
|
1
|
+
from tkflu import *
|
2
|
+
from pywinstyles import *
|
3
|
+
|
4
|
+
|
5
|
+
root = FluWindow()
|
6
|
+
|
7
|
+
thememanager = FluThemeManager()
|
8
|
+
thememanager.mode("dark")
|
9
|
+
|
10
|
+
root.dconfigure(back_color="#000000")
|
11
|
+
|
12
|
+
btn1 = FluButton(root, text="Normal", command=lambda: apply_style(root, "normal"))
|
13
|
+
btn1.pack(padx=5, pady=5)
|
14
|
+
|
15
|
+
btn2 = FluButton(root, text="Acrylic", command=lambda: apply_style(root, "acrylic"))
|
16
|
+
btn2.pack(padx=5, pady=5)
|
17
|
+
|
18
|
+
root.mainloop()
|
tkflu/demos/tooltip.py
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
from tkflu import *
|
2
|
+
|
3
|
+
|
4
|
+
root = FluWindow()
|
5
|
+
|
6
|
+
thememanager = FluThemeManager(root, mode="dark")
|
7
|
+
|
8
|
+
button = FluButton(root, text="Click me", command=lambda: print("Clicked"), style="standard")
|
9
|
+
button.pack()
|
10
|
+
|
11
|
+
tooltip = FluToolTip(button, text="This is a tooltip")
|
12
|
+
|
13
|
+
root.mainloop()
|
tkflu/designs/tooltip.py
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
def tooltip(mode):
|
2
|
+
if mode.lower() == "light":
|
3
|
+
return {
|
4
|
+
"back_color": "#e2e2e2",
|
5
|
+
"text_color": "#000000",
|
6
|
+
"frame_color": "#F9F9F9",
|
7
|
+
"frame_border_color": "#ebebeb"
|
8
|
+
}
|
9
|
+
else:
|
10
|
+
return {
|
11
|
+
"back_color": "#1a1a1a",
|
12
|
+
"text_color": "#ffffff",
|
13
|
+
"frame_color": "#2f2f2f",
|
14
|
+
"frame_border_color": "#161616"
|
15
|
+
}
|
tkflu/entry.py
CHANGED
@@ -71,7 +71,10 @@ class FluEntryCanvas(DCanvas):
|
|
71
71
|
create_roundrect = create_round_rectangle
|
72
72
|
|
73
73
|
|
74
|
-
|
74
|
+
from .tooltip import FluToolTipBase
|
75
|
+
|
76
|
+
|
77
|
+
class FluEntry(FluEntryCanvas, DDrawWidget, FluToolTipBase):
|
75
78
|
def __init__(self, *args,
|
76
79
|
width=120,
|
77
80
|
height=32,
|
tkflu/label.py
CHANGED
tkflu/menu.py
CHANGED
@@ -1,8 +1,9 @@
|
|
1
1
|
from .popupmenu import FluPopupMenu
|
2
2
|
from tkdeft.object import DObject
|
3
|
+
from .tooltip import FluToolTipBase
|
3
4
|
|
4
5
|
|
5
|
-
class FluMenu(FluPopupMenu):
|
6
|
+
class FluMenu(FluPopupMenu, FluToolTipBase):
|
6
7
|
def __init__(self, *args, **kwargs):
|
7
8
|
super().__init__(*args, **kwargs)
|
8
9
|
|
tkflu/popupwindow.py
CHANGED
@@ -2,16 +2,17 @@ from tkinter import Toplevel
|
|
2
2
|
|
3
3
|
|
4
4
|
class FluPopupWindow(Toplevel):
|
5
|
-
def __init__(self, *args, transparent_color="#ebebeb", mode="light", width=100, height=46, **kwargs):
|
5
|
+
def __init__(self, *args, transparent_color="#ebebeb", mode="light", width=100, height=46, custom=True, **kwargs):
|
6
6
|
super().__init__(*args, background=transparent_color, **kwargs)
|
7
7
|
|
8
8
|
self.theme(mode=mode)
|
9
9
|
|
10
10
|
self.geometry(f"{width}x{height}")
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
12
|
+
if custom:
|
13
|
+
self.transient_color = transparent_color
|
14
|
+
self.overrideredirect(True)
|
15
|
+
self.wm_attributes("-transparentcolor", transparent_color)
|
15
16
|
|
16
17
|
self.withdraw()
|
17
18
|
|
@@ -22,6 +23,7 @@ class FluPopupWindow(Toplevel):
|
|
22
23
|
|
23
24
|
def popup(self, x, y):
|
24
25
|
self.geometry(f"+{x}+{y}")
|
26
|
+
#self.focus_set()
|
25
27
|
|
26
28
|
def theme(self, mode=None):
|
27
29
|
if mode:
|
tkflu/slider.py
CHANGED
@@ -29,14 +29,14 @@ class FluSliderDraw(DSvgDraw):
|
|
29
29
|
border.add_stop_color(0.954545, outline2, outline2_opacity)
|
30
30
|
drawing[1].defs.add(border)
|
31
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="")
|
32
|
+
#print("x1:", x1, "\n", "y1:", y1, "\n", "x2:", x2, "\n", "y2:", y2, "\n", "r1:", r1, "\n", sep="")
|
33
33
|
|
34
34
|
x = x1 + r1 - 4
|
35
35
|
xx = x2 - r1 + 4
|
36
36
|
|
37
|
-
print("track_x1:", x, "\n", "track_x2:", xx, sep="")
|
37
|
+
#print("track_x1:", x, "\n", "track_x2:", xx, sep="")
|
38
38
|
|
39
|
-
print("")
|
39
|
+
#print("")
|
40
40
|
|
41
41
|
drawing[1].add(
|
42
42
|
drawing[1].rect(
|
@@ -188,9 +188,9 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
|
|
188
188
|
|
189
189
|
super()._draw(event)
|
190
190
|
|
191
|
-
print("width:", self.winfo_width(), "\n", "height:", self.winfo_height(), sep="")
|
191
|
+
#print("width:", self.winfo_width(), "\n", "height:", self.winfo_height(), sep="")
|
192
192
|
|
193
|
-
print("")
|
193
|
+
#print("")
|
194
194
|
|
195
195
|
self.delete("all")
|
196
196
|
|
@@ -263,8 +263,8 @@ class FluSlider(FluSliderCanvas, DDrawWidget):
|
|
263
263
|
self.dconfigure(
|
264
264
|
value=value
|
265
265
|
)
|
266
|
-
print("value:", value, sep="")
|
267
|
-
print("")
|
266
|
+
#print("value:", value, sep="")
|
267
|
+
#print("")
|
268
268
|
|
269
269
|
def _event_button1_motion(self, event):
|
270
270
|
self.pos(event)
|
tkflu/text.py
CHANGED
@@ -72,7 +72,10 @@ class FluTextCanvas(DCanvas):
|
|
72
72
|
create_roundrect = create_round_rectangle
|
73
73
|
|
74
74
|
|
75
|
-
|
75
|
+
from .tooltip import FluToolTipBase
|
76
|
+
|
77
|
+
|
78
|
+
class FluText(FluTextCanvas, DDrawWidget, FluToolTipBase):
|
76
79
|
def __init__(self, *args,
|
77
80
|
width=120,
|
78
81
|
height=90,
|
tkflu/thememanager.py
CHANGED
@@ -3,7 +3,7 @@ from .toplevel import FluToplevel
|
|
3
3
|
|
4
4
|
|
5
5
|
class FluThemeManager(object):
|
6
|
-
def __init__(self, window=None, mode: str = "light"):
|
6
|
+
def __init__(self, window=None, mode: str = "light", delay: int or None = 100):
|
7
7
|
if window:
|
8
8
|
self._window = window
|
9
9
|
else:
|
@@ -11,18 +11,23 @@ class FluThemeManager(object):
|
|
11
11
|
self._window = _default_root
|
12
12
|
self._mode = mode
|
13
13
|
self.mode(self._mode)
|
14
|
-
self._window.after(
|
14
|
+
self._window.after(delay, lambda: self.mode(self._mode))
|
15
15
|
|
16
|
-
def mode(self, mode: str):
|
17
|
-
|
18
|
-
|
19
|
-
self._window
|
20
|
-
|
21
|
-
self._window
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
widget
|
26
|
-
|
27
|
-
widget
|
28
|
-
|
16
|
+
def mode(self, mode: str, delay: int or None = None):
|
17
|
+
def _():
|
18
|
+
self._mode = mode
|
19
|
+
if hasattr(self._window, "theme"):
|
20
|
+
self._window.theme(mode=mode)
|
21
|
+
if hasattr(self._window, "_draw"):
|
22
|
+
self._window._draw()
|
23
|
+
self._window.update()
|
24
|
+
for widget in self._window.winfo_children():
|
25
|
+
if hasattr(widget, "theme"):
|
26
|
+
widget.theme(mode=mode)
|
27
|
+
if hasattr(widget, "_draw"):
|
28
|
+
widget._draw()
|
29
|
+
widget.update()
|
30
|
+
if delay:
|
31
|
+
self._window.after(delay, _)
|
32
|
+
else:
|
33
|
+
_()
|
tkflu/togglebutton.py
CHANGED
@@ -59,7 +59,10 @@ class FluToggleButtonCanvas(DCanvas):
|
|
59
59
|
create_roundrect = create_round_rectangle_with_text
|
60
60
|
|
61
61
|
|
62
|
-
|
62
|
+
from .tooltip import FluToolTipBase
|
63
|
+
|
64
|
+
|
65
|
+
class FluToggleButton(FluToggleButtonCanvas, DDrawWidget, FluToolTipBase):
|
63
66
|
def __init__(self, *args,
|
64
67
|
text="",
|
65
68
|
width=120,
|
tkflu/tooltip.py
CHANGED
@@ -1,8 +1,151 @@
|
|
1
1
|
from .popupwindow import FluPopupWindow
|
2
|
+
from tkinter import Event, Widget
|
2
3
|
|
3
4
|
|
4
5
|
class FluToolTip(FluPopupWindow):
|
5
|
-
def __init__(self, widget, *args, **kwargs):
|
6
|
-
super().__init__(*args, **kwargs)
|
6
|
+
def __init__(self, widget: Widget, text, mode="light", delay=400, show_time=100.0, *args, **kwargs):
|
7
|
+
super().__init__(*args, transparent_color="#ebebeb", **kwargs)
|
8
|
+
|
9
|
+
from .label import FluLabel
|
10
|
+
from .frame import FluFrame
|
11
|
+
|
12
|
+
self.overrideredirect(True)
|
13
|
+
|
14
|
+
self._delay = delay
|
15
|
+
self._show_time = show_time
|
16
|
+
self._widget = widget
|
17
|
+
|
18
|
+
self._frame = FluFrame(self)
|
19
|
+
self._frame.theme(mode, style="popupmenu")
|
20
|
+
|
21
|
+
self._label = FluLabel(self._frame, text=text)
|
22
|
+
self._label.pack(fill="both", expand=True, padx=3, pady=3)
|
23
|
+
|
24
|
+
self._frame.pack(fill="both", expand=True, padx=3, pady=3)
|
25
|
+
|
26
|
+
self._widget.bind('<Enter>', self.enter, add="+")
|
27
|
+
self._widget.bind('<Leave>', self.leave, add="+")
|
28
|
+
|
29
|
+
#self.theme(mode)
|
30
|
+
|
31
|
+
def enter(self, event: Event):
|
32
|
+
def check() -> None:
|
33
|
+
if self._enter:
|
34
|
+
# 先定位工具提示位置
|
35
|
+
self.popup(
|
36
|
+
round(self._widget.winfo_rootx() + self._widget.winfo_width() / 2 - self.winfo_width() / 2),
|
37
|
+
round(self._widget.winfo_rooty() + self._widget.winfo_height() + 2)
|
38
|
+
)
|
39
|
+
self.wm_attributes("-alpha", 0.0)
|
40
|
+
self.deiconify()
|
41
|
+
|
42
|
+
# 设置初始透明度为0
|
43
|
+
|
44
|
+
|
45
|
+
# 渐显动画
|
46
|
+
def fade_in(step=0):
|
47
|
+
alpha = step / 10 # 分10步从0到1
|
48
|
+
self.wm_attributes("-alpha", alpha)
|
49
|
+
if step < 10:
|
50
|
+
self.after(int(round(self._show_time/10)), lambda: fade_in(step + 1)) # 每50ms增加一次透明度
|
51
|
+
|
52
|
+
fade_in() # 启动动画
|
53
|
+
|
54
|
+
self.id = self.after(self._delay, check)
|
55
|
+
self._enter = True
|
56
|
+
|
57
|
+
def leave(self, event):
|
58
|
+
self.after_cancel(self.id)
|
59
|
+
self._enter = False
|
60
|
+
self.withdraw()
|
61
|
+
|
62
|
+
def theme(self, mode=None):
|
63
|
+
from .designs.tooltip import tooltip
|
64
|
+
n = tooltip(mode)
|
65
|
+
self.configure(
|
66
|
+
background=n["back_color"]
|
67
|
+
)
|
68
|
+
self.wm_attributes("-transparentcolor", n["back_color"])
|
69
|
+
print(n["back_color"])
|
70
|
+
if hasattr(self, "_frame"):
|
71
|
+
self._frame.dconfigure(
|
72
|
+
back_color=n["frame_color"],
|
73
|
+
border_color=n["frame_border_color"],
|
74
|
+
border_color_opacity=1,
|
75
|
+
border_width=2,
|
76
|
+
radius=7,
|
77
|
+
)
|
78
|
+
if hasattr(self, "_label"):
|
79
|
+
self._label.theme(mode)
|
80
|
+
super().theme(mode)
|
81
|
+
|
82
|
+
|
83
|
+
class FluToolTip2(FluPopupWindow):
|
84
|
+
def __init__(self, widget, text, mode="light", *args, **kwargs):
|
85
|
+
super().__init__(*args, transparent_color="#ebebeb", **kwargs)
|
86
|
+
|
87
|
+
from .label import FluLabel
|
88
|
+
from .frame import FluFrame
|
89
|
+
|
90
|
+
self.overrideredirect(True)
|
91
|
+
|
92
|
+
self._widget = widget
|
93
|
+
|
94
|
+
self._frame = FluFrame(self)
|
95
|
+
self._frame.theme(mode, style="popupmenu")
|
96
|
+
|
97
|
+
self._label = FluLabel(self._frame, text=text)
|
98
|
+
self._label.pack(fill="both", expand=True, padx=3, pady=3)
|
99
|
+
|
100
|
+
self._frame.pack(fill="both", expand=True, padx=3, pady=3)
|
101
|
+
|
102
|
+
self._widget.bind('<Enter>', self.show, add="+")
|
103
|
+
self._widget.bind('<Leave>', self.hide, add="+")
|
104
|
+
self._widget.bind('<Motion>', self.move, add="+")
|
105
|
+
|
106
|
+
#self.theme(mode)
|
107
|
+
|
108
|
+
def show(self, event: Event):
|
109
|
+
self.popup(
|
110
|
+
round(event.x_root - self.winfo_width() / 2),
|
111
|
+
round(event.y_root + 10)
|
112
|
+
)
|
113
|
+
self.deiconify()
|
114
|
+
|
115
|
+
def hide(self, event):
|
116
|
+
self.withdraw()
|
117
|
+
|
118
|
+
def move(self, event):
|
119
|
+
self.popup(
|
120
|
+
round(event.x_root - self.winfo_width() / 2),
|
121
|
+
round(event.y_root + 10)
|
122
|
+
)
|
123
|
+
|
124
|
+
def theme(self, mode=None):
|
125
|
+
from .designs.tooltip import tooltip
|
126
|
+
n = tooltip(mode)
|
127
|
+
self.configure(
|
128
|
+
background=n["back_color"]
|
129
|
+
)
|
130
|
+
self.wm_attributes("-transparentcolor", n["back_color"])
|
131
|
+
print(n["back_color"])
|
132
|
+
if hasattr(self, "_frame"):
|
133
|
+
self._frame.dconfigure(
|
134
|
+
back_color=n["frame_color"],
|
135
|
+
border_color=n["frame_border_color"],
|
136
|
+
border_color_opacity=1,
|
137
|
+
border_width=2,
|
138
|
+
radius=7,
|
139
|
+
)
|
140
|
+
if hasattr(self, "_label"):
|
141
|
+
self._label.theme(mode)
|
142
|
+
super().theme(mode)
|
143
|
+
|
144
|
+
|
145
|
+
class FluToolTipBase:
|
146
|
+
def tooltip(self, *args, way=0, **kwargs):
|
147
|
+
if way == 0:
|
148
|
+
self._tooltip = FluToolTip(*args, widget=self, **kwargs)
|
149
|
+
elif way == 1:
|
150
|
+
self._tooltip = FluToolTip2(*args, widget=self, **kwargs)
|
7
151
|
|
8
|
-
self.widget = widget
|
tkflu/window.py
CHANGED
@@ -8,27 +8,31 @@ class FluWindow(Tk, BWm, DObject):
|
|
8
8
|
"""Fluent设计的主窗口"""
|
9
9
|
|
10
10
|
def __init__(self, *args, className="tkdeft", mode="light", **kwargs):
|
11
|
-
|
12
11
|
"""
|
13
|
-
|
12
|
+
初始化类实例,继承自tkinter.TK并添加Fluent主题支持
|
14
13
|
|
15
|
-
:param args:
|
16
|
-
:param className:
|
17
|
-
:param mode: Fluent
|
18
|
-
:param kwargs:
|
14
|
+
:param args: 可变位置参数,传递给父类tkinter.TK.__init__的未命名参数
|
15
|
+
:param className: 窗口类名,默认"tkdeft",传递给父类tkinter.TK.__init__
|
16
|
+
:param mode: Fluent主题模式,可选值为"light"(明亮)或"dark"(暗黑),默认"light"
|
17
|
+
:param kwargs: 可变关键字参数,传递给父类tkinter.TK.__init__的命名参数
|
19
18
|
"""
|
20
19
|
|
20
|
+
# 初始化Fluent主题
|
21
21
|
self._init(mode)
|
22
22
|
|
23
|
+
# 标记为未使用自定义配置
|
23
24
|
self.custom = False
|
24
25
|
|
26
|
+
# 调用父类tkinter.TK的初始化方法
|
25
27
|
super().__init__(*args, className=className, **kwargs)
|
26
28
|
|
29
|
+
# 设置窗口图标
|
27
30
|
from .icons import light
|
28
31
|
from tkinter import PhotoImage
|
29
|
-
|
30
32
|
self.iconphoto(False, PhotoImage(file=light()))
|
31
33
|
|
32
|
-
|
33
|
-
self.bind("<
|
34
|
-
self.
|
34
|
+
# 绑定事件处理函数
|
35
|
+
self.bind("<Configure>", self._event_configure, add="+") # 窗口大小/位置改变事件
|
36
|
+
self.bind("<Escape>", self._event_key_esc, add="+") # ESC键按下事件
|
37
|
+
self.protocol("WM_DELETE_WINDOW", self._event_delete_window) # 窗口关闭事件
|
38
|
+
|
@@ -0,0 +1,82 @@
|
|
1
|
+
Metadata-Version: 2.3
|
2
|
+
Name: tkfluent
|
3
|
+
Version: 0.0.9
|
4
|
+
Summary: Fluent Design for Tkinter
|
5
|
+
License: MIT
|
6
|
+
Keywords: tkfluent,tksvg,tkinter,fluent,modern,UI,interface
|
7
|
+
Author: XiangQinxi
|
8
|
+
Author-email: xiangqinxi@outlook.com
|
9
|
+
Requires-Python: >=3.8,<4.0
|
10
|
+
Classifier: Development Status :: 4 - Beta
|
11
|
+
Classifier: Environment :: MacOS X
|
12
|
+
Classifier: Environment :: Win32 (MS Windows)
|
13
|
+
Classifier: Environment :: X11 Applications
|
14
|
+
Classifier: License :: OSI Approved :: MIT License
|
15
|
+
Classifier: Natural Language :: Chinese (Simplified)
|
16
|
+
Classifier: Natural Language :: English
|
17
|
+
Classifier: Operating System :: MacOS
|
18
|
+
Classifier: Operating System :: Microsoft :: Windows
|
19
|
+
Classifier: Operating System :: POSIX :: Linux
|
20
|
+
Classifier: Programming Language :: Python :: 3
|
21
|
+
Classifier: Programming Language :: Python :: 3.8
|
22
|
+
Classifier: Programming Language :: Python :: 3.9
|
23
|
+
Classifier: Programming Language :: Python :: 3.10
|
24
|
+
Classifier: Programming Language :: Python :: 3.11
|
25
|
+
Classifier: Programming Language :: Python :: 3.12
|
26
|
+
Classifier: Programming Language :: Python :: 3.13
|
27
|
+
Classifier: Programming Language :: Tcl
|
28
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
29
|
+
Requires-Dist: easydict (>=1.13,<2.0)
|
30
|
+
Requires-Dist: pillow (>=10.2.0,<11.0.0)
|
31
|
+
Requires-Dist: svgwrite (>=1.4.3,<2.0.0)
|
32
|
+
Requires-Dist: tkdeft (>=0.0.9,<0.0.10)
|
33
|
+
Requires-Dist: tkextrafont (>=0.6.3,<0.7.0)
|
34
|
+
Requires-Dist: tksvg (>=0.7.4,<0.8.0)
|
35
|
+
Project-URL: Documentation, https://tkfluent.netlify.app
|
36
|
+
Description-Content-Type: text/markdown
|
37
|
+
|
38
|
+
# tkfluent
|
39
|
+
|
40
|
+
`tkinter`现代化组件库。设计来于`Fluent` `WinUI3` 设计
|
41
|
+
|
42
|
+

|
43
|
+
|
44
|
+
## 依赖图
|
45
|
+
```bash
|
46
|
+
PS .\tkfluent> poetry show --tree
|
47
|
+
easydict 1.13 Access dict values as attributes (works recursively).
|
48
|
+
pillow 10.4.0 Python Imaging Library (Fork)
|
49
|
+
svgwrite 1.4.3 A Python library to create SVG drawings.
|
50
|
+
tkdeft 0.0.9 使用tkinter+tksvg开发的现代化界面库
|
51
|
+
├── easydict >=1.13,<2.0
|
52
|
+
├── pillow >=10.2.0,<11.0.0
|
53
|
+
├── svgwrite >=1.4.3,<2.0.0
|
54
|
+
├── tkextrafont >=0.6.3,<0.7.0
|
55
|
+
│ └── scikit-build *
|
56
|
+
│ ├── distro *
|
57
|
+
│ ├── packaging *
|
58
|
+
│ ├── setuptools >=42.0.0
|
59
|
+
│ ├── tomli *
|
60
|
+
│ └── wheel >=0.32.0
|
61
|
+
└── tksvg >=0.7.4,<0.8.0
|
62
|
+
└── scikit-build *
|
63
|
+
├── distro *
|
64
|
+
├── packaging *
|
65
|
+
├── setuptools >=42.0.0
|
66
|
+
├── tomli *
|
67
|
+
└── wheel >=0.32.0
|
68
|
+
tkextrafont 0.6.3 Fonts loader for Tkinter
|
69
|
+
└── scikit-build *
|
70
|
+
├── distro *
|
71
|
+
├── packaging *
|
72
|
+
├── setuptools >=42.0.0
|
73
|
+
├── tomli *
|
74
|
+
└── wheel >=0.32.0
|
75
|
+
tksvg 0.7.4 SVG support for PhotoImage in Tk 8.6
|
76
|
+
└── scikit-build *
|
77
|
+
├── distro *
|
78
|
+
├── packaging *
|
79
|
+
├── setuptools >=42.0.0
|
80
|
+
├── tomli *
|
81
|
+
└── wheel >=0.32.0
|
82
|
+
```
|
@@ -1,13 +1,16 @@
|
|
1
|
-
tkflu/__init__.py,sha256=
|
2
|
-
tkflu/__main__.py,sha256=
|
3
|
-
tkflu/badge.py,sha256=
|
4
|
-
tkflu/button.py,sha256=
|
5
|
-
tkflu/bwm.py,sha256=
|
1
|
+
tkflu/__init__.py,sha256=rw-h1nnCEP1mr_K9A7yAMdK5PS1yZRx3ha4q9AiYPlY,988
|
2
|
+
tkflu/__main__.py,sha256=vcx_XgA5wmfCOH6yODEcKHzfIwUyBUoWVP5suySFlWU,3299
|
3
|
+
tkflu/badge.py,sha256=mvRTJMOcVXX5h9uSYHYX_CzbVcQ-kl4kLlIMknCNFZM,5787
|
4
|
+
tkflu/button.py,sha256=2uwxpWccyupS4s2NfyQ3PHi5GHds9MBpEd60ecQoASc,9612
|
5
|
+
tkflu/bwm.py,sha256=IwpRtb5lToEidXBkE1NZcj8wnjQBAkXupKJSIFw0B54,7092
|
6
6
|
tkflu/checkbox.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
tkflu/constants.py,sha256=
|
7
|
+
tkflu/constants.py,sha256=VX3NcSzdOqelK3IRM-fK_RKBHV26d8AgJMuP-8hqCsA,488
|
8
8
|
tkflu/customwindow.py,sha256=Fr4CF0vKwj36tYzgX9_5F7OwcD59z9LfOW20Ugm2Hxc,3761
|
9
9
|
tkflu/customwindow2.py,sha256=nyNEMoGVnOYXCPbdvxZFUH-VlpAtjjEGI8Ul9VDvgAs,2109
|
10
10
|
tkflu/defs.py,sha256=pKVQUm-dK12QiU2MMFD7sxoiXfhEsezN_uAV6eE5Cbk,1144
|
11
|
+
tkflu/demos/__init__.py,sha256=0IV8vUG2kAp90bbRXGj7Mte2ABXrZ_rzIyZxmB1fGLY,102
|
12
|
+
tkflu/demos/acrylic1.py,sha256=-1SniTxrQeAYz6VSxHu7UsAmZeSIBaElgC2KYVVAghU,423
|
13
|
+
tkflu/demos/tooltip.py,sha256=SYE5xNM0Xx8sZ7a-qhPDi6dviOmapftLEMKeFg6tGOY,285
|
11
14
|
tkflu/designs/__init__.py,sha256=2Z4lCHHwMtXinGQgowsQeLkGBl20c5iMOR6GjvE4my4,113
|
12
15
|
tkflu/designs/badge.py,sha256=SVwDrQPltscB7YDvw5qhPdepKy1S-pcdD6OyYfonwzQ,1463
|
13
16
|
tkflu/designs/button.py,sha256=yEKRrH5dcDQCaGGqsYRnKgaCPSSd8cU__31LOQf2JX0,12274
|
@@ -19,26 +22,27 @@ tkflu/designs/frame.py,sha256=ypv5DilK1ZAsbGIzPIBPQFRrnfC7XtFYpvUFmUd6hdg,1167
|
|
19
22
|
tkflu/designs/primary_color.py,sha256=1gEM9qvHNNA09k4QOEFG0DUMhCqSK5C47YW-Nk6k4vY,729
|
20
23
|
tkflu/designs/slider.py,sha256=1JsWvE8tQ6oI3vfS7iDMlES17n6ri8q9D2ym456i5CY,7800
|
21
24
|
tkflu/designs/text.py,sha256=YMJR2eGE7lFIZPYrT7p8QBD3zRH4NaVWhrL1dOb6vJ4,5059
|
25
|
+
tkflu/designs/tooltip.py,sha256=OFUIO9-EMNjapF9zC5PuLW26HFGib-p800hNIxaWT5Q,442
|
22
26
|
tkflu/designs/window.py,sha256=XHMvT0lVsJSeUApMf_bf9ipLSWT-BirkOiiUnVx-N48,625
|
23
|
-
tkflu/entry.py,sha256=
|
27
|
+
tkflu/entry.py,sha256=b4kblEEmZRqtuDM2E5_hhb_8MhTgujbwTNP7aICB6qM,10852
|
24
28
|
tkflu/frame.py,sha256=KgmKEKXNZJgCi1_j4ChsnvDHmYL0OqksLuBhbXA0YRM,10107
|
25
29
|
tkflu/icons.py,sha256=Xzrc9WzexncYEPXqnVg3ywWv_7kLZLyYC5WtaRv30PQ,7129
|
26
30
|
tkflu/image.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
27
|
-
tkflu/label.py,sha256=
|
31
|
+
tkflu/label.py,sha256=AFkAosNVvvXiD0FAolyCIyhOttYMjwqPS9GpqLf-6co,1614
|
28
32
|
tkflu/listbox.py,sha256=gD_oNNWVZtm5qXQ8bVBNRqJL6CGiIYtvhxztM9huzew,9991
|
29
33
|
tkflu/litenav.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
30
|
-
tkflu/menu.py,sha256=
|
34
|
+
tkflu/menu.py,sha256=pnDwKBVoxCzjxXGELeiXOZG2ljbJF2_sJ8pOvEUYo9g,3247
|
31
35
|
tkflu/menubar.py,sha256=2XdMfWy6djGU3RL1ykbaUR6bj0rwaqdUJmufOzsdOPE,4027
|
32
36
|
tkflu/popupmenu.py,sha256=dRwuFK7PKSYXiLhzrrzjKXTjtLfr7vh0KDvJIUjDetg,1592
|
33
|
-
tkflu/popupwindow.py,sha256=
|
37
|
+
tkflu/popupwindow.py,sha256=OVDjW3g5oKeFy82SLz7XiNC2hy8RKeQGW2l0yBKezIs,1010
|
34
38
|
tkflu/scrollbar.py,sha256=1hbu5n1mx4KyiF_M3sohpJJPux1zu5Jlw9V6LfQQs1Y,7293
|
35
|
-
tkflu/slider.py,sha256=
|
36
|
-
tkflu/text.py,sha256=
|
37
|
-
tkflu/thememanager.py,sha256=
|
38
|
-
tkflu/togglebutton.py,sha256=
|
39
|
-
tkflu/tooltip.py,sha256=
|
39
|
+
tkflu/slider.py,sha256=B29fNA0rGSWEdetFfwLEdNhYyprHEm9FCqU3Vpp08Sw,16114
|
40
|
+
tkflu/text.py,sha256=OIh79R0NAJdle4aSsIxzdPhBNqiAw15FqtdEip-kU9s,10891
|
41
|
+
tkflu/thememanager.py,sha256=J3vCab-u2nD0QPMB9wu5d-Isu7alK7c63aF2Ys7uviw,1175
|
42
|
+
tkflu/togglebutton.py,sha256=JHuK7tMdihi3rL8TyPOKBgdlYRX5nDYgfj0fPBTfYFA,14830
|
43
|
+
tkflu/tooltip.py,sha256=KWoybFZjokQgMAUx6FdXZc8u3kBdNZlCVaIiS5PokKs,4915
|
40
44
|
tkflu/toplevel.py,sha256=gcLz93Q9OgWc9dV4d-TK6gXk5eIetFuU5CbO8ybAvsI,815
|
41
|
-
tkflu/window.py,sha256=
|
42
|
-
tkfluent-0.0.
|
43
|
-
tkfluent-0.0.
|
44
|
-
tkfluent-0.0.
|
45
|
+
tkflu/window.py,sha256=2LjgL2KZIAYA04fXWQvfiNMYj_PKzlpSuEZrR94qHAs,1483
|
46
|
+
tkfluent-0.0.9.dist-info/METADATA,sha256=EPW6HxJzOhmzJ250cWJ1SHGO7G6V1Jt1Psr2L7Nhzjs,3080
|
47
|
+
tkfluent-0.0.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
48
|
+
tkfluent-0.0.9.dist-info/RECORD,,
|
@@ -1,29 +0,0 @@
|
|
1
|
-
Metadata-Version: 2.3
|
2
|
-
Name: tkfluent
|
3
|
-
Version: 0.0.8
|
4
|
-
Summary: Fluent Design for Tkinter
|
5
|
-
Author: XiangQinxi
|
6
|
-
Author-email: xiangqinxi@outlook.com
|
7
|
-
Requires-Python: >=3.7,<4.0
|
8
|
-
Classifier: Programming Language :: Python :: 3
|
9
|
-
Classifier: Programming Language :: Python :: 3.7
|
10
|
-
Classifier: Programming Language :: Python :: 3.8
|
11
|
-
Classifier: Programming Language :: Python :: 3.9
|
12
|
-
Classifier: Programming Language :: Python :: 3.10
|
13
|
-
Classifier: Programming Language :: Python :: 3.11
|
14
|
-
Classifier: Programming Language :: Python :: 3.12
|
15
|
-
Classifier: Programming Language :: Python :: 3.13
|
16
|
-
Requires-Dist: easydict (>=1.13,<2.0)
|
17
|
-
Requires-Dist: pillow (>=10.2.0,<11.0.0)
|
18
|
-
Requires-Dist: svgwrite (>=1.4.3,<2.0.0)
|
19
|
-
Requires-Dist: tkdeft (>=0.0.9,<0.0.10)
|
20
|
-
Requires-Dist: tkextrafont (>=0.6.3,<0.7.0)
|
21
|
-
Requires-Dist: tksvg (>=0.7.4,<0.8.0)
|
22
|
-
Project-URL: Documentation, https://tkfluent.netlify.app
|
23
|
-
Description-Content-Type: text/markdown
|
24
|
-
|
25
|
-
# tkfluent
|
26
|
-
|
27
|
-
`tkinter`现代化组件库。设计来于`Fluent` `WinUI3` 设计
|
28
|
-
|
29
|
-

|
File without changes
|