tkfluent 0.0.2__py3-none-any.whl → 0.0.4__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 CHANGED
@@ -9,18 +9,29 @@ Fluent设计的tkinter组件库(模板)
9
9
 
10
10
  from .badge import FluBadge
11
11
  from .button import FluButton
12
+ from .constants import *
12
13
  from .entry import FluEntry
13
14
  from .frame import FluFrame
14
15
  from .label import FluLabel
16
+ from .menu import FluMenu
17
+ from .menubar import FluMenuBar
18
+ from .popupmenu import FluPopupMenu, FluPopupMenuWindow
19
+ from .popupwindow import FluPopupWindow
15
20
  from .text import FluText
16
21
  from .thememanager import FluThemeManager
17
22
  from .togglebutton import FluToggleButton
23
+ from .tooltip import FluToolTip
24
+ from .toplevel import FluToplevel
18
25
  from .window import FluWindow
26
+ #from .winico import FluWinico
27
+
19
28
 
20
29
  FluChip = FluBadge
21
30
  FluPushButton = FluButton
22
31
  FluTextInput = FluEntry
23
32
  FluTextBox = FluText
24
33
  FluPanel = FluFrame
34
+ FluMainWindow = FluWindow
35
+ FluSubWindow = FluToplevel
25
36
 
26
37
  # 
tkflu/__main__.py CHANGED
@@ -3,13 +3,46 @@ from tkinter import *
3
3
  from tkinter.font import *
4
4
 
5
5
  root = FluWindow()
6
- root.iconify
7
- root.wincustom(way=0)
8
- root.wm_geometry("180x360")
6
+ #root.wincustom(way=0)
7
+ root.wm_geometry("360x500")
8
+
9
+ popupmenu = FluPopupMenu()
9
10
 
10
11
  thememanager = FluThemeManager()
11
12
 
12
- frame = FluFrame()
13
+ menubar = FluMenuBar(root)
14
+ menubar.add_command(
15
+ label="FluMenu1", width=80, command=lambda: print("FluMenu1 -> Clicked")
16
+ )
17
+
18
+ menu1 = FluMenu()
19
+ menu1.add_command(
20
+ label="FluMenu2-1", width=80, command=lambda: print("FluMenu2-1 -> Clicked")
21
+ )
22
+ menubar.add_cascade(
23
+ label="FluMenu2", width=80, menu=menu1
24
+ )
25
+
26
+ menu2 = FluMenu(height=93)
27
+ menu2.add_command(
28
+ label="FluMenu3-1", width=80, command=lambda: print("FluMenu3-1 -> Clicked")
29
+ )
30
+
31
+ menu3 = FluMenu(height=46, width=10)
32
+ menu3.add_command(
33
+ label="FluMenu3-2-1", width=80, command=lambda: print("FluMenu3-2-1 -> Clicked")
34
+ )
35
+
36
+ menu2.add_cascade(
37
+ label="FluMenu3-2", width=80, menu=menu3
38
+ )
39
+ menubar.add_cascade(
40
+ label="FluMenu3", width=80, menu=menu2
41
+ )
42
+
43
+ menubar.pack(fill="x", )
44
+
45
+ frame = FluFrame(root)
13
46
 
14
47
  badge1 = FluBadge(frame, text="FluBadge", width=60)
15
48
  badge1.pack(padx=5, pady=5)
@@ -27,6 +60,7 @@ button2 = FluButton(
27
60
  )
28
61
  button2.pack(fill="x", padx=5, pady=5)
29
62
 
63
+
30
64
  def toggle1():
31
65
  print(f"FluToggleButton -> Toggled -> Checked: {togglebutton1.dcget('checked')}")
32
66
  if togglebutton1.dcget('checked'):
@@ -34,6 +68,7 @@ def toggle1():
34
68
  else:
35
69
  thememanager.mode("light")
36
70
 
71
+
37
72
  togglebutton1 = FluToggleButton(
38
73
  frame, text="FluToggleButton", command=toggle1
39
74
  )
tkflu/badge.py CHANGED
@@ -121,11 +121,12 @@ class FluBadge(FluBadgeCanvas, DDrawWidget):
121
121
  fill=_text_color, text=self.attributes.text, font=self.attributes.font
122
122
  )
123
123
 
124
- def theme(self, mode, style=None):
125
- self.mode = mode
124
+ def theme(self, mode=None, style=None):
125
+ if mode:
126
+ self.mode = mode
126
127
  if style:
127
128
  self.style = style
128
- if mode.lower() == "dark":
129
+ if self.mode.lower() == "dark":
129
130
  if self.style.lower() == "accent":
130
131
  self._dark_accent()
131
132
  else:
@@ -138,7 +139,7 @@ class FluBadge(FluBadgeCanvas, DDrawWidget):
138
139
 
139
140
  def _light(self):
140
141
  self.dconfigure(
141
- back_color="#f0f0f0",
142
+ back_color="#f9f9f9",
142
143
  border_color="#f0f0f0",
143
144
  border_width=1,
144
145
  text_color="#191919",