tkfluent 0.0.6__tar.gz → 0.0.9__tar.gz
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.
- tkfluent-0.0.9/PKG-INFO +82 -0
- tkfluent-0.0.9/README.md +45 -0
- tkfluent-0.0.9/pyproject.toml +44 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/__init__.py +4 -1
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/__main__.py +38 -3
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/badge.py +4 -1
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/button.py +9 -6
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/bwm.py +2 -0
- tkfluent-0.0.9/tkflu/constants.py +25 -0
- tkfluent-0.0.9/tkflu/defs.py +41 -0
- tkfluent-0.0.9/tkflu/demos/__init__.py +1 -0
- tkfluent-0.0.9/tkflu/demos/acrylic1.py +18 -0
- tkfluent-0.0.9/tkflu/demos/tooltip.py +13 -0
- tkfluent-0.0.9/tkflu/designs/slider.py +253 -0
- tkfluent-0.0.9/tkflu/designs/tooltip.py +15 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/window.py +2 -2
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/entry.py +7 -2
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/label.py +2 -1
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/menu.py +6 -5
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/popupwindow.py +6 -4
- tkfluent-0.0.9/tkflu/slider.py +404 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/text.py +9 -2
- tkfluent-0.0.9/tkflu/thememanager.py +33 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/togglebutton.py +4 -1
- tkfluent-0.0.9/tkflu/tooltip.py +151 -0
- tkfluent-0.0.9/tkflu/window.py +38 -0
- tkfluent-0.0.6/PKG-INFO +0 -26
- tkfluent-0.0.6/README.md +0 -3
- tkfluent-0.0.6/pyproject.toml +0 -23
- tkfluent-0.0.6/tkflu/constants.py +0 -15
- tkfluent-0.0.6/tkflu/defs.py +0 -16
- tkfluent-0.0.6/tkflu/designs/__pycache__/__init__.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/__pycache__/badge.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/__pycache__/button.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/__pycache__/design.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/__pycache__/entry.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/__pycache__/frame.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/__pycache__/primary_color.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/__pycache__/text.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/__pycache__/window.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/designs/fonts/__pycache__/__init__.cpython-311.pyc +0 -0
- tkfluent-0.0.6/tkflu/thememanager.py +0 -28
- tkfluent-0.0.6/tkflu/tooltip.py +0 -8
- tkfluent-0.0.6/tkflu/window.py +0 -34
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/checkbox.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/customwindow.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/customwindow2.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/__init__.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/badge.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/button.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/design.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/entry.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/fonts/__init__.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/fonts/segoeui.ttf +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/frame.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/primary_color.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/designs/text.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/frame.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/icons.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/image.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/listbox.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/litenav.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/menubar.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/popupmenu.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/scrollbar.py +0 -0
- {tkfluent-0.0.6 → tkfluent-0.0.9}/tkflu/toplevel.py +0 -0
tkfluent-0.0.9/PKG-INFO
ADDED
@@ -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
|
+
```
|
tkfluent-0.0.9/README.md
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
# tkfluent
|
2
|
+
|
3
|
+
`tkinter`现代化组件库。设计来于`Fluent` `WinUI3` 设计
|
4
|
+
|
5
|
+

|
6
|
+
|
7
|
+
## 依赖图
|
8
|
+
```bash
|
9
|
+
PS .\tkfluent> poetry show --tree
|
10
|
+
easydict 1.13 Access dict values as attributes (works recursively).
|
11
|
+
pillow 10.4.0 Python Imaging Library (Fork)
|
12
|
+
svgwrite 1.4.3 A Python library to create SVG drawings.
|
13
|
+
tkdeft 0.0.9 使用tkinter+tksvg开发的现代化界面库
|
14
|
+
├── easydict >=1.13,<2.0
|
15
|
+
├── pillow >=10.2.0,<11.0.0
|
16
|
+
├── svgwrite >=1.4.3,<2.0.0
|
17
|
+
├── tkextrafont >=0.6.3,<0.7.0
|
18
|
+
│ └── scikit-build *
|
19
|
+
│ ├── distro *
|
20
|
+
│ ├── packaging *
|
21
|
+
│ ├── setuptools >=42.0.0
|
22
|
+
│ ├── tomli *
|
23
|
+
│ └── wheel >=0.32.0
|
24
|
+
└── tksvg >=0.7.4,<0.8.0
|
25
|
+
└── scikit-build *
|
26
|
+
├── distro *
|
27
|
+
├── packaging *
|
28
|
+
├── setuptools >=42.0.0
|
29
|
+
├── tomli *
|
30
|
+
└── wheel >=0.32.0
|
31
|
+
tkextrafont 0.6.3 Fonts loader for Tkinter
|
32
|
+
└── scikit-build *
|
33
|
+
├── distro *
|
34
|
+
├── packaging *
|
35
|
+
├── setuptools >=42.0.0
|
36
|
+
├── tomli *
|
37
|
+
└── wheel >=0.32.0
|
38
|
+
tksvg 0.7.4 SVG support for PhotoImage in Tk 8.6
|
39
|
+
└── scikit-build *
|
40
|
+
├── distro *
|
41
|
+
├── packaging *
|
42
|
+
├── setuptools >=42.0.0
|
43
|
+
├── tomli *
|
44
|
+
└── wheel >=0.32.0
|
45
|
+
```
|
@@ -0,0 +1,44 @@
|
|
1
|
+
[tool.poetry]
|
2
|
+
name = "tkfluent"
|
3
|
+
version = "0.0.9"
|
4
|
+
description = "Fluent Design for Tkinter"
|
5
|
+
authors = ["XiangQinxi <xiangqinxi@outlook.com>"]
|
6
|
+
readme = "README.md"
|
7
|
+
documentation = "https://tkfluent.netlify.app"
|
8
|
+
packages = [
|
9
|
+
{ include = "tkflu" }
|
10
|
+
]
|
11
|
+
license = "MIT"
|
12
|
+
keywords = [ "tkfluent", "tksvg", "tkinter", "fluent", "modern", "UI", "interface" ]
|
13
|
+
classifiers = [
|
14
|
+
"Development Status :: 4 - Beta",
|
15
|
+
"Environment :: MacOS X",
|
16
|
+
"Environment :: Win32 (MS Windows)",
|
17
|
+
"Environment :: X11 Applications",
|
18
|
+
"Natural Language :: Chinese (Simplified)",
|
19
|
+
"Natural Language :: English",
|
20
|
+
"Operating System :: Microsoft :: Windows",
|
21
|
+
"Operating System :: MacOS",
|
22
|
+
"Operating System :: POSIX :: Linux",
|
23
|
+
"Programming Language :: Python :: 3.8",
|
24
|
+
"Programming Language :: Python :: 3.9",
|
25
|
+
"Programming Language :: Python :: 3.10",
|
26
|
+
"Programming Language :: Python :: 3.11",
|
27
|
+
"Programming Language :: Python :: 3.12",
|
28
|
+
"Programming Language :: Python :: 3.13",
|
29
|
+
"Programming Language :: Tcl",
|
30
|
+
"Topic :: Software Development :: Libraries :: Python Modules"
|
31
|
+
]
|
32
|
+
|
33
|
+
[tool.poetry.dependencies]
|
34
|
+
python = "^3.8"
|
35
|
+
tksvg = "^0.7.4"
|
36
|
+
tkextrafont = "^0.6.3"
|
37
|
+
svgwrite = "^1.4.3"
|
38
|
+
pillow = "^10.2.0"
|
39
|
+
tkdeft = "^0.0.9"
|
40
|
+
easydict = "^1.13"
|
41
|
+
|
42
|
+
[build-system]
|
43
|
+
requires = ["poetry-core"]
|
44
|
+
build-backend = "poetry.core.masonry.api"
|
@@ -9,19 +9,22 @@ Fluent设计的tkinter组件库(模板)
|
|
9
9
|
|
10
10
|
from .badge import FluBadge
|
11
11
|
from .button import FluButton
|
12
|
+
from .bwm import BWm
|
12
13
|
from .constants import *
|
13
14
|
from .defs import *
|
14
15
|
from .entry import FluEntry
|
15
16
|
from .frame import FluFrame
|
17
|
+
from .icons import *
|
16
18
|
from .label import FluLabel
|
17
19
|
from .menu import FluMenu
|
18
20
|
from .menubar import FluMenuBar
|
19
21
|
from .popupmenu import FluPopupMenu, FluPopupMenuWindow
|
20
22
|
from .popupwindow import FluPopupWindow
|
23
|
+
from .slider import FluSlider
|
21
24
|
from .text import FluText
|
22
25
|
from .thememanager import FluThemeManager
|
23
26
|
from .togglebutton import FluToggleButton
|
24
|
-
from .tooltip import FluToolTip
|
27
|
+
from .tooltip import FluToolTip, FluToolTip2, FluToolTipBase
|
25
28
|
from .toplevel import FluToplevel
|
26
29
|
from .window import FluWindow
|
27
30
|
|
@@ -2,11 +2,26 @@ from tkflu import *
|
|
2
2
|
from tkinter import *
|
3
3
|
from tkinter.font import *
|
4
4
|
|
5
|
-
|
6
|
-
|
5
|
+
blue_primary_color()
|
6
|
+
|
7
|
+
def togglestate():
|
8
|
+
if button1.dcget("state") == NORMAL:
|
9
|
+
button1.dconfigure(state=DISABLED)
|
10
|
+
button2.dconfigure(state=DISABLED)
|
11
|
+
entry1.dconfigure(state=DISABLED)
|
12
|
+
button1._draw()
|
13
|
+
button2._draw()
|
14
|
+
entry1._draw()
|
15
|
+
else:
|
16
|
+
button1.dconfigure(state=NORMAL)
|
17
|
+
button2.dconfigure(state=NORMAL)
|
18
|
+
entry1.dconfigure(state=NORMAL)
|
19
|
+
button1._draw()
|
20
|
+
button2._draw()
|
21
|
+
entry1._draw()
|
7
22
|
root = FluWindow()
|
8
23
|
#root.wincustom(way=0)
|
9
|
-
root.
|
24
|
+
root.geometry("360x600")
|
10
25
|
|
11
26
|
popupmenu = FluPopupMenu()
|
12
27
|
|
@@ -52,6 +67,14 @@ badge1.pack(padx=5, pady=5)
|
|
52
67
|
badge2 = FluBadge(frame, text="FluBadge (Accent)", width=120, style="accent")
|
53
68
|
badge2.pack(padx=5, pady=5)
|
54
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
|
+
|
55
78
|
button1 = FluButton(
|
56
79
|
frame, text="FluButton", command=lambda: print("FluButton -> Clicked")
|
57
80
|
)
|
@@ -72,6 +95,11 @@ togglebutton2 = FluToggleButton(
|
|
72
95
|
)
|
73
96
|
togglebutton2.pack(fill="x", padx=5, pady=5)
|
74
97
|
|
98
|
+
togglebutton3 = FluToggleButton(
|
99
|
+
frame, text="Toggle State", command=lambda: togglestate()
|
100
|
+
)
|
101
|
+
togglebutton3.pack(fill="x", padx=5, pady=5)
|
102
|
+
|
75
103
|
entry1 = FluEntry(frame)
|
76
104
|
entry1.pack(fill="x", padx=5, pady=5)
|
77
105
|
|
@@ -81,6 +109,13 @@ entry2.pack(fill="x", padx=5, pady=5)
|
|
81
109
|
text1 = FluText(frame)
|
82
110
|
text1.pack(fill="x", padx=5, pady=5)
|
83
111
|
|
112
|
+
slider1 = FluSlider(frame, value=0)
|
113
|
+
slider1.pack(fill="x", padx=5, pady=5)
|
114
|
+
|
115
|
+
"""listbox1 = FluListBox(frame)
|
116
|
+
listbox1.dconfigure()
|
117
|
+
listbox1.pack(fill="x", padx=5, pady=5)"""
|
118
|
+
|
84
119
|
frame.pack(fill="both", expand="yes", side="right", padx=5, pady=5)
|
85
120
|
|
86
121
|
root.mainloop()
|
@@ -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="",
|
@@ -61,16 +61,19 @@ class FluButtonCanvas(DCanvas):
|
|
61
61
|
create_roundrect = create_round_rectangle
|
62
62
|
|
63
63
|
|
64
|
-
|
64
|
+
from .constants import MODE, STATE, BUTTONSTYLE
|
65
|
+
from .tooltip import FluToolTipBase
|
66
|
+
|
67
|
+
class FluButton(FluButtonCanvas, DDrawWidget, FluToolTipBase):
|
65
68
|
def __init__(self, *args,
|
66
69
|
text="",
|
67
70
|
width=120,
|
68
71
|
height=32,
|
69
72
|
command=None,
|
70
73
|
font=None,
|
71
|
-
mode="light",
|
72
|
-
style="standard",
|
73
|
-
state="normal",
|
74
|
+
mode: MODE = "light",
|
75
|
+
style: BUTTONSTYLE = "standard",
|
76
|
+
state: STATE = "normal",
|
74
77
|
**kwargs):
|
75
78
|
self._init(mode, style)
|
76
79
|
|
@@ -95,7 +98,7 @@ class FluButton(FluButtonCanvas, DDrawWidget):
|
|
95
98
|
from .defs import set_default_font
|
96
99
|
set_default_font(font, self.attributes)
|
97
100
|
|
98
|
-
def _init(self, mode, style):
|
101
|
+
def _init(self, mode: MODE, style: BUTTONSTYLE):
|
99
102
|
|
100
103
|
from easydict import EasyDict
|
101
104
|
|
@@ -161,7 +164,7 @@ class FluButton(FluButtonCanvas, DDrawWidget):
|
|
161
164
|
fill=_text_color, text=self.attributes.text, font=self.attributes.font
|
162
165
|
)
|
163
166
|
|
164
|
-
def theme(self, mode=None, style=None):
|
167
|
+
def theme(self, mode: MODE = None, style: BUTTONSTYLE = None):
|
165
168
|
if mode:
|
166
169
|
self.mode = mode
|
167
170
|
if style:
|
@@ -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"],
|
@@ -0,0 +1,25 @@
|
|
1
|
+
from typing import Literal
|
2
|
+
|
3
|
+
NO = FALSE = OFF = 0
|
4
|
+
YES = TRUE = ON = 1
|
5
|
+
|
6
|
+
# Modes
|
7
|
+
LIGHT = 'light'
|
8
|
+
DARK = 'dark'
|
9
|
+
MODE = Literal["light", "dark"]
|
10
|
+
|
11
|
+
# States
|
12
|
+
NORMAL = 'normal'
|
13
|
+
DISABLED = 'disabled'
|
14
|
+
STATE = Literal["normal", "disabled"]
|
15
|
+
|
16
|
+
# FluButton Styles
|
17
|
+
STANDARD = 'standard'
|
18
|
+
ACCENT = 'accent'
|
19
|
+
MENU = 'menu'
|
20
|
+
BUTTONSTYLE = Literal["standard", "accent", "menu"]
|
21
|
+
|
22
|
+
# FluFrame Styles
|
23
|
+
STANDARD = 'standard'
|
24
|
+
POPUPMENU = 'popupmenu'
|
25
|
+
FRAMESTYLE = Literal["standard", "popupmenu"]
|
@@ -0,0 +1,41 @@
|
|
1
|
+
def toggle_theme(toggle_button, thememanager):
|
2
|
+
if toggle_button.dcget('checked'):
|
3
|
+
thememanager.mode("dark")
|
4
|
+
else:
|
5
|
+
thememanager.mode("light")
|
6
|
+
|
7
|
+
|
8
|
+
def set_default_font(font, attributes):
|
9
|
+
if font is None:
|
10
|
+
from .designs.fonts import SegoeFont
|
11
|
+
attributes.font = SegoeFont()
|
12
|
+
|
13
|
+
|
14
|
+
def red_primary_color():
|
15
|
+
from .designs.primary_color import set_primary_color
|
16
|
+
set_primary_color(("#d20e1e", "#f46762"))
|
17
|
+
|
18
|
+
|
19
|
+
def orange_primary_color():
|
20
|
+
from .designs.primary_color import set_primary_color
|
21
|
+
set_primary_color(("#c53201", "#fe7e34"))
|
22
|
+
|
23
|
+
|
24
|
+
def yellow_primary_color():
|
25
|
+
from .designs.primary_color import set_primary_color
|
26
|
+
set_primary_color(("#e19d00", "#ffd52a"))
|
27
|
+
|
28
|
+
|
29
|
+
def green_primary_color():
|
30
|
+
from .designs.primary_color import set_primary_color
|
31
|
+
set_primary_color(("#0e6d0e", "#45e532"))
|
32
|
+
|
33
|
+
|
34
|
+
def blue_primary_color():
|
35
|
+
from .designs.primary_color import set_primary_color
|
36
|
+
set_primary_color(("#005fb8", "#60cdff"))
|
37
|
+
|
38
|
+
|
39
|
+
def purple_primary_color():
|
40
|
+
from .designs.primary_color import set_primary_color
|
41
|
+
set_primary_color(("#4f4dce", "#b5adeb"))
|
@@ -0,0 +1 @@
|
|
1
|
+
# 这里没什么好东西,请不要在项目中导入,可以自行查看该文件夹中其他demo
|
@@ -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()
|
@@ -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()
|
@@ -0,0 +1,253 @@
|
|
1
|
+
from .primary_color import get_primary_color
|
2
|
+
|
3
|
+
|
4
|
+
def slider(mode: str, state: str):
|
5
|
+
mode = mode.lower()
|
6
|
+
state = state.lower()
|
7
|
+
|
8
|
+
if mode == "light":
|
9
|
+
if state == "rest":
|
10
|
+
return {
|
11
|
+
"radius": 2,
|
12
|
+
"thumb": {
|
13
|
+
"radius": 12,
|
14
|
+
"inner_radius": 6,
|
15
|
+
|
16
|
+
"back_color": "#FFFFFF",
|
17
|
+
"back_opacity": 1,
|
18
|
+
|
19
|
+
"border_color": "#000000",
|
20
|
+
"border_color_opacity": 0.058824,
|
21
|
+
|
22
|
+
"border_color2": "#000000",
|
23
|
+
"border_color2_opacity": 0.160784,
|
24
|
+
|
25
|
+
"inner_back_color": get_primary_color()[0],
|
26
|
+
"inner_back_opacity": 1,
|
27
|
+
},
|
28
|
+
"track": {
|
29
|
+
"width": 4,
|
30
|
+
|
31
|
+
"back_color": get_primary_color()[0],
|
32
|
+
"back_opacity": 1
|
33
|
+
},
|
34
|
+
"rail": {
|
35
|
+
"back_color": "#000000",
|
36
|
+
"back_opacity": 0.445800
|
37
|
+
}
|
38
|
+
}
|
39
|
+
elif state == "hover":
|
40
|
+
return {
|
41
|
+
"radius": 2,
|
42
|
+
"thumb": {
|
43
|
+
"radius": 12,
|
44
|
+
"inner_radius": 8,
|
45
|
+
|
46
|
+
"back_color": "#FFFFFF",
|
47
|
+
"back_opacity": 1,
|
48
|
+
|
49
|
+
"border_color": "#000000",
|
50
|
+
"border_color_opacity": 0.058824,
|
51
|
+
|
52
|
+
"border_color2": "#000000",
|
53
|
+
"border_color2_opacity": 0.160784,
|
54
|
+
|
55
|
+
"inner_back_color": get_primary_color()[0],
|
56
|
+
"inner_back_opacity": 1,
|
57
|
+
},
|
58
|
+
"track": {
|
59
|
+
"width": 4,
|
60
|
+
|
61
|
+
"back_color": get_primary_color()[0],
|
62
|
+
"back_opacity": 1
|
63
|
+
},
|
64
|
+
"rail": {
|
65
|
+
"back_color": "#000000",
|
66
|
+
"back_opacity": 0.445800
|
67
|
+
}
|
68
|
+
}
|
69
|
+
elif state == "pressed":
|
70
|
+
return {
|
71
|
+
"radius": 2,
|
72
|
+
"thumb": {
|
73
|
+
"radius": 12,
|
74
|
+
"inner_radius": 5,
|
75
|
+
|
76
|
+
"back_color": "#FFFFFF",
|
77
|
+
"back_opacity": 1,
|
78
|
+
|
79
|
+
"border_color": "#000000",
|
80
|
+
"border_color_opacity": 0.058824,
|
81
|
+
|
82
|
+
"border_color2": "#000000",
|
83
|
+
"border_color2_opacity": 0.160784,
|
84
|
+
|
85
|
+
"inner_back_color": get_primary_color()[0],
|
86
|
+
"inner_back_opacity": 0.8,
|
87
|
+
},
|
88
|
+
"track": {
|
89
|
+
"width": 4,
|
90
|
+
|
91
|
+
"back_color": get_primary_color()[0],
|
92
|
+
"back_opacity": 1
|
93
|
+
},
|
94
|
+
"rail": {
|
95
|
+
"back_color": "#000000",
|
96
|
+
"back_opacity": 0.445800
|
97
|
+
}
|
98
|
+
}
|
99
|
+
elif state == "disabled":
|
100
|
+
return {
|
101
|
+
"radius": 2,
|
102
|
+
"thumb": {
|
103
|
+
"radius": 12,
|
104
|
+
"inner_radius": 6,
|
105
|
+
|
106
|
+
"back_color": "#FFFFFF",
|
107
|
+
"back_opacity": 1,
|
108
|
+
|
109
|
+
"border_color": "#000000",
|
110
|
+
"border_color_opacity": 0.058824,
|
111
|
+
|
112
|
+
"border_color2": "#000000",
|
113
|
+
"border_color2_opacity": 0.160784,
|
114
|
+
|
115
|
+
"inner_back_color": "#000000",
|
116
|
+
"inner_back_opacity": 0.317300,
|
117
|
+
},
|
118
|
+
"track": {
|
119
|
+
"width": 4,
|
120
|
+
|
121
|
+
"back_color": "#000000",
|
122
|
+
"back_opacity": 0.216900
|
123
|
+
},
|
124
|
+
"rail": {
|
125
|
+
"back_color": "#000000",
|
126
|
+
"back_opacity": 0.317300
|
127
|
+
}
|
128
|
+
}
|
129
|
+
else:
|
130
|
+
if state == "rest":
|
131
|
+
return {
|
132
|
+
"radius": 2,
|
133
|
+
"thumb": {
|
134
|
+
"radius": 12,
|
135
|
+
|
136
|
+
"inner_radius": 6,
|
137
|
+
"inner_back_color": get_primary_color()[1],
|
138
|
+
"inner_back_opacity": 1,
|
139
|
+
|
140
|
+
"back_color": "#454545",
|
141
|
+
"back_opacity": 1,
|
142
|
+
|
143
|
+
"border_color": "#FFFFFF",
|
144
|
+
"border_color_opacity": 0.094118,
|
145
|
+
|
146
|
+
"border_color2": "#FFFFFF",
|
147
|
+
"border_color2_opacity": 0.070588,
|
148
|
+
|
149
|
+
},
|
150
|
+
"track": {
|
151
|
+
"width": 4,
|
152
|
+
|
153
|
+
"back_color": get_primary_color()[1],
|
154
|
+
"back_opacity": 1
|
155
|
+
},
|
156
|
+
"rail": {
|
157
|
+
"back_color": "#FFFFFF",
|
158
|
+
"back_opacity": 0.544200
|
159
|
+
}
|
160
|
+
}
|
161
|
+
elif state == "hover":
|
162
|
+
return {
|
163
|
+
"radius": 2,
|
164
|
+
"thumb": {
|
165
|
+
"radius": 12,
|
166
|
+
|
167
|
+
"inner_radius": 8,
|
168
|
+
"inner_back_color": get_primary_color()[1],
|
169
|
+
"inner_back_opacity": 1,
|
170
|
+
|
171
|
+
"back_color": "#454545",
|
172
|
+
"back_opacity": 1,
|
173
|
+
|
174
|
+
"border_color": "#FFFFFF",
|
175
|
+
"border_color_opacity": 0.094118,
|
176
|
+
|
177
|
+
"border_color2": "#FFFFFF",
|
178
|
+
"border_color2_opacity": 0.070588,
|
179
|
+
|
180
|
+
},
|
181
|
+
"track": {
|
182
|
+
"width": 4,
|
183
|
+
|
184
|
+
"back_color": get_primary_color()[1],
|
185
|
+
"back_opacity": 1
|
186
|
+
},
|
187
|
+
"rail": {
|
188
|
+
"back_color": "#FFFFFF",
|
189
|
+
"back_opacity": 0.544200
|
190
|
+
}
|
191
|
+
}
|
192
|
+
elif state == "pressed":
|
193
|
+
return {
|
194
|
+
"radius": 2,
|
195
|
+
"thumb": {
|
196
|
+
"radius": 12,
|
197
|
+
|
198
|
+
"inner_radius": 5,
|
199
|
+
"inner_back_color": get_primary_color()[1],
|
200
|
+
"inner_back_opacity": 0.8,
|
201
|
+
|
202
|
+
"back_color": "#454545",
|
203
|
+
"back_opacity": 1,
|
204
|
+
|
205
|
+
"border_color": "#FFFFFF",
|
206
|
+
"border_color_opacity": 0.094118,
|
207
|
+
|
208
|
+
"border_color2": "#FFFFFF",
|
209
|
+
"border_color2_opacity": 0.070588,
|
210
|
+
|
211
|
+
},
|
212
|
+
"track": {
|
213
|
+
"width": 4,
|
214
|
+
|
215
|
+
"back_color": get_primary_color()[1],
|
216
|
+
"back_opacity": 1
|
217
|
+
},
|
218
|
+
"rail": {
|
219
|
+
"back_color": "#FFFFFF",
|
220
|
+
"back_opacity": 0.544200
|
221
|
+
}
|
222
|
+
}
|
223
|
+
elif state == "disabled":
|
224
|
+
return {
|
225
|
+
"radius": 2,
|
226
|
+
"thumb": {
|
227
|
+
"radius": 12,
|
228
|
+
|
229
|
+
"inner_radius": 6,
|
230
|
+
"inner_back_color": "#FFFFFF",
|
231
|
+
"inner_back_opacity": 0.158100,
|
232
|
+
|
233
|
+
"back_color": "#454545",
|
234
|
+
"back_opacity": 1,
|
235
|
+
|
236
|
+
"border_color": "#FFFFFF",
|
237
|
+
"border_color_opacity": 0.094118,
|
238
|
+
|
239
|
+
"border_color2": "#FFFFFF",
|
240
|
+
"border_color2_opacity": 0.070588,
|
241
|
+
|
242
|
+
},
|
243
|
+
"track": {
|
244
|
+
"width": 4,
|
245
|
+
|
246
|
+
"back_color": "#FFFFFF",
|
247
|
+
"back_opacity": 0.158100
|
248
|
+
},
|
249
|
+
"rail": {
|
250
|
+
"back_color": "#FFFFFF",
|
251
|
+
"back_opacity": 0.544200
|
252
|
+
}
|
253
|
+
}
|