1 Star 0 Fork 0

min/ttkbootstrap

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
贡献代码
同步代码
取消
提示: 由于 Git 不支持空文件夾,创建文件夹后会生成空的 .keep 文件
Loading...
README
MIT

Downloads Downloads

ttkbootstrap

English | 中文

tkinter的超强主题扩展,可实现受Bootstrap启发的按需现代平面风格主题。

👀 阅读文档

版本 1.0 是库的完全重建。 如果您使用的是0.5版本 ,则在尝试使用themes.json导入主题时可能会遇到问题,因为这已从1.0中删除。现在,您可以使用 ttkcreator 直接导入和保存主题。

📦 特点

✔️ 内置主题
十几个精心策划的深色浅色主题

✔️ 预定义样式:
大量漂亮的预定义构件样式,如轮廓圆形切换按钮。

✔️ 简单的关键字 API:
使用简单的关键字(如primarystriped)应用颜色和类型,而不是使用主要的旧方法Striped.Horizontal.TProgressbar。如果您已经使用Bootstrap进行Web开发,那么您已经熟悉了使用css类的这种方法。

✔️ 许多新的小部件:
ttkbootstrap附带了几个设计精美的新小部件,如MeterDateEntryFloodgauge。 此外,对话框现在具有主题和完全可自定义性。

✔️ 内置主题创建器:
想要创建自己的主题?容易!ttkbootstrap附带一个内置的主题创建器,使您能够轻松构建,加载,浏览和应用自己的自定义主题。

安装

python -m pip install ttkbootstrap

简单示例

您可以使用带有“bootstyle”参数的简单关键字,而不是使用长而复杂的ttk样式类。

import ttkbootstrap as ttk
from ttkbootstrap.constants import *

root = ttk.Window(themename="superhero")

b1 = ttk.Button(root, text="Submit", bootstyle="success")
b1.pack(side=LEFT, padx=5, pady=10)

b2 = ttk.Button(root, text="Submit", bootstyle="info-outline")
b2.pack(side=LEFT, padx=5, pady=10)

root.mainloop()

新的关键字API非常灵活。以下示例均产生相同的结果:

  • bootstyle="info-outline"
  • bootstyle="info outline"
  • bootstyle=("info", "outline")
  • bootstyle=(INFO, OUTLINE)

链接:

MIT License Copyright (c) 2021 Israel Dryer Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

简介

暂无描述 展开 收起
README
MIT
取消

发行版

暂无发行版

贡献者

全部

语言

近期动态

不能加载更多了
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/minibox/ttkbootstrap.git
git@gitee.com:minibox/ttkbootstrap.git
minibox
ttkbootstrap
ttkbootstrap
master

搜索帮助