Releases: Xiaokang2022/tkintertools
3.0.0rc4
Full Changelog / 完整更新日志: CHANGELOG.md#-300rc4
Full Commits / 完整提交记录: 3.0.0rc3...3.0.0rc4
✨ Highlights / 更新亮点
-
Refactoring the entire event handling mechanism to now bind and handle events almost exactly like native
tkinter
重构整个事件处理机制,现在几乎可以完全像原生tkinter
那样绑定和处理事件了 -
Fixed a bug where the widget
InputBox
could produce an error when deleting text
修复了控件InputBox
在删除文本时可能产生错误的 bug
💥 Breaking Changes / 破坏性更改
-
Refactored submodule
core.constants
and renamed tocore.configs
重构子模块core.constants
并重命名为core.configs
-
Removed useless submodule
standard._auxiliary
移除了无用子模块standard._auxiliary
-
The function
toolbox.set_mouse_position
has been removed and will be moved to a different project in the future
移除了函数toolbox.set_mouse_position
,后续会将其移动到其它项目中
3.0.0rc3
Full Changelog / 完整更新日志: CHANGELOG.md#-300rc3
Full Commits / 完整提交记录: 3.0.0rc2...3.0.0rc3
✨ Highlights / 更新亮点
-
New widget, tooltip (
Tooltip
)
新增控件,工具提示框(Tooltip
) -
All widgets have a new initialization parameter,
anchor
, to specify the anchor location
所有控件都新增了初始化参数anchor
来指定锚点位置 -
New methods
bind
,unbind
,bind_on_update
andunbind_on_update
for all widgets
所有控件新增方法bind
、unbind
、bind_on_update
和unbind_on_update
-
Some code outputs an error message in stderr when it causes a problem, rather than no output at all (e.g., when a function in a theme switching thread throws an error)
部分代码产生问题时会在标准错误输出中输出错信息,而不是不产生任何输出(如主题切换线程中的函数引发错误时)
💥 Breaking Changes / 破坏性更改
-
Parameter names for some functions have been changed (the original name violates lint)
部分函数的参数名称发生的改变(原名称违背了 lint)SegmentedButton
Text
TkMessage
set_theme_map
hsl_to_rgb
rgb_to_hsl
rgb_to_str
3.0.0rc2
🟢 Added / 新增
-
Implemented the ability to play videos, see https://github.com/Xiaokang2022/tkintertools-media
实现了播放视频的功能,见:https://github.com/Xiaokang2022/tkintertools-media -
Added a parameter called
anchor
toImage
Image
增加了一个名为anchor
的参数 -
Added some aliases
增加了一些别名 -
Added method
resize
to classPhotoImage
类PhotoImage
增加了方法resize
-
Added a
callback
parameter to theset
method of the relevant widget to control whether the callback function is also called when the method is called
相关小部件的set
方法增加了参数callback
来控制当该方法被调用时回调函数是否被调用
🟡 Changed / 变更
-
Changed default value of parameter
anchor
ofText
修改了Text
的参数anchor
的默认值 -
Changed the API of
SegmentedButton
修改了SegmentedButton
的 API
🟣 Fixed / 修复
-
Fixed a bug where widget
SegmentedButton
had incorrect function bindings
修复了SegmentedButton
的函数绑定不正确的 bug -
Fixed a bug where disabling styles would not recalculate
修复了禁用样式不会重复计算的 bug -
Fixed a bug where fonts could not be loaded on Linux OS
修复了字体加载函数在 Linux 操作系统上不生效的 bug -
Fixed a bug where the return value of method
alpha
of classTk
was incorrect
修复了Tk
的方法alpha
的返回值不正确的 bug -
Fixed a bug where some methods of class
Tk
were called and the window style was lost
修复了类Tk
的某些方法被调用时会导致窗口丢失样式的 bug -
Fixed some incorrect type hints and missing parameters
修复了一些不正确的类型提示和丢失的参数 -
Fixed a bug where the widget
Image
must be forced to initialize the image parameter, otherwise an error may be reported
修复了小部件Image
必须强制指定图片,否则会报错的 bug
🔵 Optimized / 优化
-
Optimized method
shutdown
of classTk
优化了类Tk
的方法shutdown
-
The font loading function has been optimized so that parameter
private
has a certain effect on Linux systems
字体加载函数被优化使得其private
参数能在 Linux 操作系统上产生一定的作用 -
Class
MoveTkWidget
has been optimized to prevent it from getting widget data that is not up to date
类MoveTkWidget
被优化以防止其获取到的小部件数据不是最新的 -
Improved doc string
改善了文档字符串
🔴 Removed / 移除
- Removed initialization parameter
transient
of classToplevel
移除了类Toplevel
的初始化参数transient
3.0.0rc1
🟢 Added / 新增
-
The widget
Text
added methodsget
andset
to get and modify its text content
小部件Text
添加了get
和set
方法,用于获取和修改其文本内容 -
Added widget
Image
添加了小部件:Image
-
Added container widget
Frame
to assist with layout
添加了容器小部件Frame
以协助布局 -
The container widget
Canvas
has added the methodclear
to clear everything drawn inside it
容器小部件Canvas
添加了clear
方法,以清除其中绘制的所有内容 -
Widgets can now be nested within widgets
小部件现在可以嵌套在小部件中了 -
The submodule
tools
added a functionget_text_size
to get the size of the text
子模块tools
添加了一个函数get_text_size
用于获取文本的大小 -
Added the incomplete Select All function, which can select all, but due to the imperfection of the function of selecting the text with the mouse, the Select All function cannot select the undisplayed text
新增了不完整的全选功能,可以全选,但由于鼠标选择文本的功能不完善,导致全选功能无法选择未显示的文本 -
virtual.Widget
has a new method calleddetect
to determine the range based on the data of the widget itself
virtual.Widget
新增了一个名为detect
的方法,其根据小部件本身的数据确定的范围来进行检测 -
Added
HalfRoundedRectangular
shape class
添加了形状类HalfRoundedRectangular
-
Added widget:
ToggleButton
添加了小部件:ToggleButton
-
Added widget:
SegmentedButton
添加了小部件:SegmentedButton
-
Added widget:
SpinBox
添加了小部件:SpinBox
-
The subpackage
standard
added an internal submodule_auxiliary
to define some auxiliary widgets
子包standard
添加了一个内部子模块_auxiliary
来定义一些辅助小部件 -
The
GOLDEN_RATIO
constant has been added
增加了常量GOLDEN_RATIO
-
Added experimental implementations of widgets
OptionButton
andComboBox
添加了小部件OptionButton
和ComboBox
的实验性实现
🔴 Removed / 移除
-
The code for the
matplotlib
related interface part is separated
将matplotlib
相关接口部分的代码分离了 -
Due to some conflicts, the binding and handling of the mouse double-click event has been removed
由于存在一些冲突,删除了鼠标双击事件的绑定和处理
🟡 Changed / 变更
-
Re-change the text defaults of the widget to an empty string
将小部件的文本默认值重新更改为空字符串 -
Rename the widgets
Entry
andInformation
toInputBox
andText
, respectively
将小部件Entry
和Information
分别重命名为InputBox
和Text
-
The "Feature" suffix has been added to the class names of several
Feature
classes to prevent them from being indistinguishable from theWidget
class in the error message
“Feature” 后缀已添加到多个Feature
类的类名中,以防止它们与错误消息中的Widget
类无法区分
🔵 Optimized / 优化
-
Optimized decision detection for
Oval
andSemicircularRectangle
优化了Oval
和SemicircularRectangle
的检测判定方法 -
The
Switch
widget added more animations
Switch
添加了更多动画 -
Shape
scaling has been improved: the scale has been changed from direct scaling to calculating the position to prevent the proportions of some parts from being broken
改进了Shape
的缩放:缩放已从直接缩放更改为计算位置后缩放,以防止某些部分的比例被破坏 -
All widgets that involve text now do not need to be forced to specify the size at initialization, and it automatically calculates the size of text without line breaks
现在,所有涉及文本的小部件都不需要在初始化时强制指定大小,它会自动计算没有换行符的文本的大小 -
Optimized the
RoundedRectangle
subclass of theShape
class
优化了Shape
的子类RoundedRectangle
-
Improved the docstrings, error messages, and warning messages
改善了文档字符串、错误消息和警告消息
🟣 Fixed / 修复
-
Fixed a bug where
IconButton
was missing style files
修复了IconButton
缺少样式文件的 bug -
Fixed a bug where the
Slider
could be activated unexpectedly when disabled
修复了Slider
在禁用时可能会意外激活的 bug -
Fixed a bug where text had no effect on modifying its properties after scaling
修复了文本在缩放后修改其属性不起作用的 bug -
Fixed a bug where some widgets with default values could repeatedly call the method
set
, causing the widget appearance to be misaligned
修复了某些具有默认值的小部件可能会重复调用方法set
从而导致小部件外观错位的 bug -
Fixed a bug where some highly custom widgets would report an error when zooming
修复了某些高度自定义的小部件在缩放时会报错的 bug
🟤 Refactored / 重构
-
Refactored the
style
subpackage, reformatted the style file, and now supports two ways to import themes. That is, import as a JSON file, or directly import using a Python file
重构了style
子包,重新格式化了样式文件,现在支持两种导入主题的方式。即使用 JSON 文件导入,或直接使用 Python 文件导入 -
Removed the original JSON format style file, and added
theme
subpackage to store the style data as a Python file, so as to solve the bug that the default style file is lost in project packaging
移除了原有的 JSON 格式样式文件,并添加了theme
子包,将样式数据存储为 Python 件,从而解决了项目打包时默认样式文件丢失的 bug
3.0.0.beta4
🟢 Added / 新增
-
The widget
Entry
has a new parameterplaceholder
to display the prompt information
小部件Entry
新增了参数placeholder
来实现提示信息的显示 -
Added parameter
show
to the widgetEntry
to mask characters (e.g. password box)
小部件Entry
新增了参数show
来实现字符的掩盖(如密码框) -
The new parameter
align
has been added to the widgetEntry
to achieve a similar effect to thetext-align
of tags in HTML, i.e. the left, right, and center layout of the text
小部件Entry
新增了参数align
来实现于 HTML 里的标签的text-align
类似的效果,即文本的靠左、靠右和居中布局 -
The widget
Entry
has been added to move the text prompt by pressing the left and right keys on the keyboard
小部件Entry
新增了通过按下键盘的左右键来移动文本提示符的功能 -
Added text selection to the widget
Entry
小部件Entry
新增了文本选中的功能 -
The widget
Entry
has added shortcuts to copy (Ctrl+C), paste (Ctrl+V) and cut (Ctrl+X)
小部件Entry
新增了快捷键复制(Ctrl+C)、粘贴(Ctrl+V)和剪切(Ctrl+X)的功能 -
Added widget slider (
Slider
)
新增了小部件滑动条(Slider
) -
Added widget icon button (
IconButton
)
新增了小部件图标按钮(IconButton
) -
Added some missing docstrings
增加了部分缺失的文档字符串
🟡 Changed / 变更
-
The color of the widget
Entry
has been changed slightly under Windows 10 to enhance the look
小部件Entry
在 Windows 10 操作系统下的颜色略有改变,以提升观感 -
The position of the text of the widget
Entry
in the text box has been slightly corrected to improve the look
小部件Entry
的文本在文本框中的位置被稍微修正了一下,以提升观感
🟣 Fixed / 修复
- Fixed a bug where deleting text from the widget
Entry
in some cases would cause the program to loop in an endless loop
修复了小部件Entry
某些情况下删除文本会导致程序死循环的问题
🔵 Optimized / 优化
- Improved the readability of some codes
增强了部分代码的可读性
🔴 Removed / 移除
-
Widget
Entry
removed the parametersjustify
andanchor
小部件Entry
移除了参数justify
和anchor
-
Removed the 3D part of the code and related theme files
移除了 3D 部分代码以及相关主题文件
Thank you for your support of this project! ❤️
感谢各位对本项目的支持!❤️
3.0.0.beta3
🟢 Added / 新增
-
The docstrings for a portion of the code has been added
添加了一部分代码的文本字符串 -
animation.animations
has added classMoveTkWidget
to move a tkinter widget
animation.animations
新增类MoveTkWidget
来移动一个 tkinter 小部件 -
core.containers.Canvas
added the parametername
to bind the theme
core.containers.Canvas
新增参数name
来绑定主题 -
core.containers.Canvas
added method_zoom_children
to scale the tkinter widget of the Place layout
core.containers.Canvas
新增方法_zoom_children
来实现对 Place 布局的 tkinter 小部件的缩放 -
Introduce the optional third-party package
pillow
and add a new classPhotoImage
intoolbox.enhanced
to improve image scaling performance
引入可选的第三方包pillow
并在toolbox.enhanced
新增类PhotoImage
以提高图片缩放的性能 -
Introduce an optional third-party package
matplotlib
and add a new modulempl
totoolbox
to achieve compatibility withmatplotlib
related interfaces
引入可选的第三方包matplotlib
并在toolbox
中新增模块mpl
来实现对matplotlib
相关接口的兼容 -
toolbox.tools
adds the functionget_hwnd
to fetch the HWND of the widget
toolbox.tools
新增函数get_hwnd
来实现小部件的 HWND 的获取 -
toolbox.tools
adds a new functionembed_window
to embed a widget into another widget, which only works on Windows
toolbox.tools
新增函数embed_window
来将一个小部件嵌入到另外一个小部件中,仅在 Windows 系统中有效 -
toolbox.tools
adds a new functionscreen_size
to get the width and height of the screen
toolbox.tools
新增函数screen_size
来获取屏幕的宽度和高度 -
toolbox.tools
adds a new functionset_mouse_position
to set the mouse position, which only works on Windows
toolbox.tools
新增函数set_mouse_position
来设置鼠标的位置,仅在 Windows 系统中有效 -
toolbox.tools
adds a new function_forward_methods
to implement the forwarding of class methods
toolbox.tools
新增函数_forward_methods
来实现类方法的转发 -
Introduce optional third-party packages
pywinstyles
,win32material
andhPyT
, and add many new parameters tostyle.manager.customize_window
to implement the corresponding interfaces
引入可选的第三方包pywinstyles
、win32material
和hPyT
并在style.manager.customize_window
新增许多参数来实现对应的接口
🔴 Removed / 移除
-
Remove function
color.rgb._str_to_hex
, this function is useless
移除函数color.rgb._str_to_hex
,此函数无用 -
Remove class
core.containers.Dialog
, this class is useless
移除类core.containers.Dialog
,此类无用 -
Removed the class
core.containers.ChildWindow
and there is a better way to replace it
移除类core.containers.ChildWindow
,已有其它更好的替换方式 -
Remove redundant code from
three.engine
in preparation for the next refactoring
移除three.engine
中的冗余代码,为下个版本重构做准备
🟡 Changed / 变更
-
animation.animations.Gradient
renamed toGradientItem
animation.animations.Gradient
更名为GradientItem
-
The value of
core.constants.SIZE
has been changed from -24 to -20 (a value close to the system text size)
core.constants.SIZE
的值从 -24 更改为 -20(与系统文本大小接近的值) -
The default size of most widgets has been reduced to accommodate the font size change
大部分小部件的默认大小缩小了,以配合字体大小的变更 -
style.theme
is renamed tomanager
to avoid having the same name as the theme folder
style.theme
更名为manager
,避免跟主题文件夹 theme 重名 -
The rules for storing theme files have been completely changed, as shown in the module docstring for
style.parser
主题文件存放规则完全更改,具体见style.parser
的模块文档字符串 -
style.theme.custom_window
renamed tostyle.manager.customize_window
style.theme.custom_window
更名为style.manager.customize_window
-
three.engine.Side
renamed tothree.engine.Plane
three.engine.Side
更名为three.engine.Plane
🔵 Optimized / 优化
- Now the third-party package
darkdetect
is no longer required, but optional. When this package is missing, some features will be unavailable
现在第三方包darkdetect
不是必需的了,而是可选的。当缺少此包,将导致部分功能不可用
🟣 Fixed / 修复
-
Fixed some incorrect docstrings
修正了部分错误的文档字符串 -
Fixed an issue where the subject response event was not removed when the window was closed
修复了窗口关闭时未删去主题响应事件的问题 -
Fixed an issue where the widget style did not change completely in some cases when the widget was disabled
修复了小部件禁用时,部分情况下小部件样式未完全更改的问题
🟤 Refactored / 重构
-
core.virtual
refactoring to remove redundant code and optimize existing code
core.virtual
重构,删去冗余代码,优化已有代码 -
style
refactored
style
重构
Thank you for your support of this project! ❤️
感谢各位对本项目的支持!❤️
3.0.0.beta2
🟢 Added / 新增
-
The docstrings for a portion of the code has been added
添加了一部分代码的文本字符串 -
Modules have added a special variable
__all__
模块都增加了特殊变量__all__
-
Subpackage
color
Added modulehsl
to support HSL color coding
子包color
新增模块hsl
以支持 HSL 颜色码 -
The submodule
constants
adds the functionreset
to reset all constants to default
子模块constants
新增函数reset
来重置所有常量为默认值 -
The submodule
theme
of the sub-packagestyle
has added the functionset_color_theme
to use the external theme
子包style
的子模块theme
新增函数set_color_theme
来使用外部主题 -
Added subpackage
toolbox
and functionload_font
to introduce external font files
新增子包toolbox
以及函数load_font
来引入外部字体文件 -
Submodule
enhanced
of sub-packagetoolbox
adds classPhotoImage
子包toolbox
的子模块enhanced
新增类PhotoImage
-
The submodule
tools
class_Trigger
has been further enhanced by the addition of methodslock
andunlock
and related properties
子模块tools
的类_Trigger
新增方法lock
和unlock
以及相关属性,来进一步增强它的功能 -
The submodule
images
has added a classStillImage
to support png type static images
子模块images
新增类StillImage
来支持 png 类型的静态图片 -
Virtual Picture Base Class
virtual.Image
implements the relevant methods
虚拟图片基类virtual.Image
实现了相关方法 -
The virtual widget base class
virtual.Widget
added new methodsappear
anddisappear
to hide and reproduce the widget as a whole
虚拟小部件基类virtual.Widget
新增了方法appear
和disappear
来实现小部件整体的隐藏和再现
🟡 Changed / 变更
-
The classes
Message
,ColorChooser
, andFontChooser
of the submoduledialogs
have been renamedTkMessage
,TkColorChooser
, andTkFontChooser
, respectively
子模块dialogs
的类Message
、ColorChooser
和FontChooser
分别更名为TkMessage
、TkColorChooser
和TkFontChooser
-
The function
tkintertools.style.theme.use_theme
is renamed toset_color_mode
函数tkintertools.style.theme.use_theme
更名为set_color_mode
-
The rotation event of the class
Space
of the subpackthree
has been changed from the original left-mouse button to the middle mouse button
子包three
的类Space
的旋转事件由原来的鼠标左键触发更改为鼠标中键触发
🔵 Optimized / 优化
-
Optimized the implementation of the function
custom_window
of the submoduletheme
to prevent it from taking effect in some cases
优化了子模块theme
的函数custom_window
的实现方式,防止某些情况下无法生效 -
All container widgets have been optimized to prevent the functionality from working under certain conditions
所有容器小部件都得到了优化,防止某些条件下会出现相关功能未生效的情况 -
All virtual widgets are perfected with initialization parameters
所有虚拟小部件都完善了初始化参数
🟤 Refactored / 重构
-
Core code refactoring, from module
core.py
to sub-packagecore
核心代码重构,由模块core.py
重构为子包core
-
Subpackage
three
refactoring
子包three
重构
Thank you for your support of this project! ❤️
感谢各位对本项目的支持!❤️
3.0.0.beta1
After 8 months of refactoring work (10 dev releases, 7 alpha releases, 1 beta release), TkinterTools has made the leap from Gen 2 to Gen 3 🚀! But tkintertools 3 is still in a beta state, and I don't recommend using it directly in a production environment, as it currently has some issues to be resolved, and the API may not be fully determined.
经过 8 个月的重构工作(10 个 dev 版本,7 个 alpha 版本,1 个 beta 版本),tkintertools 已经从第 2 代版本跃升至第 3 代了 🚀!但 tkintertools 3 仍处于一个测试状态,我不推荐你直接再生产环境中使用它,因为它目前存在一些问题有待解决,而且 API 可能也没有完全确定。
In conclusion, tkintertools 3
has entered the public beta state 🎉! You can install it with the following command:
总之,tkintertools 3
进入了 beta 版本的公开测试状态 🎉!你可以通过下面的命令来安装它:
pip install tkintertools==3.0.0b1
But no matter what, I would like to thank everyone for their support of this project ❤️! I hope that there will be more and more ⭐ in this project!
但无论如何,我都要感谢大家对本项目的支持 ❤️ !希望本项目的 ⭐ 可以越来越多吧!
✨ What 's New - 更新内容
Note
Due to the large number of updates, I won't release it here, you can go to the changelog on the official website of tkintertools to view!
由于更新内容较多,这里就不放出来了,大家可以去 tkintertools 官网更新日志进行查看!
👀 Preview - 预览
The following preview pictures are all the effects produced by the same Demo, there are many Demo codes, and they are not shown here, you can go to the official website of tkintertools Update Notes to view.
下面的预览图都是同一个 Demo 产生的效果,Demo 代码较多,这里同样不展示,大家可自行去 tkintertools 官网更新说明处查看。
Unfortunately, there is no documentation available for your reference.
不过有件事很遗憾,就是目前并没有可用的文档供大家参考。
Thank you to my friends who helped me test on other platforms!
感谢帮助我对其它平台测试的朋友们!