├── .gitignore ├── .vscode └── launch.json ├── ChangeLog.txt ├── LOGO.ico ├── README.md ├── Segoe Fluent Icons.ttf ├── TinUI.code-workspace ├── TinUI.py ├── TinUIDialog.py ├── __init__.py ├── docs ├── CNAME ├── README.md ├── changelog │ ├── ChangeLog.txt │ └── ver.txt ├── contributors │ └── index.md ├── test │ └── index.md └── widget │ └── info.json ├── extension.py ├── gpl-3.0.md ├── image ├── LOGO.png ├── TinUI便笺.gif ├── TinUI信息提示对话框.gif ├── TinUI元素等待框.gif ├── TinUI内置ui.gif ├── TinUI分割线.gif ├── TinUI列表框.gif ├── TinUI列表视图.gif ├── TinUI刷新可视范围.gif ├── TinUI单选框.gif ├── TinUI单选组控件.gif ├── TinUI可折叠UI.gif ├── TinUI图片1.gif ├── TinUI复选框.gif ├── TinUI密码输入框.gif ├── TinUI工具栏按钮组件.gif ├── TinUI开关.gif ├── TinUI按钮.gif ├── TinUI按钮2.gif ├── TinUI支点标题.gif ├── TinUI文本框.gif ├── TinUI明亮样式.gif ├── TinUI标签.gif ├── TinUI标签栏视图.gif ├── TinUI标题边框.gif ├── TinUI树状图.gif ├── TinUI横向翻页视图.gif ├── TinUI气泡提示.gif ├── TinUI浮出ui控件.gif ├── TinUI滑动控件.gif ├── TinUI滚动条.gif ├── TinUI滚动选择框.gif ├── TinUI状态开关按钮.gif ├── TinUI画布.gif ├── TinUI窗口提示.gif ├── TinUI等待1.gif ├── TinUI等待2.gif ├── TinUI等待3.gif ├── TinUI组合框.gif ├── TinUI绘制组件.gif ├── TinUI菜单.gif ├── TinUI菜单按钮.gif ├── TinUI表格.gif ├── TinUI评星级控件.gif ├── TinUI调节框.gif ├── TinUI起步.gif ├── TinUI输入框.gif ├── TinUI进度条.gif ├── TinUI选值框.gif ├── TinUI黑暗样式.gif └── 超链接.gif ├── lgpl-3.md ├── test ├── LOGO.png ├── button.py ├── checkbutton.py ├── combobox.py ├── entry.py ├── extension.buttonlize.py ├── image.py ├── link.py ├── listbox.py ├── listview.py ├── maintest.py ├── onoff.py ├── pivot.py ├── progressbar.py ├── radiobox.py ├── radiobutton.py ├── ratingbar.py ├── scalebar.py ├── swipecontrol.py ├── table.py ├── test.py ├── testpage │ ├── TinUIXml.xml │ ├── back.xml │ ├── barbutton.xml │ ├── button.xml │ ├── button2.xml │ ├── canvas.xml │ ├── checkbutton.xml │ ├── combobox.xml │ ├── entry.xml │ ├── expander.xml │ ├── flyout.xml │ ├── image.xml │ ├── info.xml │ ├── label.xml │ ├── labelframe.xml │ ├── link.xml │ ├── listbox.xml │ ├── listview.xml │ ├── main.xml │ ├── menubar.xml │ ├── menubutton.xml │ ├── notebook.xml │ ├── notecard.xml │ ├── onoff.xml │ ├── paragraph.xml │ ├── passwordbox.xml │ ├── picker.xml │ ├── pipspager.xml │ ├── pivot.xml │ ├── progressbar.xml │ ├── radiobox.xml │ ├── radiobutton.xml │ ├── ratingbar.xml │ ├── scalebar.xml │ ├── scrollbar.xml │ ├── separate.xml │ ├── spinbox.xml │ ├── swipecontrol.xml │ ├── table.xml │ ├── textbox.xml │ ├── title.xml │ ├── togglebutton.xml │ ├── tooltip.xml │ ├── treeview.xml │ ├── ui.xml │ ├── waitbar.xml │ └── waitframe.xml ├── tuxml.py ├── tuxmltest.py ├── ui.py ├── window.py └── xmltestpage │ ├── main.xml │ ├── marks.xml │ └── pytest.xml └── theme ├── gotheme.py ├── themeauto.py ├── tinuidark.py ├── tinuidarkorange.py ├── tinuidarkpurple.py ├── tinuilight.py ├── tinuilightcyan.py ├── tinuilightred.py ├── tinuimoderndark.py ├── tinuimodernlight.py └── window.py /.gitignore: -------------------------------------------------------------------------------- 1 | TODO.txt 2 | *.pyc 3 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // 使用 IntelliSense 了解相关属性。 3 | // 悬停以查看现有属性的描述。 4 | // 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "configurations": [ 7 | { 8 | "name": "Python: Current File", 9 | "type": "debugpy", 10 | "request": "launch", 11 | "program": "${file}", 12 | "console": "integratedTerminal", 13 | "justMyCode": true, 14 | "cwd": "${fileDirname}" 15 | } 16 | ] 17 | } -------------------------------------------------------------------------------- /ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (C) <2021-present> 3 | 2019(原型框架)2021(正式命名TinUI发布) 4 | 基于GPLv3和LGPLv3发布 5 | 6 | ==========更新日志========== 7 | 8 | 9 | ==========5.29========== 10 | 2025- 11 | 1. button2改为鼠标松开后执行回调函数,样式恢复逻辑改为鼠标松开 12 | 13 | ==========5.28========== 14 | 2025-6-7 15 | 1. ratingbar增加返回背景元素 16 | 2. pivot增加选择函数 17 | 3. entry, passwordbox增加过渡响应颜色 18 | 19 | ==========5.27========== 20 | 2025-5-12 21 | 1. 标准样式库添加back元素 22 | 2. ratingbar添加选择评级方法 23 | 24 | ==========5.26========== 25 | 2025-4-22 26 | 1. 修复treeview以子树结尾时展开错误的问题 27 | 28 | ==========5.25========== 29 | 2025-4-12 30 | 1. 修复tinuixmltest的正则表达式错误 31 | 2. togglebutton添加开关方法 32 | 33 | ==========5.24========== 34 | 2025-3-21 35 | 1. onoff可指定标识符字体大小 36 | 2. 修复listview删除最后一个元素后,仍然显示最后一个元素高度的问题 37 | 3. 修复listbox删除最后一个元素时发生的错误 38 | 39 | ==========5.23========== 40 | 2025-3-14 41 | 1. 修复entry, passwordbox提示线在TinUIXml下的错位问题 42 | 2. 修复spinbox强制锁定的问题 43 | 44 | ==========5.22========== 45 | 2025-3-9 46 | 1. 自带uixml的控件,在删除时也会删除TinUIXml 47 | 2. 修复theme错误 48 | 3. 修复对话框基类 49 | 50 | ==========5.21========== 51 | 2025-3-7 52 | 1. listbox添加清空功能 53 | 2. 基于TinUILight, TinUIDark的Dialog附加样式类 54 | 3. spinbox回车时,如果输入数据符合条件,则触发回调函数 55 | 4. radiobox方法增加select 56 | 57 | ==========5.20========== 58 | 2025-3-1 59 | 1. 修复listview清空或删除视图后页面元素仍占用内存的问题 60 | 2. 修复TinUIXml(allanchor)对齐方式分配id不唯一的问题 61 | 62 | ==========5.19========== 63 | 2025-2-27 64 | 1. listview增加清空方法 65 | 2. entry中有内容就显示删除按钮 66 | 3. 删除passwordbox输入判定 67 | 4. 优化entry, passwordbox提示符样式(不再支持linew参数) 68 | 69 | ==========5.18========== 70 | 2025-2-12 71 | 1. 修复列表选择对话框的尺寸错误问题 72 | 2. 超链接、菜单等包含函数类型的多接受类型参数,使用callable判断是否可调用 73 | 3. pivot初始化时不再自动触发选择 74 | 4. 浮出窗口在初始化后直接隐藏,等待调用 75 | 5. notebook标签标题与边框间隔2px 76 | 77 | ==========5.17========== 78 | 2025-2-8 79 | 1. TinUIXml下expander、flyout支持直接使用xml布局 80 | 2. 优化展示画廊配色,修改部分示例 81 | 3. 优化spinbox样式 82 | 4. 修复entry、passwordbox提示符颜色错误 83 | 5. button2添加过渡响应色 84 | 6. 如下控件按钮添加过渡响应色参数: 85 | button2, menu, menubutton, pipspager, expander, 86 | picker, barbutton 87 | 7. 如下控件背景适配改进贴合性: 88 | treeview, listbox(并且改为圆角边框), combobox, 89 | menu, menubutton 90 | 8. 修复TinUIXml下ui标签内绑定回调函数异常的错误 91 | 9. 修复treeview未选中时折叠和展开的错误 92 | 10. 修复togglebutton颜色转换时计算出错问题(防止溢出,对十六进制个位数补位) 93 | 94 | ==========5.15========== 95 | 2025-2-1 96 | 1. TinUIXml对齐支持整体对齐,使用lineachor参数控制对齐方式,该值不会向内传递 97 | 2. 新增浮出ui控件 flyout 98 | 3. listbox允许初始化为0个元素 99 | 4. picker底部按钮添加响应颜色 100 | 5. label返回值添加back背景元素 101 | 6. TinUIXml支持直接使用flyout控件 102 | 7. TinUIXml下ui支持直接使用xml布局 103 | 8. 优化TinUIXml性能 104 | 105 | ==========5.13========== 106 | 2025-1-8 107 | 1. 统一大圆角8px(width=17),小圆角4px(width=9)。包括: 108 | entry, link, labelframe, combobox, table, spinbox, 109 | menu, tooltip, listview, notebook, notecard, button2, 110 | expander, waitframe, treeview, passwordbox, togglebutton, 111 | picker, menubutton, barbutton 112 | 2. 优化spinbox调节按钮外观 113 | 3. 调整barbutton,menubar,menubutton外框与内容的间距 114 | 4. 修复checkbutton状态切换函数的问题 115 | 5. 修复treeview展开选项的问题 116 | 7. 修复listview删除元素后的元素列表存储错误以及样式提示符位置错误 117 | 8. listview允许初始为0个元素,并修复了删除元素时可能出现的错误 118 | 119 | ==========5.11========== 120 | 2024-12-28 121 | 1. 允许额外的LGPLv3许可 122 | 2. 修复密码输入框的提示符颜色错误 123 | 3. 优化部分控件动画性能 124 | 4. 改进pipspager动画 125 | 5. windows下进行部分高dpi测试 126 | 6. 改进combobox效果 127 | 128 | ==========5.10========== 129 | 2024-11-9 130 | 1. 优化滚动条标识符 131 | 2. 优化标签页选项卡关闭标识符 132 | 3. 调整工具栏按钮默认字体大小 133 | 4. 树状图优化图标 134 | 5. 优化部分控件创建性能 135 | 6. 优化TinUIXml效率 136 | 137 | ==========5.9========== 138 | 2024-10-6 139 | 1. 增加extension拓展包,支持按钮化控件 140 | 2. radiobox增加funcs返回值 141 | 3. TinUITheme(明亮/暗黑)统一背景配色 142 | 4. 修复滚动条初始化可能导致的错误 143 | 144 | ==========5.8========== 145 | 2024-8-28 146 | 1. button2, barbutton优化有图标无文字的排版 147 | 2. listview新增元素获取、删除、增加方法 148 | 3. 更新entry样式 149 | 4. 更新passwordbox样式 150 | 5. barbutton兼容3.6~3.9版本python 151 | 6. 更新combobox样式 152 | 153 | ==========5.7========== 154 | 2024-8-23 155 | 1. 修复scalebar禁用后仍然出现响应样式的问题 156 | 2. 修复checkbutton禁用后标识符错误的问题 157 | 3. 启用帮助手册 158 | 159 | ==========5.6========== 160 | 2024-8-23 161 | 1. 对话框按钮自定义文本 162 | 2. 优化menubar, menubutton, picker, combobox动画视觉效果 163 | 3. 新增选择对话框 ask_choice (listbox) 164 | 4. 修复notebook载入TinUI页面的错误 165 | 166 | ==========5.5========== 167 | 2024-8-15 168 | 1. 内置对话框 169 | 170 | ==========5.4========== 171 | 2024-8-8 172 | 1. 新增工具栏按钮组件,barbutton(AppBarButton) 173 | 2. button2添加icon参数,用来使用Fluent Icons符号,compound in top,bottom,left,right 174 | 3. 修复ratingbar某些情况下无法选中的错误 175 | 176 | ==========5.3========== 177 | 2024-7-31 178 | 1. TinUIXml编辑器手动输入标记点信息 179 | 2. entry添加删除、插入文本方法 180 | 3. menubutton可选是否显示标识符 181 | 4. TinUIXml自定义间距,优先级比坐标自定低 182 | 183 | ==========5.2========== 184 | 2024-7-16 185 | 1. button最大化宽度、最小化宽度参数 186 | 2. button2最大化宽度、最小化宽度参数 187 | 3. 修复treeview跨级选定展开单层后的报错问题 188 | 4. TinUIXml简易编辑器添加标记点管理 189 | 5. listbox的add方法中重新设计位置确定逻辑 190 | 6. listbox回调command参数result增加result.index属性 191 | 192 | ==========5.1========== 193 | 2024-7-5 194 | 1. test\tuxmltest.py 升级为简易TinUIxml编辑器 195 | 2. 优化scalebar标识符元素 196 | 3. BasicTinUI新增show_location方法,用于设计时反馈坐标信息 197 | 4. checkbutton引发响应的command接受的唯一参数为选定状态,True/False 198 | 199 | ==========5.0========== 200 | 2024-6-24 201 | 1. 以下控件接入统一坐标对齐模式:listview, pipspager, ratingbar, 202 | radiobox, pivot, button2, waitframe, passwordbox, image, 203 | swipecontrol, picker 204 | 2. radiobox使用新样式,同时更改默认间距 205 | 3. 优化expander样式 206 | 4. 优化spinbox提示符 207 | 5. 优化passwordbox提示符 208 | 6. 修复TinUIXml自定义初始坐标被忽略的问题 209 | 7. tinuixml修复x,y参数自定义,新增anchor自定义(精确到line,但是每个标签内优先级更高) 210 | 2024-6-16 pre-5 211 | 1. 更新checkbutton样式 212 | 2. waitbar2新样式 213 | 3. 以下控件接入统一坐标对齐模式:checkbutton, entry, radiobutton, 214 | link, waitbar1, waitbar2, combobox, button, label, progressbar, 215 | table, onoff, spinbox, scalebar, info, waitbar3 216 | 4. radiobutton去除边框 217 | 5. combobox新样式,增加height参数,控制浮出窗口高度 218 | 6. onoff新样式 219 | 7. info提示触发文本后加入叹号提示文本标识符 220 | 8. waitbar3使用圆角 221 | 2024-2-15 pre-4 222 | 1. labelframe改为圆角边框 223 | 2. notebook新样式 224 | 3. ratingbar新样式,参数r改size(字体大小) 225 | 4. BasicTinUI.clean_windows()清除浮出控件的子窗口,TinUIXml的clean也会触发 226 | 5. notebook支持自定义滚动条颜色 227 | 2024-2-13 pre-3 228 | 1. 优化pipspager样式 229 | 2. textbox, listbox, canvas, ui支持自定scrollbar颜色 230 | 3. 新介绍窗口 231 | 4. scrollbar新标识元素 232 | 5. 修复treeview展开时可能的提示元素的位置错位 233 | 2024-2-9 pre-2 234 | 1. 更新menu样式 235 | 2. menubutton 添加segeo fluent icon字体文件 236 | 3. 更新picker样式 237 | 4. 新logo 238 | 5. 新增菜单按钮 menubutton 239 | 6. 更新黑暗样式 240 | 2024-2-6 pre-1 241 | 1. 添加TinUIFont类,管理字体文件 242 | 2. 更新table样式 243 | 244 | ==========4.7========== 245 | 2024-1-24 246 | 1. 优化radiobox样式 247 | 2. 新增滚动选值框 picker 248 | 249 | ==========4.6========== 250 | 2023-12-17 251 | 1. spinbox返回值添加num属性 252 | 2. 修复listbox横向滚动条长度错误的问题 253 | 254 | ==========4.5========== 255 | 2023-11-12 256 | 1. 修复treeview调试错误 257 | 258 | ==========4.4========== 259 | 2023-3-11 260 | 1. 新增密码输入框 passwordbox 261 | 262 | ==========4.3========== 263 | 2023-2-2 264 | 1. 优化帮助手册 265 | 2. 优化ratingbar, onoff外观 266 | 3. 优化spinbox外观,更新spinbox示例 267 | 4. 修复treeview的一个展开错误 268 | 5. 新增滑动控件 swipecontrol 269 | 270 | ==========4.2========== 271 | 2023-1-21 272 | 1. 更改image计算精度 273 | 2. listbox添加add、delete方法 274 | 3. ratingbar只选择一个星且再次选择第一个时,取消选择,返回0 275 | 4. 修复button2无法返回边框元素的错误 276 | 5. 修复radiobox示例中的错误 277 | 6. 添加状态开关按钮 togglebutton 278 | 279 | ==========4.1========== 280 | 2023-1-9 281 | 1. 优化 TinUI帮助手册 282 | 2. 添加pipspager切换动画 283 | 3. 修复treeview展开和闭合后触发选定的问题 284 | 285 | ==========4.0========== 286 | 2023-1-1 287 | 1. 优化radiobox效果 288 | 2. 修复listview返回元素不全的问题 289 | 3. 新增树状图 treeview 290 | 4. 使用TinUI LOGO.ico 291 | 5. 新增普通图片 image 292 | 6. 随包发布 TinUI帮助手册 实用程序,在\test目录下 293 | 7. 优化复选框标识符 294 | 295 | ==========3.34========== 296 | 2022-10-22 297 | 1. 新增列表视图 listview 298 | 2. 更新样式 299 | 3. TinUI支持直接横向滚动 300 | 4. 破坏性,tooltip返回值改为函数get_return,节省窗口资源 301 | 302 | ==========3.33========== 303 | 2022-10-4 304 | 1. 新增元素等待框 waitframe 305 | 306 | ==========3.32========== 307 | 2022-9-17 308 | 1. 感谢TotoWang-hhh(github)提交的自动识别windows系统深浅色模式样式 309 | 2. window.py添加快速翻页功能,方便样式theme开发者展示 310 | 311 | ==========3.31========== 312 | 2022-9-9 313 | 1. onoff移动动画 314 | 2. 创建TinUIWidget类,用来显示单个元素控件 315 | 3. 修改expander, notebook, notecard的圆角 316 | 4. back边框圆角 317 | 318 | ==========3.30========== 319 | 2022-8-27 320 | 1. tooltip新增delay参数,允许延时显示 321 | 2. textbox添加相关方法 322 | 3. 网站同步changelog 323 | 4. TinUIXml添加environment方法,用以快速导入funcs和datas 324 | 5. onoff重写,采用新样式,增加相关方法 325 | 6. scrollbar样式对称,不使用时保持静默状态 326 | 327 | ==========3.24========== 328 | 2022-8-20 329 | 1. 修复横向scrollbar最大值滚动问题 330 | 2. 更新pipspager标识符样式 331 | 3. 修复pipspager向左越界移动的问题 332 | 4. 版权更新 333 | 5. 添加此文件 334 | 335 | ==========3.23========== 336 | 2022-8-13 337 | 1. 增加entry方法 338 | 2. 增加entry测试文件 339 | 3. 更新ratingbar功能 340 | 4. link控件如果接受一个超链接,则显示链接地址 341 | 5. info/tooltip指定文本宽度 342 | 343 | ==========3.22========== 344 | 2022-8-6 345 | 1. 新增可折叠UI元素控件 expander 346 | 347 | ==========3.21========== 348 | 2022-7-30 349 | 1. 修复若干问题 350 | 2. 优化menu首次点击明显位移问题 351 | 352 | ==========3.20========== 353 | 2022-7-24 354 | 1. 防止三种waitbar元素名称重合 355 | 2. 添加圆角按钮 button2 356 | 3. 更新tooltip的圆角样式 357 | 4. info改为封装tooltip 358 | 359 | ==========2.16========== 360 | 2022-7-17 361 | 1. 添加支点标题组件 pivot 362 | 363 | ==========3.15========== 364 | 2022-7-13 365 | 1. 更新waitbar1的样式 366 | 2. 增加waitbar3的视觉效果 367 | 3. notebook可以更改标题名称 368 | 369 | ==========3.13========== 370 | 2022-7-3 371 | 1. 重新添加新的table最大宽度参数 372 | 2. notebook可指定是否响应新界面按钮 373 | 374 | ==========3.11========== 375 | 2022-6-26 376 | 1. 修复menu分割线,使用独立的线段绘制 377 | 2. 新增便笺控件 notecard 378 | 3. 在readme上添加示例代码 379 | 380 | ==========3.10========== 381 | 2022-6-19 382 | 1. 增加FuncList类统一管理返回函数 383 | 2. table新增maxwidth参数 384 | 3. 修改notebook样式 385 | 4. notebook新增界面可决定是否能删除 386 | 387 | ==========3.9========== 388 | 2022-6-5 389 | 1. 优化menu逻辑 390 | 2. 新增单选组控件 radiobox 391 | 3. scalebar标识线段圆角 392 | 4. 调整radiobox标识样式 393 | 5. 添加radiobox样式 394 | 395 | ==========3.7========== 396 | 2022-5-29 397 | 1. 添加TinUIEvent事件管理 398 | 2. 更新scalebar样式,启用WinUI3样式 399 | 3. 优化checkbutton标识符比例 400 | 401 | ==========3.6========== 402 | 2022-5-15 403 | 1. 完善TinUITheme类对于TinUIXml的契合度 404 | 2. 添加separate出现动画 405 | 3. 修复ratingbar糙度问题 406 | 4. link圆角背景 407 | 5. link添加目标函数,最高优先级 408 | 409 | ==========3.5========== 410 | 2022-5-8 411 | 1. 修复menu延迟动画问题 412 | 2. 更新配色样式 413 | 414 | ==========3.4========== 415 | 2022-5-3 416 | 1. menu滚动动画 417 | 2. 更新entry样式,启用WinUI3样式 418 | 3. 添加评星级控件 ratingbar 419 | 420 | ==========3.3========== 421 | 2022-4-30 422 | 1. 添加标签栏视图 notebook 423 | 424 | ==========3.1========== 425 | 2022-4-17 426 | 1. 更新checkbutton样式 427 | 2. uid的定义均改外字符串 428 | 3. labelframe增加pos标识参数,用于TinUIXml渲染 429 | 430 | ==========3.0========== 431 | 2022-4-3 432 | 1. 修复pipspager转换接口使用后,样式无变化的问题 433 | 2. 稳定TinUIXml使用以及规范 434 | 435 | ==========2.20========== 436 | 2022-3-27 437 | 1. 新增内置界面框架 ui 438 | 2. 修复TinUI自动刷新结束时报错的BUG,但不是元素控件,实际上这类报错无关紧要 439 | 3. 添加横向翻页视图 pipspager 440 | 441 | ==========2.16========== 442 | 2022-3-12 443 | 1. 添加TinUITheme统一基类 444 | 2. TinUIXml支持重写的TinUI和BasicTinUI的样式 445 | 3. 更新样式范例 446 | 4. 添加画布 canvas 447 | 5. 更新窗口样式 448 | 6. 修复button背景响应颜色显示错误的问题 449 | 7. 删除button响应测试代码 450 | 451 | ==========2.15========== 452 | 2022-2-26 453 | 1. 更新spinbox样式 454 | 2. 添加entry(可选)直接处理输入的功能 455 | 3. 添加TinUIXml对滚动条的支持 456 | 4. 新增列表框 listbox 457 | 458 | ==========2.14========== 459 | 2022-2-12 460 | 1. 修复上一个版本的xml解析问题 461 | 462 | ==========2.13========== 463 | 2022-2-12 464 | 1. 修复上一个版本的文档问题 465 | 466 | ==========2.12========== 467 | 2022-2-12 468 | 1. 添加lighttheme测试文件 469 | 2. 更新radiobutton样式 470 | 3. 添加配色风格示例 471 | 472 | ==========2.11========== 473 | 2022-2-9 474 | 1. 使用GPLv3开源协议 475 | 2. 编写tinuixml相关文档 476 | 477 | ==========2.10========== 478 | 2022-2-8 479 | 1. 新增文本框 textbox 480 | 2. 新增滚动体 scrollbar 481 | 482 | ==========2.9========== 483 | 2022-2-4 484 | 1. 更新entry边框样式 485 | 2. 添加带状等待框 waitbar3 486 | 487 | ==========2.8========== 488 | 2022-1-30 489 | 1. 更新scalebar初始坐标设计 490 | 2. 添加背景元素 back 491 | 3. scalebar新样式 492 | 4. 修复back坐标优先逻辑错误 493 | 5. 修复TinUIXml坐标初始化逻辑错误 494 | 6. 更新TinUIXml对元素控件uid获取 495 | 7. 更新link样式 496 | 8. link既可以指向网页,也可以指向函数,类winui设计 497 | 498 | ==========2.7========== 499 | 2022-1-36 500 | 1. TinUIXml允许行元素嵌套 501 | 2. xml布局确立行元素与纵块的概念 502 | 3. 添加TinUIXml代码预览测试文件 503 | 4. entry控件的边框和提示符位置由Entry组件控制,修复由字体改变造成的错误 504 | 5. 简化combobox的tag绑定 505 | 6. 添加窗口提示框架 tooltip 506 | 7. 修复TinUIXml的纵块无法确定最大宽度的问题 507 | 508 | ==========2.6========== 509 | 2021-1-24 510 | 1. TinUI主体和框架分离,主体为BasicTinUI,框架为TinUI 511 | 2. 测试button combobox返回参数 512 | 3. 完善scalebar测试 513 | 4. 优化progressbar测试 514 | 5. 创建TinUIXml,允许使用xml语言来渲染TinUI或BasicTinUI的组件界面 515 | 6. 更新xml换行解析渲染逻辑 516 | 517 | ==========2.5========== 518 | 2021-1-21 519 | 1. TinUI左键单击获取焦点 520 | 2. entry使用WinUI2样式 521 | 3. 更新checkbutton样式 522 | 4. 增加checkbutton样式参数 523 | 5. 修复checkbutotn状态标识符点击无效的问题 524 | 6. 为同框架元素控件添加统一的最后一个返回值uid,为xml布局打下基础 525 | 7. 修改menu默认透明色 526 | 527 | ==========2.4========== 528 | 2022-1-2 529 | 1. 添加table示例 530 | 2. 修复table表头高度不一致的问题 531 | 3. 更新button样式 532 | 533 | ==========2.3========== 534 | 2021-12-19 535 | 1. 修复menu初次显示的位移问题,修复圆角 536 | 537 | ==========2.2========== 538 | 2021-12-12 539 | 1. button新增边框参数 540 | 2. 恢复table的minwidth参数 541 | 3. 修复button边缘无响应的问题 542 | 4. 修改table样式 543 | 5. 修改menu布局 544 | 6. 启用圆角menu样式 545 | 546 | ==========2.1========== 547 | 2021-11-13 548 | 1. 调整元素层级 549 | 2. 添加菜单 menu 550 | 3. 确定菜单内容标记 551 | 552 | ==========2.0========== 553 | 2021-10-24 554 | 1. 添加气泡提示 info 555 | 2. 提供完善的API 556 | 557 | ==========1.9========== 558 | 2021-10-4 559 | 1. 修改entry样式 560 | 561 | ==========1.8========== 562 | 2021-8-25 563 | 1. 修复scalebar拖拽问题 564 | 2. 添加button相关方法 565 | 3. 添加button示例 566 | 4. 添加radiobutton相关方法 567 | 5. 修改combobox样式 568 | 6. 修改spinbox样式 569 | 7. 添加scalebar示例 570 | 8. 添加checkbutton radiobutton示例 571 | 9. 添加scalebar相关方法 572 | 573 | ==========1.6========== 574 | 2021-8-20 575 | 1. 确定TinUI logo 576 | 2. 添加调节框 scalebar 577 | 578 | ==========1.5========== 579 | 2021-8-7 580 | 1. checkbutton添加新文本元素及参数 581 | 2. 添加选值框 spinbox 582 | 583 | ==========1.4========== 584 | 2021-8-3 585 | 1. 修改button combobox原始样式 586 | 2. 修改link样式 587 | 3. 修改waitbar1 waitbar2样式 588 | 4. 添加开关 onoff 589 | 5. 修改combobox样式 590 | 591 | ==========1.3========== 592 | 2021-7-27 593 | 1. 添加表格 table 594 | 595 | ==========1.2========== 596 | 2021-7-25 597 | 1. 添加进度条 progressbar 598 | 599 | ==========1.1.2========== 600 | 2021-7-23 601 | 1. 修改readme文件链接错误 602 | 603 | ==========1.1.1========== 604 | 2021-7-23 605 | 1. 修复waitbar2样式 606 | 607 | ==========1.1========== 608 | 2021-7-21 609 | 1. 添加点状等待组件 waitbar2 610 | 2. 添加组合框 combobox 611 | 3. 上传组件样式图像gif 612 | 4. 在readme文件中添加gif链接 613 | 614 | ==========1.0========== 615 | 2021-7-16 616 | 1. 添加TinUINum记录结构类 617 | 2. 添加TinUI自动刷新滚动范围的参数 618 | 3. 修复checkbutton回调问题 619 | 4. 添加圆形等待组件 waitbar1 620 | 5. 移除其它依赖,完全使用标准库 621 | 622 | ==========beta-6(preview)========== 623 | 2021-7-13 624 | 1. 取消对TinEngine的内部调用支持,计划使用完整的标准库编写 625 | 2. 添加button激活样式 626 | 627 | ==========beta-5========== 628 | 2021-6-26 629 | 1. 为部分元素控件添加对齐位置参数 630 | 2. 添加超链接 link 631 | 632 | ==========beta-4========== 633 | 2021-5-16 634 | 1. 添加分割线 separate 635 | 2. 添加单选框 radiobutton 636 | 637 | ==========beta-3========== 638 | 2021-4-17 639 | 1. 添加输入框 entry 640 | 641 | ==========beta-2========== 642 | 2021-3-27 643 | 1. 添加复选框元素控件 checkbutton 644 | 645 | ==========beta-1========== 646 | 2021-3-20 647 | 1. 正式命名TinUI 648 | 2. 确定TinUI开发方向,为tkinter提供现代样式的独立元素控件 649 | 3. 创建文本元素控件 title label paragraph 650 | 4. 创建按钮元素控件 button 651 | 652 | ==========alpha-4========== 653 | 2021-1 654 | 1. 放弃文本排版路线 655 | 2. 开始绘图元素控件路线 656 | 657 | ==========alpha-3========== 658 | 2020-11 659 | 1. 停止对TinEngine的专门支持 660 | 2. 删除基本绘图包装 661 | 3. 计划文本排版功能 662 | 663 | ==========alpha-2========== 664 | 2020-3 665 | 1. 包装基本绘图功能 666 | 667 | ==========alpha-1========== 668 | 2019 669 | 1. 创建项目,作为TinEngine内置功能画布 670 | -------------------------------------------------------------------------------- /LOGO.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/LOGO.ico -------------------------------------------------------------------------------- /Segoe Fluent Icons.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/Segoe Fluent Icons.ttf -------------------------------------------------------------------------------- /TinUI.code-workspace: -------------------------------------------------------------------------------- 1 | { 2 | "folders": [ 3 | { 4 | "path": "." 5 | } 6 | ], 7 | "settings": { 8 | "git.enabled": false 9 | } 10 | } -------------------------------------------------------------------------------- /TinUIDialog.py: -------------------------------------------------------------------------------- 1 | """ 2 | TinUI风格对话框 3 | """ 4 | from tkinter import Tk, Toplevel 5 | 6 | try: 7 | from .TinUI import BasicTinUI 8 | except: 9 | from TinUI import BasicTinUI 10 | 11 | 12 | 13 | class Dialog(Toplevel): 14 | """ 15 | TinUI对话框基础类 16 | """ 17 | 18 | def __init__(self,master,dialogtype='normal',theme='light',**options): 19 | """ 20 | theme: 'dark' or 'light' 21 | """ 22 | super().__init__(master,**options) 23 | self.withdraw() 24 | 25 | if master: 26 | self.transient(self.master) 27 | 28 | self.tinui=BasicTinUI(self) 29 | self.tinui.pack(fill='both',expand=True) 30 | 31 | self.type=dialogtype#对话框类型 32 | 33 | if theme=='light': 34 | self.background = '#f3f3f3' 35 | self.fg = '#000000' 36 | self.barback = '#f3f3f3' 37 | self.buttonargs = { 38 | 'fg':'#1b1b1b', 39 | 'bg':'#fbfbfb', 40 | 'line':'#cccccc', 41 | 'activefg':'#1a1a1a', 42 | 'activebg':'#f6f6f6', 43 | 'activeline':'#cccccc', 44 | 'onfg':'#5d5d5d', 45 | 'onbg':'#f5f5f5', 46 | 'online':'#e5e5e5' 47 | } 48 | self.entryargs = { 49 | 'fg':'#606060', 50 | 'bg':'#fbfbfb', 51 | 'activefg':'#1b1b1b', 52 | 'activebg':'#ffffff', 53 | 'line':'#e5e5e5', 54 | 'activeline':'#e5e5e5', 55 | 'insert':'#000000', 56 | 'outline':'#868686', 57 | 'onoutline':'#3041d8', 58 | } 59 | self.listargs = { 60 | 'fg':'#000000', 61 | 'bg':'#f2f2f2', 62 | 'activebg':'#e9e9e9', 63 | 'sel':'#b4b4b4', 64 | 'scrollbg':'#f9f9f9', 65 | 'scrollcolor':'#8d8d8d', 66 | 'scrollon':'#8a8a8a' 67 | } 68 | self.infocolor = '#5969e0' 69 | self.infoback = '#ffffff' 70 | self.successcolor = '#0f7b0f' 71 | self.successback = '#dff6dd' 72 | self.warningcolor = '#9d5d00' 73 | self.warningback = '#fff4ce' 74 | self.errorcolor = '#c42b1c' 75 | self.errorback = '#fde7e9' 76 | self.questioncolor = '#5969e0' 77 | self.questionback = '#ffffff' 78 | elif theme=='dark': 79 | self.background = '#202020' 80 | self.fg = '#ffffff' 81 | self.barback = '#202020' 82 | self.buttonargs = { 83 | 'fg':'#ffffff', 84 | 'bg':'#2d2d2d', 85 | 'line':'#303030', 86 | 'activefg':'#ffffff', 87 | 'activebg':'#323232', 88 | 'activeline':'#202020', 89 | 'onfg':'#cecece', 90 | 'onbg':'#272727', 91 | 'online':'#303030' 92 | } 93 | self.entryargs = { 94 | 'fg':'#cfcfcf', 95 | 'bg':'#2d2d2d', 96 | 'activefg':'#e6e6e6', 97 | 'activebg':'#1f1f1f', 98 | 'line':'#303030', 99 | 'activeline':'#202020', 100 | 'outline':'#9a9a9a', 101 | 'onoutline':'#b2b8f2', 102 | 'insert':'#e0e0e0', 103 | } 104 | self.listargs = { 105 | 'bg':'#2d2d2d', 106 | 'fg':'#ffffff', 107 | 'activebg':'#b4bbea', 108 | 'sel':'#465097', 109 | 'scrollbg':'#2e2e2e', 110 | 'scrollcolor':'#9f9f9f', 111 | 'scrollon':'#a0a0a0' 112 | } 113 | self.infocolor = '#4cc2ff' 114 | self.infoback = '#2c2c2c' 115 | self.successcolor = '#6ccb5f' 116 | self.successback = '#393d1b' 117 | self.warningcolor = '#fce100' 118 | self.warningback = '#433519' 119 | self.errorcolor = '#ff99a4' 120 | self.errorback = '#442726' 121 | self.questioncolor = '#4cc2ff' 122 | self.questionback = '#2c2c2c' 123 | 124 | self.resizable(False,False) 125 | self.tk.call('wm', 'iconbitmap', self._w, '-default', '') 126 | 127 | def _endy(self): 128 | #最低位置 129 | bbox=self.tinui.bbox('all') 130 | if bbox: 131 | return bbox[3] 132 | else: 133 | return 0 134 | 135 | def initial_msg(self,title,content,yestext='OK',notext='Cancel'): 136 | """ 137 | 初始化对话框-消息类 138 | """ 139 | YES=yestext 140 | NO=notext 141 | 142 | self.title(title) 143 | self.protocol('WM_DELETE_WINDOW',lambda:self.return_msg(None)) 144 | 145 | # contenty=5 146 | if self.type=='normal': 147 | self.tinui['bg']=self.background 148 | elif self.type=='info': 149 | self.tinui['bg']=self.infoback 150 | icon_uid=self.tinui.add_paragraph((5,5),text='\uE946',fg=self.infocolor,font='{Segoe Fluent Icons} 14',anchor='w') 151 | self.tinui.addtag_withtag('content',icon_uid) 152 | elif self.type=='success': 153 | self.tinui['bg']=self.successback 154 | icon_uid=self.tinui.add_paragraph((5,5),text='\uE73E',fg=self.successcolor,font='{Segoe Fluent Icons} 14',anchor='w') 155 | self.tinui.addtag_withtag('content',icon_uid) 156 | elif self.type=='warning': 157 | self.tinui['bg']=self.warningback 158 | icon_uid=self.tinui.add_paragraph((5,5),text='\uE7BA',fg=self.warningcolor,font='{Segoe Fluent Icons} 14',anchor='w') 159 | self.tinui.addtag_withtag('content',icon_uid) 160 | elif self.type=='error': 161 | self.tinui['bg']=self.errorback 162 | icon_uid=self.tinui.add_paragraph((5,5),text='\uEA39',fg=self.errorcolor,font='{Segoe Fluent Icons} 14',anchor='w') 163 | self.tinui.addtag_withtag('content',icon_uid) 164 | elif self.type=='question': 165 | self.tinui['bg']=self.questionback 166 | icon_uid1=self.tinui.add_paragraph((5,5),text='\uEA3A',fg=self.questioncolor,font='{Segoe Fluent Icons} 14',anchor='w') 167 | icon_uid2=self.tinui.add_paragraph((5,5),text='\uF142',fg=self.questioncolor,font='{Segoe Fluent Icons} 14',anchor='w') 168 | self.tinui.addtag_withtag('content',icon_uid1) 169 | self.tinui.addtag_withtag('content',icon_uid2) 170 | 171 | content_uid=self.tinui.add_paragraph((35,5),text=content,fg=self.fg,anchor='w') 172 | self.tinui.addtag_withtag('content',content_uid) 173 | content_bbox=self.tinui.bbox('content') 174 | btn_width=(content_bbox[2]-content_bbox[0])/2 175 | button_width=btn_width-10 if btn_width>110 else 100 176 | button_endy=self._endy()+15 177 | yesbutton_uid=self.tinui.add_button2(((content_bbox[0]+content_bbox[2])/2-5,button_endy),text=YES,minwidth=button_width,command=lambda e:self.return_msg(True),anchor='ne',**self.buttonargs)[-1] 178 | nobutton_uid=self.tinui.add_button2(((content_bbox[0]+content_bbox[2])/2+5,button_endy),text=NO,minwidth=button_width,command=lambda e:self.return_msg(False),anchor='nw',**self.buttonargs)[-1] 179 | self.tinui.add_back((),(yesbutton_uid,nobutton_uid),bg=self.barback,fg=self.barback,linew=9) 180 | 181 | return self.load_window() 182 | 183 | def return_msg(self,val): 184 | #返回消息 185 | self.result=val 186 | self.destroy() 187 | self.master.focus_set() 188 | 189 | def initial_input(self,title,content,text,yestext='OK',notext='Cancel'): 190 | """ 191 | 初始化对话框-输入类 192 | """ 193 | YES=yestext 194 | NO=notext 195 | 196 | self.tinui['bg']=self.background 197 | 198 | self.title(title) 199 | self.protocol('WM_DELETE_WINDOW',lambda:self.return_input(None)) 200 | 201 | self.tinui.add_paragraph((5,5),text=content,fg=self.fg) 202 | content_bbox=self.tinui.bbox('all') 203 | entry_width=content_bbox[2]-content_bbox[0] 204 | width=entry_width if entry_width>200 else 200 205 | self.entry=self.tinui.add_entry((5,self._endy()+5),width=width,**self.entryargs)[-2]# tinui entry widget, funcs 206 | self.entry.insert(0,str(text)) 207 | bbox=self.tinui.bbox('all') 208 | btn_width=(bbox[2]-bbox[0])/2 209 | button_width=btn_width-10 if btn_width>110 else 100 210 | button_endy=self._endy()+15 211 | yesbutton_uid=self.tinui.add_button2(((bbox[0]+bbox[2])/2-5,button_endy),text=YES,minwidth=button_width,command=lambda e:self.return_input(self.entry.get()),anchor='ne',**self.buttonargs)[-1] 212 | nobutton_uid=self.tinui.add_button2(((bbox[0]+bbox[2])/2+5,button_endy),text=NO,minwidth=button_width,command=lambda e:self.return_input(None),anchor='nw',**self.buttonargs)[-1] 213 | self.tinui.add_back((),(yesbutton_uid,nobutton_uid),bg=self.barback,fg=self.barback,linew=9) 214 | 215 | return self.load_window() 216 | 217 | def return_input(self,val): 218 | #返回输入内容 219 | self.result=val 220 | if self.result==None: 221 | pass 222 | elif self.type=='string': 223 | pass 224 | elif self.type=='integer': 225 | try: 226 | self.result=int(self.result) 227 | except: 228 | return 229 | elif self.type=='float': 230 | try: 231 | self.result=float(self.result) 232 | except: 233 | return 234 | self.destroy() 235 | self.master.focus_set() 236 | 237 | def initial_choice(self,title,content,choices,yestext='OK',notext='Cancel'): 238 | """ 239 | 初始化对话框-选择类 240 | """ 241 | YES=yestext 242 | NO=notext 243 | self.result=None 244 | 245 | self.tinui['bg']=self.background 246 | 247 | self.title(title) 248 | self.protocol('WM_DELETE_WINDOW',lambda:self.return_choice(None)) 249 | 250 | self.tinui.add_paragraph((5,5),text=content,fg=self.fg) 251 | content_bbox=self.tinui.bbox('all') 252 | width = max(content_bbox[2]-content_bbox[0], 300) 253 | 254 | if self.type=='listbox': 255 | self.tinui.add_listbox((5,self._endy()+5),width=width,height=300,data=choices,command=self.return_choice,**self.listargs) 256 | 257 | bbox=self.tinui.bbox('all') 258 | btn_width=(bbox[2]-bbox[0])/2 259 | button_width=btn_width-10 if btn_width>110 else 100 260 | button_endy=self._endy()+15 261 | yesbutton_uid=self.tinui.add_button2(((bbox[0]+bbox[2])/2-5,button_endy),text=YES,minwidth=button_width,command=lambda e:self.return_choice(True),anchor='ne',**self.buttonargs)[-1] 262 | nobutton_uid=self.tinui.add_button2(((bbox[0]+bbox[2])/2+5,button_endy),text=NO,minwidth=button_width,command=lambda e:self.return_choice(None),anchor='nw',**self.buttonargs)[-1] 263 | self.tinui.add_back((),(yesbutton_uid,nobutton_uid),bg=self.background,fg=self.background,linew=9) 264 | 265 | return self.load_window() 266 | 267 | def return_choice(self,val): 268 | #返回选择内容 269 | if val==True:#YES 270 | if self.result==None: 271 | return 272 | self.destroy() 273 | self.master.focus_set() 274 | elif val==None:#NO 275 | self.result=None 276 | self.destroy() 277 | self.master.focus_set() 278 | else:#输入值 279 | self.result=val 280 | 281 | def load_window(self): 282 | #获取窗口内所有控件的bbox,窗口居中布局 283 | bboxall=self.tinui.bbox('all') 284 | w,h=bboxall[2]-bboxall[0],bboxall[3]-bboxall[1]+1 285 | screenw=self.winfo_screenwidth() 286 | screenh=self.winfo_screenheight() 287 | x,y=(screenw-w)/2,(screenh-h)/2 288 | self.geometry(f'{w}x{h}+{int(x)}+{int(y)-10}') 289 | self.deiconify() 290 | 291 | self.tinui.config(scrollregion=bboxall) 292 | 293 | self.focus_set() 294 | self.wait_visibility() 295 | self.grab_set() 296 | self.wait_window(self) 297 | 298 | return self.result 299 | 300 | 301 | 302 | def show_msg(master,title,content,theme='light'): 303 | """ 304 | 显示消息对话框 305 | """ 306 | dialog=Dialog(master,'normal',theme) 307 | return dialog.initial_msg(title,content) 308 | 309 | def show_info(master,title,content,yestext='OK',notext='Cancel',theme='light'): 310 | """ 311 | 显示信息对话框 312 | """ 313 | dialog=Dialog(master,'info',theme) 314 | return dialog.initial_msg(title,content,yestext,notext) 315 | def show_success(master,title,content,yestext='OK',notext='Cancel',theme='light'): 316 | """ 317 | 显示成功对话框 318 | """ 319 | dialog=Dialog(master,'success',theme) 320 | return dialog.initial_msg(title,content,yestext,notext) 321 | 322 | def show_warning(master,title,content,yestext='OK',notext='Cancel',theme='light'): 323 | """ 324 | 显示警告对话框 325 | """ 326 | dialog=Dialog(master,'warning',theme) 327 | return dialog.initial_msg(title,content,yestext,notext) 328 | 329 | def show_error(master,title,content,yestext='OK',notext='Cancel',theme='light'): 330 | """ 331 | 显示错误对话框 332 | """ 333 | dialog=Dialog(master,'error',theme) 334 | return dialog.initial_msg(title,content,yestext,notext) 335 | 336 | def show_question(master,title,content,yestext='YES',notext='NO',theme='light'): 337 | """ 338 | 显示询问对话框 339 | """ 340 | dialog=Dialog(master,'question',theme) 341 | return dialog.initial_msg(title,content,yestext,notext) 342 | 343 | 344 | def ask_string(master,title,content,text:str="",yestext='OK',notext='Cancel',theme='light'): 345 | """ 346 | 输入字符串对话框 347 | """ 348 | dialog=Dialog(master,'string',theme) 349 | return dialog.initial_input(title,content,text,yestext,notext) 350 | 351 | def ask_integer(master,title,content,text:int=0,yestext='OK',notext='Cancel',theme='light'): 352 | """ 353 | 输入整数对话框 354 | """ 355 | dialog=Dialog(master,'integer',theme) 356 | return dialog.initial_input(title,content,text,yestext,notext) 357 | 358 | def ask_float(master,title,content,text:float="0.0",yestext='OK',notext='Cancel',theme='light'): 359 | """ 360 | 输入浮点数对话框 361 | """ 362 | dialog=Dialog(master,'float',theme) 363 | return dialog.initial_input(title,content,text,yestext,notext) 364 | 365 | def ask_choice(master,title,content,choices,yestext='OK',notext='Cancel',theme='light'): 366 | """ 367 | 选择列表对话框 368 | """ 369 | dialog=Dialog(master,'listbox',theme) 370 | return dialog.initial_choice(title,content,choices,yestext,notext) 371 | 372 | 373 | 374 | #test 375 | if __name__=='__main__': 376 | root=Tk() 377 | root.iconbitmap('LOGO.ico') 378 | a=show_msg(root,'test','hello world!',theme='dark') 379 | print(a) 380 | show_info(root,'test','show information\nhello world!',theme='dark') 381 | show_success(root,'test','Success!\nhello world! hello world! hello world! hello world!',theme='dark') 382 | show_warning(root,'test','this is a warning\nhello world!',theme='dark') 383 | show_error(root,'test','something is wrong\nhello world! hello world! hello world! hello world!',theme='dark') 384 | show_question(root,'test','Do you want to continue?',theme='dark') 385 | b=ask_string(root,'test','input something input something input something input something',theme='dark') 386 | ask_integer(root,'test','input integer',theme='dark') 387 | ask_float(root,'test','input float',theme='dark') 388 | print(b) 389 | c=ask_choice(root,'test','choose one',('a','b','c'),theme='dark') 390 | print(c) 391 | root.mainloop() -------------------------------------------------------------------------------- /__init__.py: -------------------------------------------------------------------------------- 1 | from .TinUI import BasicTinUI, TinUI, TinUIXml, TinUITheme 2 | from .TinUIDialog import show_msg, show_info, show_success, show_warning, show_error, show_question,\ 3 | ask_string, ask_integer, ask_float, ask_choice 4 | 5 | from . import extension -------------------------------------------------------------------------------- /docs/CNAME: -------------------------------------------------------------------------------- 1 | tinui.smart-space.com.cn -------------------------------------------------------------------------------- /docs/changelog/ChangeLog.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (C) <2021-present> 3 | 2019(原型框架)2021(正式命名TinUI发布) 4 | 基于GPLv3和LGPLv3发布 5 | 6 | ==========更新日志========== 7 | 8 | 9 | ==========5.28========== 10 | 2025-6-7 11 | 1. ratingbar增加返回背景元素 12 | 2. pivot增加选择函数 13 | 3. entry, passwordbox增加过渡响应颜色 14 | 15 | ==========5.27========== 16 | 2025-5-12 17 | 1. 标准样式库添加back元素 18 | 2. ratingbar添加选择评级方法 19 | 20 | ==========5.26========== 21 | 2025-4-22 22 | 1. 修复treeview以子树结尾时展开错误的问题 23 | 24 | ==========5.25========== 25 | 2025-4-12 26 | 1. 修复tinuixmltest的正则表达式错误 27 | 2. togglebutton添加开关方法 28 | 29 | ==========5.24========== 30 | 2025-3-21 31 | 1. onoff可指定标识符字体大小 32 | 2. 修复listview删除最后一个元素后,仍然显示最后一个元素高度的问题 33 | 3. 修复listbox删除最后一个元素时发生的错误 34 | 35 | ==========5.23========== 36 | 2025-3-14 37 | 1. 修复entry, passwordbox提示线在TinUIXml下的错位问题 38 | 2. 修复spinbox强制锁定的问题 39 | 40 | ==========5.22========== 41 | 2025-3-9 42 | 1. 自带uixml的控件,在删除时也会删除TinUIXml 43 | 2. 修复theme错误 44 | 3. 修复对话框基类 45 | 46 | ==========5.21========== 47 | 2025-3-7 48 | 1. listbox添加清空功能 49 | 2. 基于TinUILight, TinUIDark的Dialog附加样式类 50 | 3. spinbox回车时,如果输入数据符合条件,则触发回调函数 51 | 4. radiobox方法增加select 52 | 53 | ==========5.20========== 54 | 2025-3-1 55 | 1. 修复listview清空或删除视图后页面元素仍占用内存的问题 56 | 2. 修复TinUIXml(allanchor)对齐方式分配id不唯一的问题 57 | 58 | ==========5.19========== 59 | 2025-2-27 60 | 1. listview增加清空方法 61 | 2. entry中有内容就显示删除按钮 62 | 3. 删除passwordbox输入判定 63 | 4. 优化entry, passwordbox提示符样式(不再支持linew参数) 64 | 65 | ==========5.18========== 66 | 2025-2-12 67 | 1. 修复列表选择对话框的尺寸错误问题 68 | 2. 超链接、菜单等包含函数类型的多接受类型参数,使用callable判断是否可调用 69 | 3. pivot初始化时不再自动触发选择 70 | 4. 浮出窗口在初始化后直接隐藏,等待调用 71 | 5. notebook标签标题与边框间隔2px 72 | 73 | ==========5.17========== 74 | 2025-2-8 75 | 1. TinUIXml下expander、flyout支持直接使用xml布局 76 | 2. 优化展示画廊配色,修改部分示例 77 | 3. 优化spinbox样式 78 | 4. 修复entry、passwordbox提示符颜色错误 79 | 5. button2添加过渡响应色 80 | 6. 如下控件按钮添加过渡响应色参数: 81 | button2, menu, menubutton, pipspager, expander, 82 | picker, barbutton 83 | 7. 如下控件背景适配改进贴合性: 84 | treeview, listbox(并且改为圆角边框), combobox, 85 | menu, menubutton 86 | 8. 修复TinUIXml下ui标签内绑定回调函数异常的错误 87 | 9. 修复treeview未选中时折叠和展开的错误 88 | 10. 修复togglebutton颜色转换时计算出错问题(防止溢出,对十六进制个位数补位) 89 | 90 | ==========5.15========== 91 | 2025-2-1 92 | 1. TinUIXml对齐支持整体对齐,使用lineachor参数控制对齐方式,该值不会向内传递 93 | 2. 新增浮出ui控件 flyout 94 | 3. listbox允许初始化为0个元素 95 | 4. picker底部按钮添加响应颜色 96 | 5. label返回值添加back背景元素 97 | 6. TinUIXml支持直接使用flyout控件 98 | 7. TinUIXml下ui支持直接使用xml布局 99 | 8. 优化TinUIXml性能 100 | 101 | ==========5.13========== 102 | 2025-1-8 103 | 1. 统一大圆角8px(width=17),小圆角4px(width=9)。包括: 104 | entry, link, labelframe, combobox, table, spinbox, 105 | menu, tooltip, listview, notebook, notecard, button2, 106 | expander, waitframe, treeview, passwordbox, togglebutton, 107 | picker, menubutton, barbutton 108 | 2. 优化spinbox调节按钮外观 109 | 3. 调整barbutton,menubar,menubutton外框与内容的间距 110 | 4. 修复checkbutton状态切换函数的问题 111 | 5. 修复treeview展开选项的问题 112 | 7. 修复listview删除元素后的元素列表存储错误以及样式提示符位置错误 113 | 8. listview允许初始为0个元素,并修复了删除元素时可能出现的错误 114 | 115 | ==========5.11========== 116 | 2024-12-28 117 | 1. 允许额外的LGPLv3许可 118 | 2. 修复密码输入框的提示符颜色错误 119 | 3. 优化部分控件动画性能 120 | 4. 改进pipspager动画 121 | 5. windows下进行部分高dpi测试 122 | 6. 改进combobox效果 123 | 124 | ==========5.10========== 125 | 2024-11-9 126 | 1. 优化滚动条标识符 127 | 2. 优化标签页选项卡关闭标识符 128 | 3. 调整工具栏按钮默认字体大小 129 | 4. 树状图优化图标 130 | 5. 优化部分控件创建性能 131 | 6. 优化TinUIXml效率 132 | 133 | ==========5.9========== 134 | 2024-10-6 135 | 1. 增加extension拓展包,支持按钮化控件 136 | 2. radiobox增加funcs返回值 137 | 3. TinUITheme(明亮/暗黑)统一背景配色 138 | 4. 修复滚动条初始化可能导致的错误 139 | 140 | ==========5.8========== 141 | 2024-8-28 142 | 1. button2, barbutton优化有图标无文字的排版 143 | 2. listview新增元素获取、删除、增加方法 144 | 3. 更新entry样式 145 | 4. 更新passwordbox样式 146 | 5. barbutton兼容3.6~3.9版本python 147 | 6. 更新combobox样式 148 | 149 | ==========5.7========== 150 | 2024-8-23 151 | 1. 修复scalebar禁用后仍然出现响应样式的问题 152 | 2. 修复checkbutton禁用后标识符错误的问题 153 | 3. 启用帮助手册 154 | 155 | ==========5.6========== 156 | 2024-8-23 157 | 1. 对话框按钮自定义文本 158 | 2. 优化menubar, menubutton, picker, combobox动画视觉效果 159 | 3. 新增选择对话框 ask_choice (listbox) 160 | 4. 修复notebook载入TinUI页面的错误 161 | 162 | ==========5.5========== 163 | 2024-8-15 164 | 1. 内置对话框 165 | 166 | ==========5.4========== 167 | 2024-8-8 168 | 1. 新增工具栏按钮组件,barbutton(AppBarButton) 169 | 2. button2添加icon参数,用来使用Fluent Icons符号,compound in top,bottom,left,right 170 | 3. 修复ratingbar某些情况下无法选中的错误 171 | 172 | ==========5.3========== 173 | 2024-7-31 174 | 1. TinUIXml编辑器手动输入标记点信息 175 | 2. entry添加删除、插入文本方法 176 | 3. menubutton可选是否显示标识符 177 | 4. TinUIXml自定义间距,优先级比坐标自定低 178 | 179 | ==========5.2========== 180 | 2024-7-16 181 | 1. button最大化宽度、最小化宽度参数 182 | 2. button2最大化宽度、最小化宽度参数 183 | 3. 修复treeview跨级选定展开单层后的报错问题 184 | 4. TinUIXml简易编辑器添加标记点管理 185 | 5. listbox的add方法中重新设计位置确定逻辑 186 | 6. listbox回调command参数result增加result.index属性 187 | 188 | ==========5.1========== 189 | 2024-7-5 190 | 1. test\tuxmltest.py 升级为简易TinUIxml编辑器 191 | 2. 优化scalebar标识符元素 192 | 3. BasicTinUI新增show_location方法,用于设计时反馈坐标信息 193 | 4. checkbutton引发响应的command接受的唯一参数为选定状态,True/False 194 | 195 | ==========5.0========== 196 | 2024-6-24 197 | 1. 以下控件接入统一坐标对齐模式:listview, pipspager, ratingbar, 198 | radiobox, pivot, button2, waitframe, passwordbox, image, 199 | swipecontrol, picker 200 | 2. radiobox使用新样式,同时更改默认间距 201 | 3. 优化expander样式 202 | 4. 优化spinbox提示符 203 | 5. 优化passwordbox提示符 204 | 6. 修复TinUIXml自定义初始坐标被忽略的问题 205 | 7. tinuixml修复x,y参数自定义,新增anchor自定义(精确到line,但是每个标签内优先级更高) 206 | 2024-6-16 pre-5 207 | 1. 更新checkbutton样式 208 | 2. waitbar2新样式 209 | 3. 以下控件接入统一坐标对齐模式:checkbutton, entry, radiobutton, 210 | link, waitbar1, waitbar2, combobox, button, label, progressbar, 211 | table, onoff, spinbox, scalebar, info, waitbar3 212 | 4. radiobutton去除边框 213 | 5. combobox新样式,增加height参数,控制浮出窗口高度 214 | 6. onoff新样式 215 | 7. info提示触发文本后加入叹号提示文本标识符 216 | 8. waitbar3使用圆角 217 | 2024-2-15 pre-4 218 | 1. labelframe改为圆角边框 219 | 2. notebook新样式 220 | 3. ratingbar新样式,参数r改size(字体大小) 221 | 4. BasicTinUI.clean_windows()清除浮出控件的子窗口,TinUIXml的clean也会触发 222 | 5. notebook支持自定义滚动条颜色 223 | 2024-2-13 pre-3 224 | 1. 优化pipspager样式 225 | 2. textbox, listbox, canvas, ui支持自定scrollbar颜色 226 | 3. 新介绍窗口 227 | 4. scrollbar新标识元素 228 | 5. 修复treeview展开时可能的提示元素的位置错位 229 | 2024-2-9 pre-2 230 | 1. 更新menu样式 231 | 2. menubutton 添加segeo fluent icon字体文件 232 | 3. 更新picker样式 233 | 4. 新logo 234 | 5. 新增菜单按钮 menubutton 235 | 6. 更新黑暗样式 236 | 2024-2-6 pre-1 237 | 1. 添加TinUIFont类,管理字体文件 238 | 2. 更新table样式 239 | 240 | ==========4.7========== 241 | 2024-1-24 242 | 1. 优化radiobox样式 243 | 2. 新增滚动选值框 picker 244 | 245 | ==========4.6========== 246 | 2023-12-17 247 | 1. spinbox返回值添加num属性 248 | 2. 修复listbox横向滚动条长度错误的问题 249 | 250 | ==========4.5========== 251 | 2023-11-12 252 | 1. 修复treeview调试错误 253 | 254 | ==========4.4========== 255 | 2023-3-11 256 | 1. 新增密码输入框 passwordbox 257 | 258 | ==========4.3========== 259 | 2023-2-2 260 | 1. 优化帮助手册 261 | 2. 优化ratingbar, onoff外观 262 | 3. 优化spinbox外观,更新spinbox示例 263 | 4. 修复treeview的一个展开错误 264 | 5. 新增滑动控件 swipecontrol 265 | 266 | ==========4.2========== 267 | 2023-1-21 268 | 1. 更改image计算精度 269 | 2. listbox添加add、delete方法 270 | 3. ratingbar只选择一个星且再次选择第一个时,取消选择,返回0 271 | 4. 修复button2无法返回边框元素的错误 272 | 5. 修复radiobox示例中的错误 273 | 6. 添加状态开关按钮 togglebutton 274 | 275 | ==========4.1========== 276 | 2023-1-9 277 | 1. 优化 TinUI帮助手册 278 | 2. 添加pipspager切换动画 279 | 3. 修复treeview展开和闭合后触发选定的问题 280 | 281 | ==========4.0========== 282 | 2023-1-1 283 | 1. 优化radiobox效果 284 | 2. 修复listview返回元素不全的问题 285 | 3. 新增树状图 treeview 286 | 4. 使用TinUI LOGO.ico 287 | 5. 新增普通图片 image 288 | 6. 随包发布 TinUI帮助手册 实用程序,在\test目录下 289 | 7. 优化复选框标识符 290 | 291 | ==========3.34========== 292 | 2022-10-22 293 | 1. 新增列表视图 listview 294 | 2. 更新样式 295 | 3. TinUI支持直接横向滚动 296 | 4. 破坏性,tooltip返回值改为函数get_return,节省窗口资源 297 | 298 | ==========3.33========== 299 | 2022-10-4 300 | 1. 新增元素等待框 waitframe 301 | 302 | ==========3.32========== 303 | 2022-9-17 304 | 1. 感谢TotoWang-hhh(github)提交的自动识别windows系统深浅色模式样式 305 | 2. window.py添加快速翻页功能,方便样式theme开发者展示 306 | 307 | ==========3.31========== 308 | 2022-9-9 309 | 1. onoff移动动画 310 | 2. 创建TinUIWidget类,用来显示单个元素控件 311 | 3. 修改expander, notebook, notecard的圆角 312 | 4. back边框圆角 313 | 314 | ==========3.30========== 315 | 2022-8-27 316 | 1. tooltip新增delay参数,允许延时显示 317 | 2. textbox添加相关方法 318 | 3. 网站同步changelog 319 | 4. TinUIXml添加environment方法,用以快速导入funcs和datas 320 | 5. onoff重写,采用新样式,增加相关方法 321 | 6. scrollbar样式对称,不使用时保持静默状态 322 | 323 | ==========3.24========== 324 | 2022-8-20 325 | 1. 修复横向scrollbar最大值滚动问题 326 | 2. 更新pipspager标识符样式 327 | 3. 修复pipspager向左越界移动的问题 328 | 4. 版权更新 329 | 5. 添加此文件 330 | 331 | ==========3.23========== 332 | 2022-8-13 333 | 1. 增加entry方法 334 | 2. 增加entry测试文件 335 | 3. 更新ratingbar功能 336 | 4. link控件如果接受一个超链接,则显示链接地址 337 | 5. info/tooltip指定文本宽度 338 | 339 | ==========3.22========== 340 | 2022-8-6 341 | 1. 新增可折叠UI元素控件 expander 342 | 343 | ==========3.21========== 344 | 2022-7-30 345 | 1. 修复若干问题 346 | 2. 优化menu首次点击明显位移问题 347 | 348 | ==========3.20========== 349 | 2022-7-24 350 | 1. 防止三种waitbar元素名称重合 351 | 2. 添加圆角按钮 button2 352 | 3. 更新tooltip的圆角样式 353 | 4. info改为封装tooltip 354 | 355 | ==========2.16========== 356 | 2022-7-17 357 | 1. 添加支点标题组件 pivot 358 | 359 | ==========3.15========== 360 | 2022-7-13 361 | 1. 更新waitbar1的样式 362 | 2. 增加waitbar3的视觉效果 363 | 3. notebook可以更改标题名称 364 | 365 | ==========3.13========== 366 | 2022-7-3 367 | 1. 重新添加新的table最大宽度参数 368 | 2. notebook可指定是否响应新界面按钮 369 | 370 | ==========3.11========== 371 | 2022-6-26 372 | 1. 修复menu分割线,使用独立的线段绘制 373 | 2. 新增便笺控件 notecard 374 | 3. 在readme上添加示例代码 375 | 376 | ==========3.10========== 377 | 2022-6-19 378 | 1. 增加FuncList类统一管理返回函数 379 | 2. table新增maxwidth参数 380 | 3. 修改notebook样式 381 | 4. notebook新增界面可决定是否能删除 382 | 383 | ==========3.9========== 384 | 2022-6-5 385 | 1. 优化menu逻辑 386 | 2. 新增单选组控件 radiobox 387 | 3. scalebar标识线段圆角 388 | 4. 调整radiobox标识样式 389 | 5. 添加radiobox样式 390 | 391 | ==========3.7========== 392 | 2022-5-29 393 | 1. 添加TinUIEvent事件管理 394 | 2. 更新scalebar样式,启用WinUI3样式 395 | 3. 优化checkbutton标识符比例 396 | 397 | ==========3.6========== 398 | 2022-5-15 399 | 1. 完善TinUITheme类对于TinUIXml的契合度 400 | 2. 添加separate出现动画 401 | 3. 修复ratingbar糙度问题 402 | 4. link圆角背景 403 | 5. link添加目标函数,最高优先级 404 | 405 | ==========3.5========== 406 | 2022-5-8 407 | 1. 修复menu延迟动画问题 408 | 2. 更新配色样式 409 | 410 | ==========3.4========== 411 | 2022-5-3 412 | 1. menu滚动动画 413 | 2. 更新entry样式,启用WinUI3样式 414 | 3. 添加评星级控件 ratingbar 415 | 416 | ==========3.3========== 417 | 2022-4-30 418 | 1. 添加标签栏视图 notebook 419 | 420 | ==========3.1========== 421 | 2022-4-17 422 | 1. 更新checkbutton样式 423 | 2. uid的定义均改外字符串 424 | 3. labelframe增加pos标识参数,用于TinUIXml渲染 425 | 426 | ==========3.0========== 427 | 2022-4-3 428 | 1. 修复pipspager转换接口使用后,样式无变化的问题 429 | 2. 稳定TinUIXml使用以及规范 430 | 431 | ==========2.20========== 432 | 2022-3-27 433 | 1. 新增内置界面框架 ui 434 | 2. 修复TinUI自动刷新结束时报错的BUG,但不是元素控件,实际上这类报错无关紧要 435 | 3. 添加横向翻页视图 pipspager 436 | 437 | ==========2.16========== 438 | 2022-3-12 439 | 1. 添加TinUITheme统一基类 440 | 2. TinUIXml支持重写的TinUI和BasicTinUI的样式 441 | 3. 更新样式范例 442 | 4. 添加画布 canvas 443 | 5. 更新窗口样式 444 | 6. 修复button背景响应颜色显示错误的问题 445 | 7. 删除button响应测试代码 446 | 447 | ==========2.15========== 448 | 2022-2-26 449 | 1. 更新spinbox样式 450 | 2. 添加entry(可选)直接处理输入的功能 451 | 3. 添加TinUIXml对滚动条的支持 452 | 4. 新增列表框 listbox 453 | 454 | ==========2.14========== 455 | 2022-2-12 456 | 1. 修复上一个版本的xml解析问题 457 | 458 | ==========2.13========== 459 | 2022-2-12 460 | 1. 修复上一个版本的文档问题 461 | 462 | ==========2.12========== 463 | 2022-2-12 464 | 1. 添加lighttheme测试文件 465 | 2. 更新radiobutton样式 466 | 3. 添加配色风格示例 467 | 468 | ==========2.11========== 469 | 2022-2-9 470 | 1. 使用GPLv3开源协议 471 | 2. 编写tinuixml相关文档 472 | 473 | ==========2.10========== 474 | 2022-2-8 475 | 1. 新增文本框 textbox 476 | 2. 新增滚动体 scrollbar 477 | 478 | ==========2.9========== 479 | 2022-2-4 480 | 1. 更新entry边框样式 481 | 2. 添加带状等待框 waitbar3 482 | 483 | ==========2.8========== 484 | 2022-1-30 485 | 1. 更新scalebar初始坐标设计 486 | 2. 添加背景元素 back 487 | 3. scalebar新样式 488 | 4. 修复back坐标优先逻辑错误 489 | 5. 修复TinUIXml坐标初始化逻辑错误 490 | 6. 更新TinUIXml对元素控件uid获取 491 | 7. 更新link样式 492 | 8. link既可以指向网页,也可以指向函数,类winui设计 493 | 494 | ==========2.7========== 495 | 2022-1-36 496 | 1. TinUIXml允许行元素嵌套 497 | 2. xml布局确立行元素与纵块的概念 498 | 3. 添加TinUIXml代码预览测试文件 499 | 4. entry控件的边框和提示符位置由Entry组件控制,修复由字体改变造成的错误 500 | 5. 简化combobox的tag绑定 501 | 6. 添加窗口提示框架 tooltip 502 | 7. 修复TinUIXml的纵块无法确定最大宽度的问题 503 | 504 | ==========2.6========== 505 | 2021-1-24 506 | 1. TinUI主体和框架分离,主体为BasicTinUI,框架为TinUI 507 | 2. 测试button combobox返回参数 508 | 3. 完善scalebar测试 509 | 4. 优化progressbar测试 510 | 5. 创建TinUIXml,允许使用xml语言来渲染TinUI或BasicTinUI的组件界面 511 | 6. 更新xml换行解析渲染逻辑 512 | 513 | ==========2.5========== 514 | 2021-1-21 515 | 1. TinUI左键单击获取焦点 516 | 2. entry使用WinUI2样式 517 | 3. 更新checkbutton样式 518 | 4. 增加checkbutton样式参数 519 | 5. 修复checkbutotn状态标识符点击无效的问题 520 | 6. 为同框架元素控件添加统一的最后一个返回值uid,为xml布局打下基础 521 | 7. 修改menu默认透明色 522 | 523 | ==========2.4========== 524 | 2022-1-2 525 | 1. 添加table示例 526 | 2. 修复table表头高度不一致的问题 527 | 3. 更新button样式 528 | 529 | ==========2.3========== 530 | 2021-12-19 531 | 1. 修复menu初次显示的位移问题,修复圆角 532 | 533 | ==========2.2========== 534 | 2021-12-12 535 | 1. button新增边框参数 536 | 2. 恢复table的minwidth参数 537 | 3. 修复button边缘无响应的问题 538 | 4. 修改table样式 539 | 5. 修改menu布局 540 | 6. 启用圆角menu样式 541 | 542 | ==========2.1========== 543 | 2021-11-13 544 | 1. 调整元素层级 545 | 2. 添加菜单 menu 546 | 3. 确定菜单内容标记 547 | 548 | ==========2.0========== 549 | 2021-10-24 550 | 1. 添加气泡提示 info 551 | 2. 提供完善的API 552 | 553 | ==========1.9========== 554 | 2021-10-4 555 | 1. 修改entry样式 556 | 557 | ==========1.8========== 558 | 2021-8-25 559 | 1. 修复scalebar拖拽问题 560 | 2. 添加button相关方法 561 | 3. 添加button示例 562 | 4. 添加radiobutton相关方法 563 | 5. 修改combobox样式 564 | 6. 修改spinbox样式 565 | 7. 添加scalebar示例 566 | 8. 添加checkbutton radiobutton示例 567 | 9. 添加scalebar相关方法 568 | 569 | ==========1.6========== 570 | 2021-8-20 571 | 1. 确定TinUI logo 572 | 2. 添加调节框 scalebar 573 | 574 | ==========1.5========== 575 | 2021-8-7 576 | 1. checkbutton添加新文本元素及参数 577 | 2. 添加选值框 spinbox 578 | 579 | ==========1.4========== 580 | 2021-8-3 581 | 1. 修改button combobox原始样式 582 | 2. 修改link样式 583 | 3. 修改waitbar1 waitbar2样式 584 | 4. 添加开关 onoff 585 | 5. 修改combobox样式 586 | 587 | ==========1.3========== 588 | 2021-7-27 589 | 1. 添加表格 table 590 | 591 | ==========1.2========== 592 | 2021-7-25 593 | 1. 添加进度条 progressbar 594 | 595 | ==========1.1.2========== 596 | 2021-7-23 597 | 1. 修改readme文件链接错误 598 | 599 | ==========1.1.1========== 600 | 2021-7-23 601 | 1. 修复waitbar2样式 602 | 603 | ==========1.1========== 604 | 2021-7-21 605 | 1. 添加点状等待组件 waitbar2 606 | 2. 添加组合框 combobox 607 | 3. 上传组件样式图像gif 608 | 4. 在readme文件中添加gif链接 609 | 610 | ==========1.0========== 611 | 2021-7-16 612 | 1. 添加TinUINum记录结构类 613 | 2. 添加TinUI自动刷新滚动范围的参数 614 | 3. 修复checkbutton回调问题 615 | 4. 添加圆形等待组件 waitbar1 616 | 5. 移除其它依赖,完全使用标准库 617 | 618 | ==========beta-6(preview)========== 619 | 2021-7-13 620 | 1. 取消对TinEngine的内部调用支持,计划使用完整的标准库编写 621 | 2. 添加button激活样式 622 | 623 | ==========beta-5========== 624 | 2021-6-26 625 | 1. 为部分元素控件添加对齐位置参数 626 | 2. 添加超链接 link 627 | 628 | ==========beta-4========== 629 | 2021-5-16 630 | 1. 添加分割线 separate 631 | 2. 添加单选框 radiobutton 632 | 633 | ==========beta-3========== 634 | 2021-4-17 635 | 1. 添加输入框 entry 636 | 637 | ==========beta-2========== 638 | 2021-3-27 639 | 1. 添加复选框元素控件 checkbutton 640 | 641 | ==========beta-1========== 642 | 2021-3-20 643 | 1. 正式命名TinUI 644 | 2. 确定TinUI开发方向,为tkinter提供现代样式的独立元素控件 645 | 3. 创建文本元素控件 title label paragraph 646 | 4. 创建按钮元素控件 button 647 | 648 | ==========alpha-4========== 649 | 2021-1 650 | 1. 放弃文本排版路线 651 | 2. 开始绘图元素控件路线 652 | 653 | ==========alpha-3========== 654 | 2020-11 655 | 1. 停止对TinEngine的专门支持 656 | 2. 删除基本绘图包装 657 | 3. 计划文本排版功能 658 | 659 | ==========alpha-2========== 660 | 2020-3 661 | 1. 包装基本绘图功能 662 | 663 | ==========alpha-1========== 664 | 2019 665 | 1. 创建项目,作为TinEngine内置功能画布 666 | -------------------------------------------------------------------------------- /docs/changelog/ver.txt: -------------------------------------------------------------------------------- 1 | 5.28 -------------------------------------------------------------------------------- /docs/contributors/index.md: -------------------------------------------------------------------------------- 1 | # TinUI项目贡献者 2 | 3 | 以github名称及相关开源平台昵称为名。 4 | 5 | ## Smart-Space 6 | 7 | [Smart-Space](https://github.com/Smart-Space), 8 | 9 | TinUI发起人以及版权所有者,主要贡献者、维护者。 10 | 11 | 全权参与TinUI的维护和开发。 12 | 13 | ## TotoWang-hhh 14 | 15 | [TotoWang-hhh](https://github.com/TotoWang-hhh), 16 | 17 | 为TinUI提供了在windows上自动识别深浅色模式样式。 -------------------------------------------------------------------------------- /docs/test/index.md: -------------------------------------------------------------------------------- 1 | # TinUI测试项目 2 | 3 | TinUI测试项目包括: 4 | 5 | 1. 部分元素控件的使用方法 6 | 2. 明亮/黑白样式 -------------------------------------------------------------------------------- /docs/widget/info.json: -------------------------------------------------------------------------------- 1 | { 2 | "title":"大字号标题文本" 3 | } -------------------------------------------------------------------------------- /extension.py: -------------------------------------------------------------------------------- 1 | """ 2 | TinUI拓展功能包 3 | """ 4 | 5 | Extension='TinUI' 6 | 7 | 8 | def buttonlize(tinui,uid,bg='#fbfbfb',line='#CCCCCC',activebg='#f5f5f5',activeline='#e5e5e5',command=None):#按钮化tinui控件 9 | def in_button(e): 10 | tinui.itemconfig(outline,outline=activeline,fill=activeline) 11 | def out_button(e): 12 | tinui.itemconfig(back,fill=bg,outline=bg) 13 | tinui.itemconfig(outline,outline=line,fill=line) 14 | def on_click(e): 15 | tinui.itemconfig(back,fill=activebg,outline=activebg) 16 | tinui.after(500,lambda : out_button(None)) 17 | if command: 18 | command() 19 | 20 | x1,y1,x2,y2=tinui.bbox(uid) 21 | x1+=1 22 | y1+=1 23 | x2-=1 24 | y2-=1 25 | outlinepos=(x1,y1,x2,y1,x2,y2,x1,y2) 26 | nameid=uid+'-buttonlize' 27 | outline=tinui.create_polygon(outlinepos,width=9,fill=line,outline=line,tags=nameid) 28 | back=tinui.create_polygon(outlinepos,width=7,fill=bg,outline=bg,tags=nameid) 29 | tinui.lower(nameid,uid) 30 | 31 | tinui.tag_bind(nameid,'',on_click) 32 | tinui.tag_bind(nameid,'',in_button) 33 | tinui.tag_bind(nameid,'',out_button) 34 | tinui.tag_bind(uid,'',on_click) 35 | tinui.tag_bind(uid,'',in_button) 36 | tinui.tag_bind(uid,'',out_button) 37 | -------------------------------------------------------------------------------- /image/LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/LOGO.png -------------------------------------------------------------------------------- /image/TinUI便笺.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI便笺.gif -------------------------------------------------------------------------------- /image/TinUI信息提示对话框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI信息提示对话框.gif -------------------------------------------------------------------------------- /image/TinUI元素等待框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI元素等待框.gif -------------------------------------------------------------------------------- /image/TinUI内置ui.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI内置ui.gif -------------------------------------------------------------------------------- /image/TinUI分割线.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI分割线.gif -------------------------------------------------------------------------------- /image/TinUI列表框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI列表框.gif -------------------------------------------------------------------------------- /image/TinUI列表视图.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI列表视图.gif -------------------------------------------------------------------------------- /image/TinUI刷新可视范围.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI刷新可视范围.gif -------------------------------------------------------------------------------- /image/TinUI单选框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI单选框.gif -------------------------------------------------------------------------------- /image/TinUI单选组控件.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI单选组控件.gif -------------------------------------------------------------------------------- /image/TinUI可折叠UI.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI可折叠UI.gif -------------------------------------------------------------------------------- /image/TinUI图片1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI图片1.gif -------------------------------------------------------------------------------- /image/TinUI复选框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI复选框.gif -------------------------------------------------------------------------------- /image/TinUI密码输入框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI密码输入框.gif -------------------------------------------------------------------------------- /image/TinUI工具栏按钮组件.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI工具栏按钮组件.gif -------------------------------------------------------------------------------- /image/TinUI开关.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI开关.gif -------------------------------------------------------------------------------- /image/TinUI按钮.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI按钮.gif -------------------------------------------------------------------------------- /image/TinUI按钮2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI按钮2.gif -------------------------------------------------------------------------------- /image/TinUI支点标题.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI支点标题.gif -------------------------------------------------------------------------------- /image/TinUI文本框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI文本框.gif -------------------------------------------------------------------------------- /image/TinUI明亮样式.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI明亮样式.gif -------------------------------------------------------------------------------- /image/TinUI标签.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI标签.gif -------------------------------------------------------------------------------- /image/TinUI标签栏视图.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI标签栏视图.gif -------------------------------------------------------------------------------- /image/TinUI标题边框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI标题边框.gif -------------------------------------------------------------------------------- /image/TinUI树状图.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI树状图.gif -------------------------------------------------------------------------------- /image/TinUI横向翻页视图.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI横向翻页视图.gif -------------------------------------------------------------------------------- /image/TinUI气泡提示.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI气泡提示.gif -------------------------------------------------------------------------------- /image/TinUI浮出ui控件.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI浮出ui控件.gif -------------------------------------------------------------------------------- /image/TinUI滑动控件.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI滑动控件.gif -------------------------------------------------------------------------------- /image/TinUI滚动条.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI滚动条.gif -------------------------------------------------------------------------------- /image/TinUI滚动选择框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI滚动选择框.gif -------------------------------------------------------------------------------- /image/TinUI状态开关按钮.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI状态开关按钮.gif -------------------------------------------------------------------------------- /image/TinUI画布.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI画布.gif -------------------------------------------------------------------------------- /image/TinUI窗口提示.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI窗口提示.gif -------------------------------------------------------------------------------- /image/TinUI等待1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI等待1.gif -------------------------------------------------------------------------------- /image/TinUI等待2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI等待2.gif -------------------------------------------------------------------------------- /image/TinUI等待3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI等待3.gif -------------------------------------------------------------------------------- /image/TinUI组合框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI组合框.gif -------------------------------------------------------------------------------- /image/TinUI绘制组件.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI绘制组件.gif -------------------------------------------------------------------------------- /image/TinUI菜单.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI菜单.gif -------------------------------------------------------------------------------- /image/TinUI菜单按钮.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI菜单按钮.gif -------------------------------------------------------------------------------- /image/TinUI表格.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI表格.gif -------------------------------------------------------------------------------- /image/TinUI评星级控件.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI评星级控件.gif -------------------------------------------------------------------------------- /image/TinUI调节框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI调节框.gif -------------------------------------------------------------------------------- /image/TinUI起步.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI起步.gif -------------------------------------------------------------------------------- /image/TinUI输入框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI输入框.gif -------------------------------------------------------------------------------- /image/TinUI进度条.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI进度条.gif -------------------------------------------------------------------------------- /image/TinUI选值框.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI选值框.gif -------------------------------------------------------------------------------- /image/TinUI黑暗样式.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/TinUI黑暗样式.gif -------------------------------------------------------------------------------- /image/超链接.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/image/超链接.gif -------------------------------------------------------------------------------- /lgpl-3.md: -------------------------------------------------------------------------------- 1 | # TinUI 2 | 3 | TinUI的开源协议在GPL-3的基础上,于**5.11**版本开始,正式授权LGPL-3额外许可。 4 | 5 | # GNU LESSER GENERAL PUBLIC LICENSE 6 | 7 | Version 3, 29 June 2007 8 | 9 | Copyright (C) 2007 Free Software Foundation, Inc. 10 | 11 | 12 | Everyone is permitted to copy and distribute verbatim copies of this 13 | license document, but changing it is not allowed. 14 | 15 | This version of the GNU Lesser General Public License incorporates the 16 | terms and conditions of version 3 of the GNU General Public License, 17 | supplemented by the additional permissions listed below. 18 | 19 | ## 0. Additional Definitions. 20 | 21 | As used herein, "this License" refers to version 3 of the GNU Lesser 22 | General Public License, and the "GNU GPL" refers to version 3 of the 23 | GNU General Public License. 24 | 25 | "The Library" refers to a covered work governed by this License, other 26 | than an Application or a Combined Work as defined below. 27 | 28 | An "Application" is any work that makes use of an interface provided 29 | by the Library, but which is not otherwise based on the Library. 30 | Defining a subclass of a class defined by the Library is deemed a mode 31 | of using an interface provided by the Library. 32 | 33 | A "Combined Work" is a work produced by combining or linking an 34 | Application with the Library. The particular version of the Library 35 | with which the Combined Work was made is also called the "Linked 36 | Version". 37 | 38 | The "Minimal Corresponding Source" for a Combined Work means the 39 | Corresponding Source for the Combined Work, excluding any source code 40 | for portions of the Combined Work that, considered in isolation, are 41 | based on the Application, and not on the Linked Version. 42 | 43 | The "Corresponding Application Code" for a Combined Work means the 44 | object code and/or source code for the Application, including any data 45 | and utility programs needed for reproducing the Combined Work from the 46 | Application, but excluding the System Libraries of the Combined Work. 47 | 48 | ## 1. Exception to Section 3 of the GNU GPL. 49 | 50 | You may convey a covered work under sections 3 and 4 of this License 51 | without being bound by section 3 of the GNU GPL. 52 | 53 | ## 2. Conveying Modified Versions. 54 | 55 | If you modify a copy of the Library, and, in your modifications, a 56 | facility refers to a function or data to be supplied by an Application 57 | that uses the facility (other than as an argument passed when the 58 | facility is invoked), then you may convey a copy of the modified 59 | version: 60 | 61 | - a) under this License, provided that you make a good faith effort 62 | to ensure that, in the event an Application does not supply the 63 | function or data, the facility still operates, and performs 64 | whatever part of its purpose remains meaningful, or 65 | - b) under the GNU GPL, with none of the additional permissions of 66 | this License applicable to that copy. 67 | 68 | ## 3. Object Code Incorporating Material from Library Header Files. 69 | 70 | The object code form of an Application may incorporate material from a 71 | header file that is part of the Library. You may convey such object 72 | code under terms of your choice, provided that, if the incorporated 73 | material is not limited to numerical parameters, data structure 74 | layouts and accessors, or small macros, inline functions and templates 75 | (ten or fewer lines in length), you do both of the following: 76 | 77 | - a) Give prominent notice with each copy of the object code that 78 | the Library is used in it and that the Library and its use are 79 | covered by this License. 80 | - b) Accompany the object code with a copy of the GNU GPL and this 81 | license document. 82 | 83 | ## 4. Combined Works. 84 | 85 | You may convey a Combined Work under terms of your choice that, taken 86 | together, effectively do not restrict modification of the portions of 87 | the Library contained in the Combined Work and reverse engineering for 88 | debugging such modifications, if you also do each of the following: 89 | 90 | - a) Give prominent notice with each copy of the Combined Work that 91 | the Library is used in it and that the Library and its use are 92 | covered by this License. 93 | - b) Accompany the Combined Work with a copy of the GNU GPL and this 94 | license document. 95 | - c) For a Combined Work that displays copyright notices during 96 | execution, include the copyright notice for the Library among 97 | these notices, as well as a reference directing the user to the 98 | copies of the GNU GPL and this license document. 99 | - d) Do one of the following: 100 | - 0) Convey the Minimal Corresponding Source under the terms of 101 | this License, and the Corresponding Application Code in a form 102 | suitable for, and under terms that permit, the user to 103 | recombine or relink the Application with a modified version of 104 | the Linked Version to produce a modified Combined Work, in the 105 | manner specified by section 6 of the GNU GPL for conveying 106 | Corresponding Source. 107 | - 1) Use a suitable shared library mechanism for linking with 108 | the Library. A suitable mechanism is one that (a) uses at run 109 | time a copy of the Library already present on the user's 110 | computer system, and (b) will operate properly with a modified 111 | version of the Library that is interface-compatible with the 112 | Linked Version. 113 | - e) Provide Installation Information, but only if you would 114 | otherwise be required to provide such information under section 6 115 | of the GNU GPL, and only to the extent that such information is 116 | necessary to install and execute a modified version of the 117 | Combined Work produced by recombining or relinking the Application 118 | with a modified version of the Linked Version. (If you use option 119 | 4d0, the Installation Information must accompany the Minimal 120 | Corresponding Source and Corresponding Application Code. If you 121 | use option 4d1, you must provide the Installation Information in 122 | the manner specified by section 6 of the GNU GPL for conveying 123 | Corresponding Source.) 124 | 125 | ## 5. Combined Libraries. 126 | 127 | You may place library facilities that are a work based on the Library 128 | side by side in a single library together with other library 129 | facilities that are not Applications and are not covered by this 130 | License, and convey such a combined library under terms of your 131 | choice, if you do both of the following: 132 | 133 | - a) Accompany the combined library with a copy of the same work 134 | based on the Library, uncombined with any other library 135 | facilities, conveyed under the terms of this License. 136 | - b) Give prominent notice with the combined library that part of it 137 | is a work based on the Library, and explaining where to find the 138 | accompanying uncombined form of the same work. 139 | 140 | ## 6. Revised Versions of the GNU Lesser General Public License. 141 | 142 | The Free Software Foundation may publish revised and/or new versions 143 | of the GNU Lesser General Public License from time to time. Such new 144 | versions will be similar in spirit to the present version, but may 145 | differ in detail to address new problems or concerns. 146 | 147 | Each version is given a distinguishing version number. If the Library 148 | as you received it specifies that a certain numbered version of the 149 | GNU Lesser General Public License "or any later version" applies to 150 | it, you have the option of following the terms and conditions either 151 | of that published version or of any later version published by the 152 | Free Software Foundation. If the Library as you received it does not 153 | specify a version number of the GNU Lesser General Public License, you 154 | may choose any version of the GNU Lesser General Public License ever 155 | published by the Free Software Foundation. 156 | 157 | If the Library as you received it specifies that a proxy can decide 158 | whether future versions of the GNU Lesser General Public License shall 159 | apply, that proxy's public statement of acceptance of any version is 160 | permanent authorization for you to choose that version for the 161 | Library. 162 | -------------------------------------------------------------------------------- /test/LOGO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Smart-Space/TinUI/ce26e0f16f3fc7613816cd2606efa10424a04931/test/LOGO.png -------------------------------------------------------------------------------- /test/button.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def change1(event): 4 | func[0](test1) 5 | def test1(event): 6 | print('1') 7 | def change2(event): 8 | func[0](test2) 9 | def test2(event): 10 | print('2') 11 | 12 | def disable(event): 13 | func2.disable() 14 | def active(event): 15 | func2[2]() 16 | 17 | a=win() 18 | u=a.u 19 | u.add_button((10,5),'切换到函数1',command=change1) 20 | u.add_button((150,5),'切换到函数2',command=change2) 21 | u.add_button((250,5),'禁止按钮',command=disable) 22 | u.add_button((350,5),'激活按钮',command=active) 23 | _,_,func,_=u.add_button((5,100),'测试按钮',command=test1) 24 | _,_,func2,_=u.add_button((100,100),'测试按钮2',command=test1) 25 | 26 | a.go() 27 | -------------------------------------------------------------------------------- /test/checkbutton.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def flash(e): 4 | funcs[0]() 5 | def on(e): 6 | funcs[1]() 7 | def off(e): 8 | funcs[2]() 9 | def ac(e): 10 | funcs[4]() 11 | def di(e): 12 | funcs[3]() 13 | 14 | def func(state): 15 | print('state: '+str(state)) 16 | 17 | a=win() 18 | u=a.u 19 | u.add_button((2,5),'切换状态',command=flash) 20 | u.add_button((80,5),'选定',command=on) 21 | u.add_button((160,5),'取消选定',command=off) 22 | u.add_button((260,5),'disable',command=di) 23 | u.add_button((340,5),'active',command=ac) 24 | _,_,funcs,_=u.add_checkbutton((2,50),'测试checkbutton',command=func) 25 | a.go() 26 | -------------------------------------------------------------------------------- /test/combobox.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def select(e): 4 | funcs[0](2) 5 | def disable(e): 6 | funcs[1]() 7 | def active(e): 8 | funcs[2]() 9 | 10 | a=win() 11 | u=a.u 12 | u.add_button((2,5),'选定第三个值',command=select) 13 | u.add_button((150,5),'禁用',command=disable) 14 | u.add_button((220,5),'启用',command=active) 15 | _,_,_,funcs,_=u.add_combobox((2,50),text='test combobox',content=('1','2','3','4','5')) 16 | 17 | a.go() 18 | -------------------------------------------------------------------------------- /test/entry.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def getin(*e): 4 | con=func.get() 5 | u.itemconfig(p,text='输入内容:'+con) 6 | 7 | def renormal(*e): 8 | func.normal() 9 | 10 | def error(*e): 11 | func.error() 12 | 13 | def disable(*e): 14 | func.disable() 15 | 16 | def active(*e): 17 | func.active() 18 | 19 | def insert(*e): 20 | func.insert(text='insert text') 21 | 22 | 23 | a=win() 24 | u=a.u 25 | u.add_button((10,5),'获取输入内容',command=getin) 26 | u.add_button((150,5),'禁用输入框',command=disable) 27 | u.add_button((250,5),'恢复输入框',command=renormal) 28 | u.add_button((350,5),'显示错误样式',command=error) 29 | entry,func,_=u.add_entry((180,50),anchor='n',width=300) 30 | p=u.add_paragraph((5,100),text='输入内容:') 31 | 32 | u.add_button((10,200),'用active恢复',command=active) 33 | u.add_button((10,250),'插入文本',command=insert) 34 | 35 | a.go() 36 | -------------------------------------------------------------------------------- /test/extension.buttonlize.py: -------------------------------------------------------------------------------- 1 | from window import win, extension 2 | from extension import buttonlize 3 | 4 | def go(e): 5 | buttonlize(u,'btllb',command=func) 6 | 7 | def func(): 8 | print('click') 9 | 10 | a=win() 11 | u=a.u 12 | 13 | lb=u.add_label((15,15),text='buttonlized label')[-1] 14 | lb2=u.add_button((15,60),text='buttonlized button',command=print)[-1] 15 | 16 | u.addtag_withtag('btllb',lb) 17 | u.addtag_withtag('btllb',lb2) 18 | 19 | u.add_button2((15,120),text='buttonlize',command=go) 20 | 21 | a.go() 22 | -------------------------------------------------------------------------------- /test/image.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def mnone(e): 4 | u.add_image((10,40),100,200,'none','LOGO.png') 5 | 6 | def mfill(e): 7 | u.add_image((190,40),100,200,'fill','LOGO.png') 8 | 9 | def muniform(e): 10 | u.add_image((300,40),100,200,'uniform','LOGO.png') 11 | 12 | 13 | a=win() 14 | u=a.u 15 | u.add_button((10,5),'None',command=mnone) 16 | u.add_button((190,5),'Fill',command=mfill) 17 | u.add_button((350,5),'Uniform',command=muniform) 18 | 19 | a.go() 20 | -------------------------------------------------------------------------------- /test/link.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def active(e): 4 | funcs[1]() 5 | def disable(e): 6 | funcs[0]() 7 | 8 | a=win() 9 | u=a.u 10 | _,funcs,_=u.add_link((5,5),'Smart-Space个人网站','https://smart-space.com.cn/') 11 | u.add_button((5,40),'禁用链接',command=disable) 12 | u.add_button((120,40),'恢复链接',command=active) 13 | a.go() 14 | -------------------------------------------------------------------------------- /test/listbox.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def additem(e): 4 | funcs.add('new item new item new item new item new item') 5 | def deleteitem(e): 6 | funcs.delete(1) 7 | def deleteall(e): 8 | funcs.clear() 9 | def print__(name): 10 | print(name,name.index) 11 | 12 | a=win() 13 | u=a.u 14 | _,_,funcs,_=u.add_listbox((5,5),data=(),command=print__) 15 | 16 | u.add_button((5,300),'添加元素',command=additem) 17 | #u.add_button((120,300),'删除第二个元素'+'\uE755',font='{Segoe MDL2} 12',command=deleteitem) 18 | u.add_button((120,300),'删除第二个元素',command=deleteitem) 19 | u.add_button((120,350),'清空元素',command=deleteall) 20 | a.go() 21 | -------------------------------------------------------------------------------- /test/listview.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def additem(e): 4 | uixml = funcs.add()[-2] 5 | uixml.loadxml(onexml) 6 | def add10(e): 7 | for i in range(0,10): 8 | additem(e) 9 | def deleteitem(e): 10 | funcs.delete(1) 11 | def deleteitem1(e): 12 | funcs.delete(0) 13 | def deleteall(e): 14 | funcs.clear() 15 | def print__(name): 16 | print(name) 17 | 18 | a=win() 19 | u=a.u 20 | funcs=u.add_listview((10,5),command=print__)[-2] 21 | 22 | onexml=''' 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | ''' 31 | 32 | lvitems=funcs.getitems() 33 | lvcontent=( 34 | ('BasicTinUI','TinUI框架渲染核心','https://tinui.smart-space.com.cn'), 35 | ('TinUI','基于tkinter的现代元素控件框架','https://smart-space.com.cn/project/TinUI/index.html'), 36 | ('CSDN','中文IT技术交流平台','https://www.csdn.net/'), 37 | ('TinText','新版TinML实现平台','https://tintext.smart-space.com.cn/'), 38 | ('Smart-Space','个人开发者名称','https://smart-space.com.cn') 39 | ) 40 | for i in range(0,5): 41 | lvitems[i][2].loadxml(f''' 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | ''') 53 | 54 | u.add_button((5,320),'添加元素',command=additem) 55 | u.add_button((120,320),'删除第一个元素',command=deleteitem1) 56 | u.add_button((120,370),'删除第二个元素',command=deleteitem) 57 | u.add_button((120,420),'清空元素',command=deleteall) 58 | u.add_button((120,470),'增加十个',command=add10) 59 | 60 | a.go() 61 | -------------------------------------------------------------------------------- /test/maintest.py: -------------------------------------------------------------------------------- 1 | ''' 2 | TinUI的控件整合展示 3 | 考虑到TinUI.py的测试界面比较杂乱,大版本(5.0)中启用该界面展示/测试文件 4 | TinUI.py的测试部分仍然保持最新状态,本文件以及从属文件(./testpage)也会持续更新 5 | ''' 6 | import sys 7 | import os 8 | sys.path.append('..') 9 | from TinUI import * 10 | from tkinter import Tk 11 | path=os.path.dirname(os.path.abspath(__file__)) 12 | 13 | load_menubar=False 14 | 15 | def opentutest(e): 16 | exec(open("tuxmltest.py",encoding='utf-8').read(),{'__file__':os.path.dirname(__file__)+r'\tuxmltest.py'}) 17 | 18 | def loadcontrol(controlname): 19 | global load_menubar 20 | #导入控件说明 21 | cfile=open("testpage/"+controlname+".xml",mode='r',encoding='utf-8') 22 | cxml=cfile.read() 23 | cfile.close() 24 | duixml.clean() 25 | 26 | duixml.funcs["opentutest"] = opentutest 27 | 28 | duixml.loadxml(cxml) 29 | if controlname=='canvas': 30 | canvas=duixml.tags['canvas'][0] 31 | canvas.create_text((5,5),text='画布对象:文字。\n需要获取add_canvas的第一个返回值',font='微软雅黑 12',anchor='nw') 32 | elif controlname=='menubar': 33 | #if not load_menubar: 34 | # print('ok') 35 | # label=duixml.tags['label'][-1] 36 | # displayui.add_menubar(label) 37 | #load_menubar=True 38 | label=duixml.tags['label'][-1] 39 | displayui.add_menubar(label) 40 | elif controlname=='notebook': 41 | notebook=duixml.tags['notebook'][-2] 42 | for i in range(1,5): 43 | if i==5:#第五个不可删除: 44 | notebook.addpage('test'+str(i),'t'+str(i),cancancel=False) 45 | else: 46 | notebook.addpage('test'+str(i),'t'+str(i)) 47 | elif controlname=='waitframe': 48 | waitframe=duixml.tags['waitframe'][-2] 49 | waitframe.start() 50 | elif controlname=='TinUIXml':#严格来说,这不是控件,而是TinUI框架的一部分 51 | pass 52 | 53 | 54 | 55 | xmlf=open(os.path.dirname(__file__)+r'\testpage\main.xml','r') 56 | xml=xmlf.read() 57 | xmlf.close() 58 | 59 | window = Tk() 60 | 61 | # if platform.system()=='Windows': 62 | # import ctypes 63 | # try: 64 | # ctpyes.windll.shcore.SetProcessDpiAwareness(1) 65 | # except: 66 | # ctypes.windll.user32.SetProcessDPIAware() 67 | 68 | window.resizable(False,False) 69 | window.iconbitmap('../LOGO.ico') 70 | window.title("TinUI main test") 71 | window.geometry("850x600+5+5") 72 | ui=BasicTinUI(window, bg='#f3f3f3') 73 | uix=TinUIXml(ui) 74 | 75 | uix.funcs['loadcontrol']=loadcontrol 76 | uix.datas['controls']=['back', 'barbutton', 'button', 'button2', 'canvas', 'checkbutton', 77 | 'combobox', 'entry', 'expander', 'flyout', 'image', 'info', 'label', 'labelframe', 78 | 'link', 'listbox', 'listview', 'menubar', 'menubutton', 'notebook', 'notecard', 79 | 'onoff', 'paragraph', 'passwordbox', 'picker', 'pipspager', 'pivot', 'progressbar', 80 | 'radiobox', 'radiobutton', 'ratingbar', 'scalebar', 'scrollbar', 'separate', 81 | 'spinbox', 'swipecontrol', 'table', 'textbox', 'title', 'togglebutton', 'tooltip', 82 | 'treeview', 'ui', 'waitbar', 'waitframe','TinUIXml'] 83 | uix.loadxml(xml) 84 | displayui,_,duixml,_=uix.tags['displayui'] 85 | 86 | ui.pack(fill='both',expand=True) 87 | 88 | 89 | def maintest(): 90 | window.mainloop() 91 | 92 | if __name__=='__main__': 93 | maintest() 94 | -------------------------------------------------------------------------------- /test/onoff.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | 4 | def disable(e): 5 | funcs.disable() 6 | def active(e): 7 | funcs.active() 8 | def on(e): 9 | funcs.on() 10 | def off(e): 11 | funcs.off() 12 | 13 | a=win() 14 | u=a.u 15 | funcs=u.add_onoff((5,40),command=print)[-2] 16 | u.add_button((5,5),'禁用',command=disable) 17 | u.add_button((80,5),'恢复',command=active) 18 | u.add_button2((160,5),'开启',command=on) 19 | u.add_button2((240,5),'关闭',command=off) 20 | 21 | #ctypes.windll.shcore.SetProcessDpiAwareness(1) 22 | 23 | a.go() 24 | -------------------------------------------------------------------------------- /test/pivot.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | 4 | 5 | a=win() 6 | u=a.u 7 | pivot = u.add_pivot((5,5))[-2] 8 | u.add_button((10,80),text='选择第二个',command=lambda e:pivot.select(1)) 9 | 10 | a.go() 11 | -------------------------------------------------------------------------------- /test/progressbar.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def run(event): 4 | from time import sleep 5 | for button in (b1,ba,bb,bc,bd): 6 | button[2][1]() 7 | for i in range(1,101): 8 | sleep(0.02) 9 | goto(i) 10 | for button in (b1,ba,bb,bc,bd): 11 | button[2][2]() 12 | def to60(event): 13 | goto(60) 14 | def stop(event): 15 | funcs[1]() 16 | def error(event): 17 | funcs[2]() 18 | def normal(event): 19 | funcs[0]() 20 | 21 | a=win() 22 | u=a.u 23 | b1=u.add_button((2,5),'全过程',command=run) 24 | ba=u.add_button((80,5),'固定到60%',command=to60) 25 | bb=u.add_button((180,5),'暂停',command=stop) 26 | bc=u.add_button((240,5),'意外错误',command=error) 27 | bd=u.add_button((340,5),'恢复正常',command=normal) 28 | _,_,_,goto,funcs,_=u.add_progressbar((2,50)) 29 | a.go() 30 | -------------------------------------------------------------------------------- /test/radiobox.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | 4 | def di(e): 5 | funcs.disable() 6 | def ac(e): 7 | funcs.active() 8 | 9 | a=win() 10 | u=a.u 11 | u.add_button((180,5),'禁用',command=di) 12 | u.add_button((250,5),'激活',command=ac) 13 | _,funcs,_=u.add_radiobox((5,50),content=('1','','2')) 14 | 15 | a.go() 16 | -------------------------------------------------------------------------------- /test/radiobutton.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def s(e): 4 | funcs[0](2) 5 | def di(e): 6 | funcs[1]() 7 | def ac(e): 8 | funcs[2]() 9 | 10 | a=win() 11 | u=a.u 12 | u.add_button((2,5),'选定第三个选项',command=s) 13 | u.add_button((180,5),'禁用',command=di) 14 | u.add_button((250,5),'激活',command=ac) 15 | _,_,_,funcs,_=u.add_radiobutton((5,50),width=200,text='test radio button',choices=('1','2','3','4','5','6')) 16 | 17 | a.go() 18 | -------------------------------------------------------------------------------- /test/ratingbar.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | 4 | def func(e): 5 | f.setrate(2) 6 | 7 | a=win() 8 | u=a.u 9 | f = u.add_ratingbar((5,5))[-2] 10 | u.add_button((5,50), text='选择第二个', command=func) 11 | 12 | a.go() 13 | -------------------------------------------------------------------------------- /test/scalebar.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def s(e): 4 | funcs[0](2) 5 | def di(e): 6 | funcs[1]() 7 | def ac(e): 8 | funcs[2]() 9 | def show(val): 10 | u.itemconfig(text,text='选择的值为:'+val) 11 | 12 | a=win() 13 | u=a.u 14 | u.add_button((2,5),'选定第三个选项',command=s) 15 | u.add_button((180,5),'禁用',command=di) 16 | u.add_button((250,5),'激活',command=ac) 17 | _,_,_,funcs,_=u.add_scalebar((5,50),width=200,data=('1','2','3','4','5','6'),command=show) 18 | text=u.create_text((5,80),text='选择的值为:None',font='微软雅黑') 19 | 20 | a.go() 21 | -------------------------------------------------------------------------------- /test/swipecontrol.py: -------------------------------------------------------------------------------- 1 | from window import win,BasicTinUI 2 | 3 | 4 | def destroy(f): 5 | print(frames[f]) 6 | frames[f].destroy() 7 | 8 | 9 | a=win() 10 | u=a.u 11 | 12 | tb,_,_=u.add_textbox((5,5),450,400,scrollbar=True) 13 | 14 | frames=[] 15 | for i in range(0,15): 16 | cont=BasicTinUI(tb,width=404,height=54) 17 | item,_=cont.add_swipecontrol((1,1),text=f'swipe item {i}',data={'right':({'text':'close','fg':'#ffecec','bg':'#ff0000','command':(lambda it=i:destroy(it))},)}) 18 | tb.window_create('end',window=cont) 19 | item.bind('',lambda e,cont=cont:cont.destroy()) 20 | frames.append(item) 21 | 22 | a.go() 23 | -------------------------------------------------------------------------------- /test/table.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | a=win() 4 | u=a.u 5 | 6 | u.add_paragraph((5,5),text='''(210727)同学在本次 12月阶段考试 中,各科成绩已汇总。 7 | 根据本校各学科排名,对标行政班型等级,结果如下:''') 8 | u.add_table((5,50),data=[['学科','对标等级'], 9 | ['语文','平行'], 10 | ['数学','格致'], 11 | ['英语','平行'], 12 | ['物理','南山'], 13 | ['化学','平行'], 14 | ['政治','不建议选择该门学科'], 15 | ['历史','平行'], 16 | ['生物','南山'], 17 | ['地理','南山']]) 18 | u.add_paragraph((240,50),text='班主任:') 19 | u.add_link((300,50),'夏*','https:/?/') 20 | 21 | u.add_paragraph((240,90),text='(210727)') 22 | u.add_link((310,90),'学业评估','https:/?/') 23 | 24 | a.go() 25 | -------------------------------------------------------------------------------- /test/test.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | def dop(cont): 4 | print(f'输入框内容为:{cont}') 5 | 6 | a=win() 7 | u=a.u 8 | 9 | u.add_button((5,5),text='one') 10 | u.add_button((55,5),text='two1') 11 | u.add_button((55,40),text='two2') 12 | u.add_button((110,5),text='three') 13 | 14 | u.add_entry((5,180),350,'这里用来输入',command=dop) 15 | 16 | a.go() 17 | -------------------------------------------------------------------------------- /test/testpage/TinUIXml.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/testpage/back.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | p1 14 | b1 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/testpage/barbutton.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/button.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/button2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/canvas.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | canvas 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/checkbutton.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/combobox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/entry.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/testpage/expander.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /test/testpage/flyout.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/testpage/image.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /test/testpage/info.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/testpage/label.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /test/testpage/labelframe.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | b2 18 | 19 | 20 | 21 | -------------------------------------------------------------------------------- /test/testpage/link.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/testpage/listbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/listview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | controls 11 | 12 | displayui 13 | 14 | -------------------------------------------------------------------------------- /test/testpage/menubar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/menubutton.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/notebook.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | notebook 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/notecard.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/onoff.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/paragraph.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/testpage/passwordbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/testpage/picker.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/pipspager.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/pivot.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/progressbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/radiobox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/radiobutton.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/ratingbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/scalebar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/scrollbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/testpage/separate.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/spinbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/swipecontrol.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/table.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 |
16 |
-------------------------------------------------------------------------------- /test/testpage/textbox.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | -------------------------------------------------------------------------------- /test/testpage/title.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/testpage/togglebutton.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/tooltip.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/treeview.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/ui.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/testpage/waitbar.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /test/testpage/waitframe.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | waitframe 14 | 15 | 16 | -------------------------------------------------------------------------------- /test/tuxml.py: -------------------------------------------------------------------------------- 1 | from window import * 2 | from tkinter import Tk 3 | 4 | def get1(event): 5 | lb1=x.tags['lb1'][0] 6 | entry=x.tags['en'][0] 7 | print(lb1,entry.get()) 8 | u.itemconfig(lb1,text=entry.get()) 9 | 10 | xml=''' 11 | 12 | 13 | 14 | en 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | ''' 32 | 33 | a=Tk() 34 | 35 | 36 | 37 | u=TinUI(a) 38 | x=TinUIXml(u) 39 | x.environment(globals()) 40 | x.loadxml(xml) 41 | u.pack(fill='both',expand=True) 42 | a.mainloop() 43 | -------------------------------------------------------------------------------- /test/tuxmltest.py: -------------------------------------------------------------------------------- 1 | """ 2 | TinUIXml简易设计编辑器 3 | 4 | 注意!!!这只是测试文件,不保证随TinUI正式版本进行维护, 5 | 仅作为对TinUIXml和BasicTinUI设计模式 show_location() 的测试。 6 | 本代码文件本身不具备xml文本和python代码专用编辑能力。 7 | 8 | 本文件可作为开发TinUIXml编辑器或通过绝对坐标设计TinUI界面的参考, 9 | 不附带TinUI开发能力,不要单纯依靠本程序开发TinUI及python应用。 10 | """ 11 | from window import * 12 | from tkinter import Tk,Toplevel 13 | from tkinter.ttk import Button 14 | from tkinter.scrolledtext import ScrolledText 15 | from tkinter.simpledialog import askinteger 16 | import re 17 | import idlelib.colorizer as idc 18 | import idlelib.percolator as idp 19 | 20 | 21 | loclines=False#坐标十字线是否存在 22 | def if_location(e):#是否显示坐标十字线 23 | global loclines 24 | loclines=e 25 | if loclines: 26 | tinui.itemconfig(loctext,state='normal') 27 | displayui.show_location(command=getloc) 28 | else: 29 | tinui.itemconfig(loctext,text='x:? y:?',state='hidden') 30 | displayui.show_location(False) 31 | 32 | def getloc(x,y): 33 | tinui.itemconfig(loctext,text=f'x:{x} y:{y}') 34 | 35 | 36 | def inxml(e):#注入xml界面 37 | xml=text.get(1.0,'end') 38 | duixml.funcs=dict() 39 | duixml.datas=dict() 40 | duixml.tags=dict() 41 | result=re.findall("self\.(.*?)\[.(.*?).\]",xml,re.M|re.S) 42 | print(result) 43 | for i in result: 44 | if i[0]=='funcs': 45 | duixml.funcs[i[1]]=None 46 | elif i[0]=='datas': 47 | duixml.datas[i[1]]=(None,None) 48 | duixml.yendy=5 49 | duixml.clean() 50 | duixml.loadxml(xml) 51 | rescroll() 52 | reset_marks() 53 | 54 | def write(text): 55 | textbox.insert('end',text) 56 | def pycode(e):#获取IDO代码 57 | inxml(e) 58 | pycodew.deiconify() 59 | textbox.configure(state='normal') 60 | textbox.delete(1.0,'end') 61 | uixml=text.get(1.0,'end') 62 | result=re.findall(r"self\.(.*?)\[.(.*?).\]",uixml,re.M|re.S) 63 | textbox.result=result 64 | write('''# u = TinUI(root) 65 | # x = TinUIXml(u) 66 | # xml=file.read() 67 | 68 | ''') 69 | write('''# in 70 | ''') 71 | for i in result: 72 | if i[0]=='funcs': 73 | write(f'x.funcs["{i[1]}"] = {i[1]}\n') 74 | elif i[0]=='datas': 75 | write(f'x.datas["{i[1]}"] = {i[1]}\n') 76 | write(''' 77 | # during 78 | x.loadxml(xml) 79 | 80 | # out 81 | ''') 82 | for tag in duixml.tags.keys(): 83 | write(f'{tag} = x.tags["{tag}"]\n') 84 | textbox.configure(state='disabled') 85 | 86 | def copy_pycode(e):#复制 87 | textbox.clipboard_clear() 88 | copyText = textbox.get(1.0,'end') 89 | textbox.clipboard_append(copyText) 90 | def highlight(e):#标注funcs,datas等重点 91 | havefunc,havedata=False,False 92 | textbox.configure(state='normal') 93 | write('\n#TinUIXml导入重点:\n') 94 | for i in textbox.result: 95 | if i[0]=='funcs': 96 | if havefunc==False: 97 | havefunc=True 98 | write('#函数/方法(funcs):\n') 99 | write(f'# {i[1]}(...)\n') 100 | elif i[0]=='datas': 101 | if havedata==False: 102 | havedata=True 103 | write('#数据(datas):\n') 104 | write(f'# {i[1]}=...\n') 105 | havetag=False 106 | for tag in duixml.tags.keys(): 107 | if havetag==False: 108 | havetag=True 109 | write('\n#TinUIXml导出重点:\n') 110 | write(f'# {tag}\n') 111 | textbox.configure(state='disabled') 112 | 113 | now_mark=None#mark_index 114 | def open_markw(e): 115 | markw.deiconify() 116 | def del_mark(e):#删除选定标记点 117 | global now_mark 118 | if now_mark==None: 119 | return 120 | listbox.delete(now_mark) 121 | displayui.delete(mark_points[now_mark][1]) 122 | del mark_points[now_mark] 123 | now_mark=None 124 | def add_mark(e):#手动添加标记点 125 | x=askinteger('手动添加标记点','横坐标:',parent=markw) 126 | if x==None: 127 | return 128 | y=askinteger('手动添加标记点','纵坐标:',parent=markw) 129 | if y==None: 130 | return 131 | __set_mark(x,y) 132 | def sel_mark(name):#选定标记点 133 | global now_mark 134 | if name.index==0: 135 | now_mark=None 136 | else: 137 | if now_mark!=None: 138 | displayui.itemconfigure(mark_points[now_mark][1],outline='black',fill="black") 139 | now_mark=name.index 140 | displayui.itemconfigure(mark_points[now_mark][1],outline='red',fill='red') 141 | 142 | def __set_mark(x,y): 143 | mark=displayui.create_oval((x,y,x+3,y+3),outline='black',fill="black") 144 | mark_points.append(((x,y),mark)) 145 | listbox.add(f'({x} , {y})') 146 | def set_mark(e):#绘制标记点 147 | __set_mark(e.x,e.y) 148 | def reset_marks():#重新绘制标记点 149 | if len(mark_points)==0: 150 | return 151 | index=1 152 | for i in mark_points[1:]: 153 | mark=displayui.create_oval((i[0][0],i[0][1],i[0][0]+3,i[0][1]+3),outline='black',fill="black") 154 | mark_points[index]=(i[0],mark) 155 | index+=1 156 | 157 | 158 | root=Tk() 159 | 160 | 161 | root.geometry('1300x700+5+5') 162 | root.title('TinUIXml设计测试') 163 | root.resizable(False,False) 164 | 165 | initial_xml=''' 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | p1 179 | b1 180 | 181 | 182 | 183 | ''' 184 | textui=BasicTinUI(root) 185 | textui.place(x=0,y=0,width=400,height=700) 186 | text=textui.add_textbox((0,0),382,700,font='微软雅黑 13',scrollbar=True)[0] 187 | text.insert(1.0,initial_xml) 188 | tinui=BasicTinUI(root,bg='#f3f3f3') 189 | tinui.place(x=401,y=0,width=899,height=700) 190 | x=TinUIXml(tinui) 191 | x.environment(globals()) 192 | 193 | xmlf=open(os.path.dirname(__file__)+r'\xmltestpage\main.xml','r',encoding='utf-8') 194 | xml=xmlf.read() 195 | xmlf.close() 196 | 197 | x.loadxml(xml) 198 | displayui,rescroll,duixml,_=x.tags['xmlui'] 199 | loctext=x.tags['loctext'] 200 | tinui.itemconfig(loctext,state='hidden') 201 | tinui.bind('',lambda e:tinui.focus()) 202 | 203 | 204 | #Python代码弹窗窗口 205 | pycodew=Toplevel() 206 | pycodew.title("Python代码") 207 | # 设置窗口大小 208 | window_width = 520 209 | window_height = 550 210 | # 获取屏幕大小 211 | screen_width = pycodew.winfo_screenwidth() 212 | screen_height = pycodew.winfo_screenheight() 213 | # 计算窗口居中的x和y坐标 214 | x_coordinate = int((screen_width/2) - (window_width/2)) 215 | y_coordinate = int((screen_height/2) - (window_height/2)) 216 | # 设置窗口的位置和大小,并禁止改变尺寸 217 | pycodew.geometry("{}x{}+{}+{}".format(window_width, window_height, 218 | x_coordinate, y_coordinate)) 219 | pycodew.resizable(width=False, height=False) # 禁止改变窗口大小 220 | pctinui=BasicTinUI(pycodew) 221 | pctinui.pack(fill='both',expand=True) 222 | pycodew.protocol("WM_DELETE_WINDOW", lambda: pycodew.withdraw()) # 忽略关闭窗口的协议 223 | pycodew.withdraw() 224 | pctinuix=TinUIXml(pctinui) 225 | 226 | xmlf=open(os.path.dirname(__file__)+r'\xmltestpage\pytest.xml','r',encoding='utf-8') 227 | xml=xmlf.read() 228 | xmlf.close() 229 | pctinuix.environment(globals()) 230 | pctinuix.loadxml(xml) 231 | textbox=pctinuix.tags['textbox'][0] 232 | idc.color_config(textbox) 233 | p = idp.Percolator(textbox) 234 | d = idc.ColorDelegator() 235 | p.insertfilter(d) 236 | 237 | 238 | #========== 239 | #标记点管理页面 240 | markw = Toplevel(root) 241 | markw.title("标记点管理") 242 | markw.geometry("400x600") 243 | markw.resizable(width=False, height=False) # 禁止改变窗口大小 244 | markw.protocol("WM_DELETE_WINDOW", lambda: markw.withdraw()) # 忽略关闭窗口的协议 245 | markui=BasicTinUI(markw) 246 | markui.pack(fill='both',expand=True) 247 | markw.withdraw() 248 | markuix=TinUIXml(markui) 249 | 250 | xmlf=open(os.path.dirname(__file__)+r'\xmltestpage\marks.xml','r',encoding='utf-8') 251 | xml=xmlf.read() 252 | xmlf.close() 253 | markuix.environment(globals()) 254 | markuix.loadxml(xml) 255 | listbox=markuix.tags['listbox'][-2] 256 | mark_points=[((None,None),None)]#与listbox内列表同步更新,[((x,y), point_uid), ...] 257 | displayui.bind('',set_mark) 258 | 259 | if __name__=='__main__': 260 | root.mainloop() 261 | -------------------------------------------------------------------------------- /test/ui.py: -------------------------------------------------------------------------------- 1 | from window import win 2 | 3 | 4 | def f(e): 5 | print('go') 6 | 7 | a=win() 8 | xml = a.uixml 9 | xml.funcs['test']=print 10 | xml.loadxml( 11 | ''' 12 | 13 | 14 | 15 | 16 | ui 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | ''' 30 | ) 31 | xml.tags['ui'][-2].funcs['test']=f 32 | 33 | 34 | a.go() 35 | -------------------------------------------------------------------------------- /test/window.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append('..') 3 | from TinUI import * 4 | import extension 5 | from tkinter import Tk 6 | 7 | 8 | class TinUIWindow(Tk): 9 | 10 | def __init__(self,title='tinui-window',width=500,height=500,tran='#01ff11'): 11 | super().__init__() 12 | self.title=title 13 | self.tran=tran 14 | self.config(width=width,height=height,background=tran) 15 | self.attributes('-transparent',self.tran) 16 | self.__load_tinui() 17 | 18 | def __load_tinui(self): 19 | self.titlebar=BasicTinUI(self,height=40,bg=self.tran,relief='flat') 20 | self.titlebar.place(x=0,y=0,relwidth=1) 21 | width=self.cget('width') 22 | height=self.cget('height') 23 | self.titlebar.create_polygon((12,12,width-12,12,width-12,50,12,50,12,12), 24 | width=15,fill='#f1f3f9',outline='#f1f3f9') 25 | bbox=self.titlebar.bbox('all') 26 | self.titlebar.add_button((width-25,15),text='×',anchor='nw', 27 | bg='#f1f3f9',line='#f1f3f9',fg='black', 28 | activebg='#c42b1c',activeline='#c42b1c',) 29 | width=bbox[2]-bbox[0] 30 | self.main=BasicTinUI(self,bg='#f1f3f9') 31 | self.main.place(x=bbox[0]+2,y=40,width=width-3,height=height-46) 32 | self.xml=TinUIXml(self.main) 33 | 34 | 35 | class win: 36 | def __init__(self): 37 | self.r=Tk() 38 | self.r.geometry('500x500+10+10') 39 | self.u=TinUI(self.r)#,bg='#01FF11') 40 | self.u.pack(fill='both',expand=True) 41 | self.uixml=TinUIXml(self.u) 42 | def go(self): 43 | self.r.mainloop() 44 | 45 | 46 | if __name__=='__main__': 47 | #root=win() 48 | #root.go() 49 | r=TinUIWindow('test') 50 | r.mainloop() 51 | -------------------------------------------------------------------------------- /test/xmltestpage/main.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | loctext 7 | 8 | 9 | xmlui 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /test/xmltestpage/marks.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | listbox 10 | 11 | 12 | 13 | 14 | -------------------------------------------------------------------------------- /test/xmltestpage/pytest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | textbox 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /theme/gotheme.py: -------------------------------------------------------------------------------- 1 | # 由chat-glm4生成,作者小改。作为示例,不会维护 2 | from typing import Union 3 | import sys 4 | from tkinter import Tk, Toplevel 5 | sys.path.append('../') 6 | from TinUI import TinUI, BasicTinUI, TinUITheme, TinUIXml 7 | 8 | from tinuilight import TinUILight 9 | from tinuidark import TinUIDark 10 | from tinuimodernlight import TinUIModernLight 11 | from tinuimoderndark import TinUIModernDark 12 | from tinuidarkorange import TinUIDarkOrange 13 | from tinuidarkpurple import TinUIDarkPurple 14 | from tinuilightcyan import TinUILightCyan 15 | from tinuilightred import TinUILightRed 16 | 17 | 18 | def test(theme): 19 | def end(): 20 | bbox=u.bbox('all') 21 | if bbox==None: 22 | return (5,5) 23 | return (5,bbox[3]+10) 24 | 25 | r=Toplevel() 26 | r.geometry('500x500') 27 | u=TinUI(r) 28 | u.pack(fill='both',expand=True) 29 | 30 | du=theme(u) 31 | 32 | #button 33 | du.add_button(end(),text='TinUI theme') 34 | #checkbox 35 | du.add_checkbutton(end(),text='test checkbutton') 36 | #textblock 37 | du.add_label(end(),text='test label') 38 | #textbox 39 | du.add_entry(end(),text='test entry',width=200) 40 | #appbarseparator 41 | du.add_separate(end(),width=200) 42 | #splitview 43 | du.add_radiobutton(end(),250,'test radiobutton',('1','2','3','4','5')) 44 | #hyperlinkbutton 45 | du.add_link(end(),text='test link',url='smart-space.com.cn') 46 | #progressring 47 | du.add_waitbar1(end()) 48 | #infobar 49 | labelframey=end()[1]+30 50 | lb1=du.add_button((5,labelframey),text='labelframe button1')[1] 51 | lb2=du.add_button(end(),text='labelframe button2')[-1] 52 | lb3=du.add_button(end(),text='labelframe button3')[-1] 53 | du.add_labelframe((lb1,lb2,lb3),title='labelframe') 54 | #progressbar 55 | du.add_waitbar2(end()) 56 | #combobox 57 | du.add_combobox(end(),text='test combobox',content=('1','2','3','4','5')) 58 | #progressbar 59 | du.add_progressbar((end()[0],end()[1]+130))[3](75) 60 | #treeview 61 | du.add_table(end(), 62 | data=[['t1','t2','t3'],['tinui','table','test'],['1','2','3']]) 63 | #toggleswitch 64 | du.add_onoff(end()) 65 | #numberbutton 66 | du.add_spinbox(end(),data=('1','2','3','4','5')) 67 | #slider 68 | du.add_scalebar(end()) 69 | #teachingtip 70 | du.add_info(end(),info_text='info test') 71 | #menubar 72 | u.add_back(end()) 73 | l1=du.add_label(end(),text='menubar test label')[-1] 74 | du.add_menubar(l1, 75 | cont=(('test1',print),('test2',print),'-',('test3',print))) 76 | #tooltip 77 | l2=du.add_label(end(),text='tooltip test label')[-1] 78 | du.add_tooltip(l2,text='test tooltip') 79 | #progressbar 80 | du.add_waitbar3(end()) 81 | #richeditbox 82 | textx,texty=end() 83 | text=du.add_textbox((textx,texty),linew=2)[0] 84 | #richtextbox 85 | du.add_scrollbar((textx+205,texty),text) 86 | #listbox 87 | du.add_listbox(end(),data=('first','second','third', 88 | 'some thing between three and four called bleem','forth','fifth', 89 | 'some thins behind five\nwhich we can not find it\nfor-\never')) 90 | #inkcanvas 91 | canvas=du.add_canvas(end())[0] 92 | canvas.create_text((100,20),text='TinUI canvas',font='微软雅黑 12') 93 | canvas.create_line((20,50,180,50),fill='#f3f3f3',width=5) 94 | #pipspager 95 | du.add_pipspager(end(),num=5) 96 | #tabview 97 | ntb=du.add_notebook(end())[-2] 98 | for i in range(1,4): 99 | ntb.addpage('test'+str(i),'t'+str(i)) 100 | ntvdict=ntb.getvdict() 101 | num=1 102 | for i in ntvdict: 103 | ui=ntvdict[i][0] 104 | uxml=TinUIXml(theme(ui)) 105 | xml=f''' 106 | 107 | 108 | ''' 109 | uxml.loadxml(xml) 110 | num+=1 111 | #ratingcontrol 112 | du.add_ratingbar(end()) 113 | #radiobutton 114 | du.add_radiobox(end(),command=print) 115 | #expander 116 | du.add_notecard(end()) 117 | #pivot 118 | du.add_pivot(end()) 119 | #button 120 | du.add_button2(end(),'button2') 121 | #expander 122 | du.add_expander(end()) 123 | #animation interop 124 | wffunc=du.add_waitframe((end()[0],end()[1]+200))[3] 125 | wffunc.start() 126 | #listview 127 | du.add_listview(end(),num=10) 128 | #treeview 129 | du.add_treeview(end()) 130 | #togglebutton 131 | du.add_togglebutton(end(),text='状态开关按钮') 132 | #swipecontrol 133 | du.add_swipecontrol(end(),text='SwipeControl') 134 | #timepicker 135 | du.add_picker(end()) 136 | #dropdownbutton 137 | du.add_menubutton(end(),text='menubutton') 138 | #appbarbutton 139 | du.add_barbutton(end()) 140 | #flyout 141 | flylabel = du.add_label(end(),text='Flyout控件(左键单击)')[-1] 142 | du.add_flyout(flylabel,anchor='ne') 143 | 144 | w = Tk() 145 | w.geometry('500x500+500+100') 146 | 147 | ru = BasicTinUI(w) 148 | ru.pack(fill='both',expand=True) 149 | 150 | ru.add_button((5,5), text='TinUILight theme', command = lambda e : test(TinUILight)) 151 | ru.add_button((220,5), text='TinUIDark theme', command = lambda e : test(TinUIDark)) 152 | ru.add_button((5,55), text='TinUIModernLight theme', command = lambda e : test(TinUIModernLight)) 153 | ru.add_button((220,55), text='TinUIModernDark theme', command = lambda e : test(TinUIModernDark)) 154 | ru.add_button((5,105), text='TinUIDarkOrange theme', command = lambda e : test(TinUIDarkOrange)) 155 | ru.add_button((220,105), text='TinUIDarkPurple theme', command = lambda e : test(TinUIDarkPurple)) 156 | ru.add_button((5,155), text='TinUILightCyan theme', command = lambda e : test(TinUILightCyan)) 157 | ru.add_button((220,155), text='TinUILightRed theme', command = lambda e : test(TinUILightRed)) 158 | 159 | w.mainloop() 160 | -------------------------------------------------------------------------------- /theme/tinuidark.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | import sys 3 | try: 4 | from tinui import TinUI, BasicTinUI, TinUITheme 5 | except: 6 | sys.path.append('../') 7 | from TinUI import TinUI, BasicTinUI, TinUITheme 8 | 9 | class TinUIDark(TinUITheme): 10 | ''' 11 | 这是TinUI黑暗模式的托管类,不是继承类 12 | 调用时这需要注意文本和数据,样式类参数无需理会 13 | ''' 14 | 15 | def __init__(self,ui:Union[TinUI,BasicTinUI]): 16 | super().__init__(ui,'tinui-dark-theme') 17 | self.label='dark' 18 | self.ui['background']='#202020' 19 | 20 | def add_title(self,pos,*arg,**kw): 21 | return self.ui.add_title(pos,fg='#ffffff',*arg,**kw) 22 | 23 | def add_paragraph(self,pos,*arg,**kw): 24 | return self.ui.add_paragraph(pos,fg='#ffffff',*arg,**kw) 25 | 26 | def add_button(self,pos,*arg,**kw): 27 | return self.ui.add_button(pos,fg='#ffffff',bg='#2d2d2d', 28 | activefg='#e8e8e8',activebg='#323232', 29 | line='#303030',linew=1,activeline='#303030', 30 | *arg,**kw) 31 | 32 | def add_checkbutton(self,pos,*arg,**kw): 33 | return self.ui.add_checkbutton(pos, 34 | fontfg='#ffffff',fg='#999999',bg='#1d1d1d', 35 | activefg='#9c9c9c',activebg='#2a2a2a', 36 | onfg='#010101',onbg='#a3a8dc', 37 | *arg,**kw) 38 | 39 | def add_label(self,pos,*arg,**kw): 40 | return self.ui.add_label(pos,fg='#ffffff',bg='#202020', 41 | outline='#202020',*arg,**kw) 42 | 43 | def add_entry(self,pos,*arg,**kw): 44 | return self.ui.add_entry(pos,fg='#ffffff',bg='#2d2d2d', 45 | activefg='#ffffff',activebg='#323232', 46 | onfg='#ffffff',onbg='#1f1f1f', 47 | line='#303030',activeline='#303030', 48 | outline='#9a9a9a',onoutline='#b2b8f2',insert='#e0e0e0', 49 | *arg,**kw) 50 | 51 | def add_separate(self,pos,*arg,**kw): 52 | return self.ui.add_separate(pos,fg='#323232', 53 | *arg,**kw) 54 | 55 | def add_radiobutton(self,pos,*arg,**kw): 56 | return self.ui.add_radiobutton(pos, 57 | fg='#f2f2f2',bg='#2b2b2b', 58 | activefg='#ffffff',activebg='#373737', 59 | *arg,**kw) 60 | 61 | def add_link(self,pos,*arg,**kw): 62 | return self.ui.add_link(pos,fg='#d7d9f9', 63 | activefg='#d7d9f9',activebg='#2d2d2d', 64 | *arg,**kw) 65 | 66 | def add_waitbar1(self,pos,*arg,**kw): 67 | return self.ui.add_waitbar1(pos,fg='#b2b8f2', 68 | bg='#202020',okfg='#b2b8f2',bd=5, 69 | *arg,**kw) 70 | 71 | def add_labelframe(self,uids:tuple,*arg,**kw): 72 | return self.ui.add_labelframe(uids,fg='#ffffff',bg='#272727', 73 | *arg,**kw) 74 | 75 | def add_waitbar2(self,pos,*arg,**kw): 76 | return self.ui.add_waitbar2(pos, 77 | fg='#b2b8f2',bg='#202020',okcolor='#6ccb5f', 78 | *arg,**kw) 79 | 80 | def add_combobox(self,pos,*arg,**kw): 81 | return self.ui.add_combobox(pos, 82 | fg='#cfcfcf',bg='#2d2d2d',outline='#303030', 83 | activefg='#ffffff',activebg='#393939', 84 | scrollbg='#2c2c2c',scrollcolor='#9f9f9f',scrollon='#a0a0a0', 85 | *arg,**kw) 86 | 87 | def add_progressbar(self,pos,*arg,**kw): 88 | return self.ui.add_progressbar(pos, 89 | fg='#9a9a9a',bg='#b2b8f2',back='#202020', 90 | fontc='#0000ff',*arg,**kw) 91 | 92 | def add_table(self,pos,*arg,**kw): 93 | return self.ui.add_table(pos, 94 | outline='#9a9a9a',fg='#ffffff',bg='#2d2d2d', 95 | headbg='#202020',*arg,**kw) 96 | 97 | def add_onoff(self,pos,*arg,**kw): 98 | return self.ui.add_onoff(pos, 99 | fg='#cccccc',bg='#1d1d1d', 100 | onfg='#000000',onbg='#b2b8f2', 101 | *arg,**kw) 102 | 103 | def add_spinbox(self,pos,*arg,**kw): 104 | return self.ui.add_spinbox(pos, 105 | fg='#ffffff',bg='#2d2d2d',line='#303030', 106 | activefg='#c0c0c0',activebg='#323232', 107 | boxfg='#cfcfcf',boxbg='#2c2c2c', 108 | boxactivefg='#d2d2d2',boxactivebg='#383838', 109 | onfg='#9f9f9f',onbg='#343434', 110 | *arg,**kw) 111 | 112 | def add_image(self,pos,*arg,**kw): 113 | return self.ui.add_image(pos,*arg,**kw) 114 | 115 | def add_scalebar(self,pos,*arg,**kw): 116 | return self.ui.add_scalebar(pos, 117 | fg='#b2b8f2',bg='#9a9a9a',activefg='#b2b8f2', 118 | buttonbg='#454545',buttonoutline='#303030', 119 | *arg,**kw) 120 | 121 | def add_info(self,pos,*arg,**kw): 122 | return self.ui.add_info(pos, 123 | fg='#b2b8f2',bg='#2d2d2d',info_fg='#ffffff', 124 | *arg,**kw) 125 | 126 | def add_menubar(self,uid,*arg,**kw): 127 | return self.ui.add_menubar(uid, 128 | fg='#ffffff',bg='#2c2c2c',line='#b3b3b3', 129 | activefg='#ffffff',activebg='#383838',activeline='#383838',*arg,**kw) 130 | 131 | def add_tooltip(self,uid,*arg,**kw): 132 | return self.ui.add_tooltip(uid,fg='#e8e8e8',bg='#353535', 133 | *arg,**kw) 134 | 135 | def add_waitbar3(self,pos,*arg,**kw): 136 | return self.ui.add_waitbar3(pos, 137 | fg='#b2b8f2',bg='#202020',okcolor='#b2b8f2', 138 | *arg,**kw) 139 | 140 | def add_textbox(self,pos,*arg,**kw): 141 | return self.ui.add_textbox(pos,fg='#ffffff',bg='#2d2d2d', 142 | outline='#9a9a9a',onoutline='#b2b8f2', 143 | scrollbg='#2e2e2e',scrollcolor='#9f9f9f',scrollon='#a0a0a0', 144 | *arg,**kw) 145 | 146 | def add_scrollbar(self,pos,widget,*arg,**kw): 147 | return self.ui.add_scrollbar(pos,widget, 148 | bg='#2e2e2e',color='#9f9f9f', 149 | oncolor='#a0a0a0',*arg,**kw) 150 | 151 | def add_listbox(self,pos,*arg,**kw): 152 | return self.ui.add_listbox(pos, 153 | bg='#2b2b2b',fg='white',activebg='#b4bbea',sel='#465097', 154 | scrollbg='#2e2e2e',scrollcolor='#9f9f9f',scrollon='#a0a0a0', 155 | *arg,**kw) 156 | 157 | def add_canvas(self,pos,*arg,**kw): 158 | return self.ui.add_canvas(pos, 159 | outline='#808080',linew=1, 160 | scrollbg='#2e2e2e',scrollcolor='#9f9f9f',scrollon='#a0a0a0', 161 | *arg,**kw) 162 | 163 | def add_pipspager(self,pos,*arg,**kw): 164 | return self.ui.add_pipspager(pos, 165 | bg='#202020',fg='#9a9a9a', 166 | buttonfg='#9f9f9f',buttonbg='#2c2c2c', 167 | activefg='#cfcfcf',activebg='#2c2c2c', 168 | buttononfg='#cfcfcf',buttononbg='#2c2c2c', 169 | *arg,**kw) 170 | 171 | def add_notebook(self,pos,*arg,**kw): 172 | return self.ui.add_notebook(pos, 173 | color='#202020',fg='#cccccc',bg='#202020', 174 | activefg='#cfcfcf',activebg='#2d2d2d', 175 | onfg='#ffffff',onbg='#282828', 176 | scrollbg='#2e2e2e',scrollcolor='#9f9f9f',scrollon='#a0a0a0', 177 | *arg,**kw) 178 | 179 | def add_ratingbar(self,pos,*arg,**kw): 180 | return self.ui.add_ratingbar(pos, 181 | fg='#cccccc',bg='#202020', 182 | onfg='#b2b8f2',onbg='#b2b8f2', 183 | *arg,**kw) 184 | 185 | def add_radiobox(self,pos,*arg,**kw): 186 | return self.ui.add_radiobox(pos, 187 | fontfg='#ffffff',fg='#939393',bg='#2a2a2a', 188 | activefg='#959595',activebg='#2a2a2a', 189 | onfg='#a3a8dc',onbg='#000000', 190 | *arg,**kw) 191 | 192 | def add_notecard(self,pos,*arg,**kw): 193 | return self.ui.add_notecard(pos, 194 | tfg='#ffffff',tbg='#2b2b2b',fg='#ffffff', 195 | bg='#272727',sep='#1d1d1d', 196 | *arg,**kw) 197 | 198 | def add_pivot(self,pos,*arg,**kw): 199 | return self.ui.add_pivot(pos, 200 | fg='#a6a6a6',bg='', 201 | activefg='#ffffff',activecolor='#5969e0', 202 | *arg,**kw) 203 | 204 | def add_button2(self,pos,*arg,**kw): 205 | return self.ui.add_button2(pos,fg='#ffffff',bg='#2d2d2d', 206 | activefg='#ffffff',activebg='#323232', 207 | line='#303030',linew=1,activeline='#202020', 208 | onfg='#cecece',onbg='#272727',online='#303030', 209 | *arg,**kw) 210 | 211 | def add_expander(self,pos,*arg,**kw): 212 | return self.ui.add_expander(pos, 213 | tfg='#ffffff',tbg='#2b2b2b', 214 | bg='#272727',sep='#1d1d1d', 215 | buttonfg='#ffffff',buttonbg='#2b2b2b',buttonline='#2b2b2b', 216 | activefg='#ffffff',activebg='#373737',activeline='#373737', 217 | onfg='#ffffff',onbg='#333333',online='#333333', 218 | *arg,**kw) 219 | 220 | def add_waitframe(self,pos,*arg,**kw): 221 | return self.ui.add_waitframe(pos, 222 | fg='#2d2d2d',bg='#323232', 223 | *arg,**kw) 224 | 225 | def add_listview(self,pos,*arg,**kw): 226 | return self.ui.add_listview(pos, 227 | bg='#202020',activebg='#2d2d2d',oncolor='#b2b8f2', 228 | scrobg='#2e2e2e',scroc='#9a9a9a',scrooc='#9f9f9f', 229 | *arg,**kw) 230 | 231 | def add_treeview(self,pos,*arg,**kw): 232 | return self.ui.add_treeview(pos, 233 | fg='#ffffff',bg='#202020', 234 | onfg='#ffffff',onbg='#2d2d2d', 235 | oncolor='#b2b8f2',signcolor='#9f9f9f', 236 | *arg,**kw) 237 | 238 | def add_togglebutton(self,pos,*arg,**kw): 239 | return self.ui.add_togglebutton(pos, 240 | fg='#ffffff',bg='#2d2d2d',line='#303030', 241 | activefg='#000000',activebg='#b2b8f2',activeline='#b8bef3', 242 | *arg,**kw) 243 | 244 | def add_swipecontrol(self,pos,*arg,**kw): 245 | return self.ui.add_swipecontrol(pos, 246 | fg='#ffffff',bg='#202020',line='#2d2d2d', 247 | data={'left':({'text':'✔️\nok','fg':'#000000','bg':'#a9a9a9','command':print},), 248 | 'right':({'text':'❌\nclose'},)}, 249 | *arg,**kw) 250 | 251 | def add_picker(self,pos,*arg,**kw): 252 | return self.ui.add_picker(pos, 253 | fg='#cfcfcf',bg='#2d2d2d',outline='#3c3c3c', 254 | activefg='#ffffff',activebg='#323232', 255 | onfg='#000000',onbg='#a8ade4', 256 | buttonfg='#ffffff',buttonbg='#2d2d2d', 257 | buttonactivefg='#ffffff',buttonactivebg='#343434', 258 | *arg,**kw) 259 | 260 | def add_menubutton(self,pos,*arg,**kw): 261 | return self.ui.add_menubutton(pos, 262 | fg='#ffffff',bg='#2d2d2d',line='#303030', 263 | activefg='#ffffff',activebg='#323232',activeline='#202020', 264 | onfg='#cecece',onbg='#272727',online='#303030', 265 | menuonfg='#ffffff',menuonbg='#383838',menuonline='#383838', 266 | *arg,**kw) 267 | 268 | def add_barbutton(self,pos,*arg,**kw): 269 | return self.ui.add_barbutton(pos, 270 | fg='#ffffff',bg='#202020',line='#202020', 271 | activefg='#cecece',activebg='#2d2d2d',activeline='#2d2d2d', 272 | onfg='#cecece',onbg='#292929',online='#292929',sepcolor='#e5e5e5', 273 | *arg,**kw) 274 | 275 | def add_flyout(self,fid,*arg,**kw): 276 | return self.ui.add_flyout(fid, 277 | line='#b0b0b0',bg='#2c2c2c', 278 | *arg,**kw) 279 | 280 | def add_back(self,pos,*arg,**kw): 281 | return self.ui.add_back(pos, 282 | fg='#202020',bg='#202020', 283 | *arg,**kw) 284 | -------------------------------------------------------------------------------- /theme/tinuidarkorange.py: -------------------------------------------------------------------------------- 1 | # generate by qwen2.5-coder-32b-instruct 2 | import sys 3 | try: 4 | from tinui import TinUITheme 5 | except: 6 | sys.path.append('../') 7 | from TinUI import TinUITheme 8 | 9 | class TinUIDarkOrange(TinUITheme): 10 | def __init__(self,ui): 11 | super().__init__(ui,'tinui-dark-orange-theme') 12 | self.label='dark-orange' 13 | self.ui['background']='#202020' 14 | def add_button(self,pos,*arg,**kw): 15 | return self.ui.add_button(pos,fg='#ffffff',bg='#3d2c18',activefg='#e8e8e8',activebg='#4a341f',line='#303030',linew=1,activeline='#303030',*arg,**kw) 16 | def add_checkbutton(self,pos,*arg,**kw): 17 | return self.ui.add_checkbutton(pos,fontfg='#ffffff',fg='#999999',bg='#251c10',activefg='#9c9c9c',activebg='#322617',onfg='#010101',onbg='#e09f4f',*arg,**kw) 18 | def add_label(self,pos,*arg,**kw): 19 | return self.ui.add_label(pos,fg='#ffffff',bg='#202020',outline='#202020',*arg,**kw) 20 | def add_entry(self,pos,*arg,**kw): 21 | return self.ui.add_entry(pos,fg='#cfcfcf',bg='#3d2c18',activefg='#e6e6e6',activebg='#2f2110',line='#303030',activeline='#303030',outline='#9a9a9a',onoutline='#e09f4f',insert='#e0e0e0',*arg,**kw) 22 | def add_separate(self,pos,*arg,**kw): 23 | return self.ui.add_separate(pos,fg='#323232',*arg,**kw) 24 | def add_radiobutton(self,pos,*arg,**kw): 25 | return self.ui.add_radiobutton(pos,fg='#f2f2f2',bg='#2b2317',activefg='#ffffff',activebg='#372d1f',*arg,**kw) 26 | def add_link(self,pos,*arg,**kw): 27 | return self.ui.add_link(pos,fg='#e09f4f',activefg='#e09f4f',activebg='#3d2c18',*arg,**kw) 28 | def add_waitbar1(self,pos,*arg,**kw): 29 | return self.ui.add_waitbar1(pos,fg='#e09f4f',bg='#202020',okfg='#e09f4f',bd=5,*arg,**kw) 30 | def add_labelframe(self,uids,*arg,**kw): 31 | return self.ui.add_labelframe(uids,fg='#ffffff',bg='#272017',*arg,**kw) 32 | def add_waitbar2(self,pos,*arg,**kw): 33 | return self.ui.add_waitbar2(pos,fg='#e09f4f',bg='#202020',okcolor='#6c551f',*arg,**kw) 34 | def add_combobox(self,pos,*arg,**kw): 35 | return self.ui.add_combobox(pos,fg='#cfcfcf',bg='#3d2c18',outline='#303030',activefg='#ffffff',activebg='#4a341f',scrollbg='#2c2c2c',scrollcolor='#9f9f9f',scrollon='#e09f4f',*arg,**kw) 36 | def add_progressbar(self,pos,*arg,**kw): 37 | return self.ui.add_progressbar(pos,fg='#9a9a9a',bg='#e09f4f',back='#202020',fontc='#ffffff',*arg,**kw) 38 | def add_table(self,pos,*arg,**kw): 39 | return self.ui.add_table(pos,outline='#9a9a9a',fg='#ffffff',bg='#3d2c18',headbg='#202020',*arg,**kw) 40 | def add_onoff(self,pos,*arg,**kw): 41 | return self.ui.add_onoff(pos,fg='#cccccc',bg='#251c10',onfg='#000000',onbg='#e09f4f',*arg,**kw) 42 | def add_spinbox(self,pos,*arg,**kw): 43 | return self.ui.add_spinbox(pos,fg='#ffffff',bg='#3d2c18',line='#303030',activefg='#c0c0c0',activebg='#4a341f',boxfg='#cfcfcf',boxbg='#2f2110',boxactivefg='#d2d2d2',boxactivebg='#382a1b',onfg='#9f9f9f',onbg='#342b1f',*arg,**kw) 44 | def add_scalebar(self,pos,*arg,**kw): 45 | return self.ui.add_scalebar(pos,fg='#e09f4f',bg='#9a9a9a',activefg='#e09f4f',buttonbg='#454545',buttonoutline='#303030',*arg,**kw) 46 | def add_info(self,pos,*arg,**kw): 47 | return self.ui.add_info(pos,fg='#e09f4f',bg='#3d2c18',info_fg='#ffffff',*arg,**kw) 48 | def add_menubar(self,uid,*arg,**kw): 49 | return self.ui.add_menubar(uid,fg='#ffffff',bg='#2c2c2c',line='#b3b3b3',activefg='#ffffff',activebg='#383838',activeline='#383838',*arg,**kw) 50 | def add_tooltip(self,uid,*arg,**kw): 51 | return self.ui.add_tooltip(uid,fg='#e8e8e8',bg='#353535',*arg,**kw) 52 | def add_waitbar3(self,pos,*arg,**kw): 53 | return self.ui.add_waitbar3(pos,fg='#e09f4f',bg='#202020',okcolor='#e09f4f',*arg,**kw) 54 | def add_textbox(self,pos,*arg,**kw): 55 | return self.ui.add_textbox(pos,fg='#ffffff',bg='#3d2c18',outline='#9a9a9a',onoutline='#e09f4f',scrollbg='#2e2e2e',scrollcolor='#9f9f9f',scrollon='#e09f4f',*arg,**kw) 56 | def add_scrollbar(self,pos,widget,*arg,**kw): 57 | return self.ui.add_scrollbar(pos,widget,bg='#2e2e2e',color='#9f9f9f',oncolor='#e09f4f',*arg,**kw) 58 | def add_listbox(self,pos,*arg,**kw): 59 | return self.ui.add_listbox(pos,bg='#2b2317',fg='white',activebg='#e09f4f',sel='#465097',scrollbg='#2e2e2e',scrollcolor='#9f9f9f',scrollon='#e09f4f',*arg,**kw) 60 | def add_canvas(self,pos,*arg,**kw): 61 | return self.ui.add_canvas(pos,outline='#808080',linew=1,scrollbg='#2e2e2e',scrollcolor='#9f9f9f',scrollon='#e09f4f',*arg,**kw) 62 | def add_pipspager(self,pos,*arg,**kw): 63 | return self.ui.add_pipspager(pos,bg='#202020',fg='#9a9a9a',buttonfg='#9f9f9f',buttonbg='#2c2c2c',activefg='#cfcfcf',activebg='#2c2c2c',buttononfg='#cfcfcf',buttononbg='#2c2c2c',*arg,**kw) 64 | def add_notebook(self,pos,*arg,**kw): 65 | return self.ui.add_notebook(pos,color='#202020',fg='#cccccc',bg='#202020',activefg='#cfcfcf',activebg='#3d2c18',onfg='#ffffff',onbg='#282828',scrollbg='#2e2e2e',scrollcolor='#9f9f9f',scrollon='#e09f4f',*arg,**kw) 66 | def add_ratingbar(self,pos,*arg,**kw): 67 | return self.ui.add_ratingbar(pos,fg='#cccccc',bg='#202020',onfg='#e09f4f',onbg='#e09f4f',*arg,**kw) 68 | def add_radiobox(self,pos,*arg,**kw): 69 | return self.ui.add_radiobox(pos,fontfg='#ffffff',fg='#939393',bg='#2a2a2a',activefg='#959595',activebg='#2a2a2a',onfg='#e09f4f',onbg='#000000',*arg,**kw) 70 | def add_notecard(self,pos,*arg,**kw): 71 | return self.ui.add_notecard(pos,tfg='#ffffff',tbg='#2b2b2b',fg='#ffffff',bg='#272727',sep='#1d1d1d',*arg,**kw) 72 | def add_pivot(self,pos,*arg,**kw): 73 | return self.ui.add_pivot(pos,fg='#a6a6a6',bg='',activefg='#ffffff',activecolor='#e09f4f',*arg,**kw) 74 | def add_button2(self,pos,*arg,**kw): 75 | return self.ui.add_button2(pos,fg='#ffffff',bg='#3d2c18',activefg='#ffffff',activebg='#4a341f',line='#303030',linew=1,activeline='#202020',onfg='#cecece',onbg='#272727',online='#303030',*arg,**kw) 76 | def add_expander(self,pos,*arg,**kw): 77 | return self.ui.add_expander(pos,tfg='#ffffff',tbg='#2b2b2b',bg='#272727',sep='#1d1d1d',buttonfg='#ffffff',buttonbg='#2b2b2b',buttonline='#2b2b2b',activefg='#ffffff',activebg='#373737',activeline='#373737',onfg='#ffffff',onbg='#333333',online='#333333',*arg,**kw) 78 | def add_waitframe(self,pos,*arg,**kw): 79 | return self.ui.add_waitframe(pos,fg='#2d2d2d',bg='#323232',*arg,**kw) 80 | def add_listview(self,pos,*arg,**kw): 81 | return self.ui.add_listview(pos,bg='#202020',activebg='#3d2c18',oncolor='#e09f4f',scrobg='#2e2e2e',scroc='#9a9a9a',scrooc='#e09f4f',*arg,**kw) 82 | def add_treeview(self,pos,*arg,**kw): 83 | return self.ui.add_treeview(pos,fg='#ffffff',bg='#202020',onfg='#ffffff',onbg='#3d2c18',oncolor='#e09f4f',signcolor='#9f9f9f',*arg,**kw) 84 | def add_togglebutton(self,pos,*arg,**kw): 85 | return self.ui.add_togglebutton(pos,fg='#ffffff',bg='#3d2c18',line='#303030',activefg='#000000',activebg='#e09f4f',activeline='#e09f4f',*arg,**kw) 86 | def add_swipecontrol(self,pos,*arg,**kw): 87 | return self.ui.add_swipecontrol(pos,fg='#ffffff',bg='#202020',line='#2d2d2d',data={'left':({'text':'✔️\nok','fg':'#000000','bg':'#a9a9a9','command':print},),'right':({'text':'❌\nclose'},)},*arg,**kw) 88 | def add_picker(self,pos,*arg,**kw): 89 | return self.ui.add_picker(pos,fg='#cfcfcf',bg='#3d2c18',outline='#3c3c3c',activefg='#ffffff',activebg='#4a341f',onfg='#000000',onbg='#e09f4f',buttonfg='#ffffff',buttonbg='#3d2c18',buttonactivefg='#ffffff',buttonactivebg='#4a341f',*arg,**kw) 90 | def add_menubutton(self,pos,*arg,**kw): 91 | return self.ui.add_menubutton(pos,fg='#ffffff',bg='#3d2c18',line='#303030',activefg='#ffffff',activebg='#4a341f',activeline='#202020',onfg='#cecece',onbg='#272727',online='#303030',menuonfg='#ffffff',menuonbg='#383838',menuonline='#383838',*arg,**kw) 92 | def add_barbutton(self,pos,*arg,**kw): 93 | return self.ui.add_barbutton(pos,fg='#ffffff',bg='#202020',line='#202020',activefg='#cecece',activebg='#3d2c18',activeline='#3d2c18',onfg='#cecece',onbg='#292929',online='#292929',sepcolor='#e5e5e5',*arg,**kw) 94 | def add_flyout(self,fid,*arg,**kw): 95 | return self.ui.add_flyout(fid,line='#b0b0b0',bg='#2c2c2c',*arg,**kw) 96 | -------------------------------------------------------------------------------- /theme/tinuidarkpurple.py: -------------------------------------------------------------------------------- 1 | # generate by qwen2.5-coder-32b-instruct 2 | import sys 3 | try: 4 | from tinui import TinUITheme 5 | except: 6 | sys.path.append('../') 7 | from TinUI import TinUITheme 8 | 9 | class TinUIDarkPurple(TinUITheme): 10 | def __init__(self,ui): 11 | super().__init__(ui,'tinui-dark-purple-theme') 12 | self.label='dark-purple' 13 | self.ui['background']='#202020' 14 | def add_button(self,pos,*arg,**kw): 15 | return self.ui.add_button(pos,fg='#ffffff',bg='#3d2c48',activefg='#e8e8e8',activebg='#4a345f',line='#303030',linew=1,activeline='#303030',*arg,**kw) 16 | def add_checkbutton(self,pos,*arg,**kw): 17 | return self.ui.add_checkbutton(pos,fontfg='#ffffff',fg='#999999',bg='#251c2e',activefg='#9c9c9c',activebg='#32263f',onfg='#010101',onbg='#b28fff',*arg,**kw) 18 | def add_label(self,pos,*arg,**kw): 19 | return self.ui.add_label(pos,fg='#ffffff',bg='#202020',outline='#202020',*arg,**kw) 20 | def add_entry(self,pos,*arg,**kw): 21 | return self.ui.add_entry(pos,fg='#cfcfcf',bg='#3d2c48',activefg='#e6e6e6',activebg='#2f2138',line='#303030',activeline='#303030',outline='#9a9a9a',onoutline='#b28fff',insert='#e0e0e0',*arg,**kw) 22 | def add_separate(self,pos,*arg,**kw): 23 | return self.ui.add_separate(pos,fg='#323232',*arg,**kw) 24 | def add_radiobutton(self,pos,*arg,**kw): 25 | return self.ui.add_radiobutton(pos,fg='#f2f2f2',bg='#2b2337',activefg='#ffffff',activebg='#372d46',*arg,**kw) 26 | def add_link(self,pos,*arg,**kw): 27 | return self.ui.add_link(pos,fg='#b28fff',activefg='#b28fff',activebg='#3d2c48',*arg,**kw) 28 | def add_waitbar1(self,pos,*arg,**kw): 29 | return self.ui.add_waitbar1(pos,fg='#b28fff',bg='#202020',okfg='#b28fff',bd=5,*arg,**kw) 30 | def add_labelframe(self,uids,*arg,**kw): 31 | return self.ui.add_labelframe(uids,fg='#ffffff',bg='#27202e',*arg,**kw) 32 | def add_waitbar2(self,pos,*arg,**kw): 33 | return self.ui.add_waitbar2(pos,fg='#b28fff',bg='#202020',okcolor='#6c3cd9',*arg,**kw) 34 | def add_combobox(self,pos,*arg,**kw): 35 | return self.ui.add_combobox(pos,fg='#cfcfcf',bg='#3d2c48',outline='#303030',activefg='#ffffff',activebg='#4a345f',scrollbg='#2c2c30',scrollcolor='#9f9f9f',scrollon='#b28fff',*arg,**kw) 36 | def add_progressbar(self,pos,*arg,**kw): 37 | return self.ui.add_progressbar(pos,fg='#9a9a9a',bg='#b28fff',back='#202020',fontc='#6c3cd9',*arg,**kw) 38 | def add_table(self,pos,*arg,**kw): 39 | return self.ui.add_table(pos,outline='#9a9a9a',fg='#ffffff',bg='#3d2c48',headbg='#202020',*arg,**kw) 40 | def add_onoff(self,pos,*arg,**kw): 41 | return self.ui.add_onoff(pos,fg='#cccccc',bg='#251c2e',onfg='#000000',onbg='#b28fff',*arg,**kw) 42 | def add_spinbox(self,pos,*arg,**kw): 43 | return self.ui.add_spinbox(pos,fg='#ffffff',bg='#3d2c48',line='#303030',activefg='#c0c0c0',activebg='#4a345f',boxfg='#cfcfcf',boxbg='#2f2138',boxactivefg='#d2d2d2',boxactivebg='#382a46',onfg='#9f9f9f',onbg='#342b3f',*arg,**kw) 44 | def add_scalebar(self,pos,*arg,**kw): 45 | return self.ui.add_scalebar(pos,fg='#b28fff',bg='#9a9a9a',activefg='#b28fff',buttonbg='#454545',buttonoutline='#303030',*arg,**kw) 46 | def add_info(self,pos,*arg,**kw): 47 | return self.ui.add_info(pos,fg='#b28fff',bg='#3d2c48',info_fg='#ffffff',*arg,**kw) 48 | def add_menubar(self,uid,*arg,**kw): 49 | return self.ui.add_menubar(uid,fg='#ffffff',bg='#2c2c30',line='#b3b3b3',activefg='#ffffff',activebg='#383838',activeline='#383838',*arg,**kw) 50 | def add_tooltip(self,uid,*arg,**kw): 51 | return self.ui.add_tooltip(uid,fg='#e8e8e8',bg='#353535',*arg,**kw) 52 | def add_waitbar3(self,pos,*arg,**kw): 53 | return self.ui.add_waitbar3(pos,fg='#b28fff',bg='#202020',okcolor='#b28fff',*arg,**kw) 54 | def add_textbox(self,pos,*arg,**kw): 55 | return self.ui.add_textbox(pos,fg='#ffffff',bg='#3d2c48',outline='#9a9a9a',onoutline='#b28fff',scrollbg='#2e2e30',scrollcolor='#9f9f9f',scrollon='#b28fff',*arg,**kw) 56 | def add_scrollbar(self,pos,widget,*arg,**kw): 57 | return self.ui.add_scrollbar(pos,widget,bg='#2e2e30',color='#9f9f9f',oncolor='#b28fff',*arg,**kw) 58 | def add_listbox(self,pos,*arg,**kw): 59 | return self.ui.add_listbox(pos,bg='#2b2337',fg='white',activebg='#b4bbea',sel='#465097',scrollbg='#2e2e30',scrollcolor='#9f9f9f',scrollon='#b28fff',*arg,**kw) 60 | def add_canvas(self,pos,*arg,**kw): 61 | return self.ui.add_canvas(pos,outline='#808080',linew=1,scrollbg='#2e2e30',scrollcolor='#9f9f9f',scrollon='#b28fff',*arg,**kw) 62 | def add_pipspager(self,pos,*arg,**kw): 63 | return self.ui.add_pipspager(pos,bg='#202020',fg='#9a9a9a',buttonfg='#9f9f9f',buttonbg='#2c2c30',activefg='#cfcfcf',activebg='#2c2c30',buttononfg='#cfcfcf',buttononbg='#2c2c30',*arg,**kw) 64 | def add_notebook(self,pos,*arg,**kw): 65 | return self.ui.add_notebook(pos,color='#202020',fg='#cccccc',bg='#202020',activefg='#cfcfcf',activebg='#3d2c48',onfg='#ffffff',onbg='#282828',scrollbg='#2e2e30',scrollcolor='#9f9f9f',scrollon='#b28fff',*arg,**kw) 66 | def add_ratingbar(self,pos,*arg,**kw): 67 | return self.ui.add_ratingbar(pos,fg='#cccccc',bg='#202020',onfg='#b28fff',onbg='#b28fff',*arg,**kw) 68 | def add_radiobox(self,pos,*arg,**kw): 69 | return self.ui.add_radiobox(pos,fontfg='#ffffff',fg='#939393',bg='#2a2a30',activefg='#959595',activebg='#2a2a30',onfg='#b28fff',onbg='#000000',*arg,**kw) 70 | def add_notecard(self,pos,*arg,**kw): 71 | return self.ui.add_notecard(pos,tfg='#ffffff',tbg='#2b202e',fg='#ffffff',bg='#27202e',sep='#1d1d1d',*arg,**kw) 72 | def add_pivot(self,pos,*arg,**kw): 73 | return self.ui.add_pivot(pos,fg='#a6a6a6',bg='',activefg='#ffffff',activecolor='#b28fff',*arg,**kw) 74 | def add_button2(self,pos,*arg,**kw): 75 | return self.ui.add_button2(pos,fg='#ffffff',bg='#3d2c48',activefg='#ffffff',activebg='#4a345f',line='#303030',linew=1,activeline='#202020',onfg='#cecece',onbg='#272727',online='#303030',*arg,**kw) 76 | def add_expander(self,pos,*arg,**kw): 77 | return self.ui.add_expander(pos,tfg='#ffffff',tbg='#2b202e',bg='#27202e',sep='#1d1d1d',buttonfg='#ffffff',buttonbg='#2b202e',buttonline='#2b202e',activefg='#ffffff',activebg='#372d3f',activeline='#372d3f',onfg='#ffffff',onbg='#333333',online='#333333',*arg,**kw) 78 | def add_waitframe(self,pos,*arg,**kw): 79 | return self.ui.add_waitframe(pos,fg='#2d2d2d',bg='#323232',*arg,**kw) 80 | def add_listview(self,pos,*arg,**kw): 81 | return self.ui.add_listview(pos,bg='#202020',activebg='#3d2c48',oncolor='#b28fff',scrobg='#2e2e30',scroc='#9a9a9a',scrooc='#b28fff',*arg,**kw) 82 | def add_treeview(self,pos,*arg,**kw): 83 | return self.ui.add_treeview(pos,fg='#ffffff',bg='#202020',onfg='#ffffff',onbg='#3d2c48',oncolor='#b28fff',signcolor='#9f9f9f',*arg,**kw) 84 | def add_togglebutton(self,pos,*arg,**kw): 85 | return self.ui.add_togglebutton(pos,fg='#ffffff',bg='#3d2c48',line='#303030',activefg='#000000',activebg='#b28fff',activeline='#b28fff',*arg,**kw) 86 | def add_swipecontrol(self,pos,*arg,**kw): 87 | return self.ui.add_swipecontrol(pos,fg='#ffffff',bg='#202020',line='#2d2d2d',data={'left':({'text':'✔️\nok','fg':'#000000','bg':'#a9a9a9','command':print},),'right':({'text':'❌\nclose'},)},*arg,**kw) 88 | def add_picker(self,pos,*arg,**kw): 89 | return self.ui.add_picker(pos,fg='#cfcfcf',bg='#3d2c48',outline='#3c3c30',activefg='#ffffff',activebg='#4a345f',onfg='#000000',onbg='#b28fff',buttonfg='#ffffff',buttonbg='#3d2c48',buttonactivefg='#ffffff',buttonactivebg='#4a345f',*arg,**kw) 90 | def add_menubutton(self,pos,*arg,**kw): 91 | return self.ui.add_menubutton(pos,fg='#ffffff',bg='#3d2c48',line='#303030',activefg='#ffffff',activebg='#4a345f',activeline='#202020',onfg='#cecece',onbg='#272727',online='#303030',menuonfg='#ffffff',menuonbg='#383838',menuonline='#383838',*arg,**kw) 92 | def add_barbutton(self,pos,*arg,**kw): 93 | return self.ui.add_barbutton(pos,fg='#ffffff',bg='#202020',line='#202020',activefg='#cecece',activebg='#3d2c48',activeline='#3d2c48',onfg='#cecece',onbg='#292929',online='#292929',sepcolor='#e5e5e5',*arg,**kw) 94 | def add_flyout(self,fid,*arg,**kw): 95 | return self.ui.add_flyout(fid,line='#b0b0b0',bg='#2c2c30',*arg,**kw) 96 | -------------------------------------------------------------------------------- /theme/tinuilight.py: -------------------------------------------------------------------------------- 1 | from typing import Union 2 | import sys 3 | try: 4 | from tinui import TinUI, BasicTinUI, TinUITheme 5 | except: 6 | sys.path.append('../') 7 | from TinUI import TinUI, BasicTinUI, TinUITheme 8 | 9 | class TinUILight(TinUITheme): 10 | ''' 11 | 这是TinUI明亮模式的托管类,不是继承类 12 | 调用时这需要注意文本和数据,样式类参数无需理会 13 | ''' 14 | 15 | def __init__(self,ui:Union[TinUI,BasicTinUI]): 16 | super().__init__(ui,'tinui-light-theme') 17 | self.label='light' 18 | self.ui['background']='#f3f3f3' 19 | 20 | def add_title(self,pos,*arg,**kw): 21 | return self.ui.add_title(pos,fg='#000000',*arg,**kw) 22 | 23 | def add_paragraph(self,pos,*arg,**kw): 24 | return self.ui.add_paragraph(pos,fg='#000000',*arg,**kw) 25 | 26 | def add_button(self,pos,*arg,**kw): 27 | return self.ui.add_button(pos,fg='#1b1b1b',bg='#fbfbfb', 28 | activefg='#1a1a1a',activebg='#f6f6f6', 29 | line='#cccccc',linew=1,activeline='#cccccc', 30 | *arg,**kw) 31 | 32 | def add_checkbutton(self,pos,*arg,**kw): 33 | return self.ui.add_checkbutton(pos, 34 | fontfg='#1a1a1a',fg='#868686',bg='#ededed', 35 | activefg='#868686',activebg='#e5e5e5', 36 | onfg='white',onbg='#334ac0', 37 | *arg,**kw) 38 | 39 | def add_label(self,pos,*arg,**kw): 40 | return self.ui.add_label(pos,fg='#1a1a1a',bg='#f3f3f3', 41 | outline='#f3f3f3',*arg,**kw) 42 | 43 | def add_entry(self,pos,*arg,**kw): 44 | return self.ui.add_entry(pos,fg='#1b1b1b',bg='#fbfbfb', 45 | activefg='#1a1a1a',activebg='#f6f6f6', 46 | onfg='#000000',onbg='#ffffff', 47 | line='#e5e5e5',activeline='#e5e5e5', 48 | outline='#868686',onoutline='#3041d8',insert='#000000', 49 | *arg,**kw) 50 | 51 | def add_separate(self,pos,*arg,**kw): 52 | return self.ui.add_separate(pos,fg='#e5e5e5', 53 | *arg,**kw) 54 | 55 | def add_radiobutton(self,pos,*arg,**kw): 56 | return self.ui.add_radiobutton(pos, 57 | fg='#1a1a1a',bg='#f2f2f2', 58 | activefg='#191919',activebg='#e9e9e9', 59 | *arg,**kw) 60 | 61 | def add_link(self,pos,*arg,**kw): 62 | return self.ui.add_link(pos,fg='#4f62ca', 63 | activefg='red',activebg='#eaeaea', 64 | *arg,**kw) 65 | 66 | def add_waitbar1(self,pos,*arg,**kw): 67 | return self.ui.add_waitbar1(pos,fg='#3041d8', 68 | bg='#f3f3f3',okfg='#3041d8',bd=5, 69 | *arg,**kw) 70 | 71 | def add_labelframe(self,uids:tuple,*arg,**kw): 72 | return self.ui.add_labelframe(uids,fg='#1a1a1a',bg='#f4f4f4', 73 | *arg,**kw) 74 | 75 | def add_waitbar2(self,pos,*arg,**kw): 76 | return self.ui.add_waitbar2(pos, 77 | fg='#3041d8',bg='#f3f3f3',okcolor='#0f7b0f', 78 | *arg,**kw) 79 | 80 | def add_combobox(self,pos,*arg,**kw): 81 | return self.ui.add_combobox(pos, 82 | fg='#1a1a1a',bg='#fbfbfb',outline='#c8c8c8', 83 | activefg='#1a1a1a',activebg='#ededee', 84 | scrollbg='#f9f9f9',scrollcolor='#999999',scrollon='#89898b', 85 | *arg,**kw) 86 | 87 | def add_progressbar(self,pos,*arg,**kw): 88 | return self.ui.add_progressbar(pos, 89 | fg='#868686',bg='#334ac0',back='#f3f3f3', 90 | fontc='#79b8f8',*arg,**kw) 91 | 92 | def add_table(self,pos,*arg,**kw): 93 | return self.ui.add_table(pos, 94 | outline='#dadad8',fg='black',bg='white', 95 | headbg='#f4f4f2',*arg,**kw) 96 | 97 | def add_onoff(self,pos,*arg,**kw): 98 | return self.ui.add_onoff(pos, 99 | fg='#5a5a5a',bg='#ededed', 100 | onfg='#ffffff',onbg='#4453db', 101 | *arg,**kw) 102 | 103 | def add_spinbox(self,pos,*arg,**kw): 104 | return self.ui.add_spinbox(pos, 105 | fg='#1b1b1b',bg='#fefefe',line='#e5e5e5', 106 | activefg='#1a1a1a',activebg='#fafafa', 107 | onfg='#868686',onbg='#f3f3f3', 108 | boxfg='#5f5f5f',boxbg='#f9f9f9', 109 | boxactivefg='#5b5b5b',boxactivebg='#f0f0f0', 110 | *arg,**kw) 111 | 112 | def add_image(self,pos,*arg,**kw): 113 | return self.ui.add_image(pos,*arg,**kw) 114 | 115 | def add_scalebar(self,pos,*arg,**kw): 116 | return self.ui.add_scalebar(pos, 117 | fg='#3b50ba',bg='#868686',activefg='#3b50ba', 118 | buttonbg='#ffffff',buttonoutline='#cccccc', 119 | *arg,**kw) 120 | 121 | def add_info(self,pos,*arg,**kw): 122 | return self.ui.add_info(pos, 123 | fg='#0078d4',bg='#f9f9f9',info_fg='#1a1a1a', 124 | *arg,**kw) 125 | 126 | def add_menubar(self,uid,*arg,**kw): 127 | return self.ui.add_menubar(uid, 128 | fg='#1a1a1a',bg='#f9f9f9',line='#dfdfdf', 129 | activefg='#191919',activebg='#f0f0f0',activeline='#f0f0f0',*arg,**kw) 130 | 131 | def add_tooltip(self,uid,*arg,**kw): 132 | return self.ui.add_tooltip(uid,fg='#1a1a1a',bg='#efefef', 133 | *arg,**kw) 134 | 135 | def add_waitbar3(self,pos,*arg,**kw): 136 | return self.ui.add_waitbar3(pos, 137 | fg='#3041d8',bg='#f3f3f3',okcolor='#3041d8', 138 | *arg,**kw) 139 | 140 | def add_textbox(self,pos,*arg,**kw): 141 | return self.ui.add_textbox(pos,fg='#1a1a1a',bg='white', 142 | outline='#868686',onoutline='#3041d8', 143 | scrollbg='#f9f9f9',scrollcolor='#8d8d8d',scrollon='#8a8a8a', 144 | *arg,**kw) 145 | 146 | def add_scrollbar(self,pos,widget,*arg,**kw): 147 | return self.ui.add_scrollbar(pos,widget, 148 | bg='#f9f9f9',color='#8d8d8d', 149 | oncolor='#8a8a8a',*arg,**kw) 150 | 151 | def add_listbox(self,pos,*arg,**kw): 152 | return self.ui.add_listbox(pos, 153 | bg='#f2f2f2',fg='black',activebg='#e9e9e9',sel='#b4bbea', 154 | scrollbg='#f9f9f9',scrollcolor='#8d8d8d',scrollon='#8a8a8a', 155 | *arg,**kw) 156 | 157 | def add_canvas(self,pos,*arg,**kw): 158 | return self.ui.add_canvas(pos, 159 | outline='#808080',linew=1, 160 | scrollbg='#f9f9f9',scrollcolor='#8d8d8d',scrollon='#8a8a8a', 161 | *arg,**kw) 162 | 163 | def add_pipspager(self,pos,*arg,**kw): 164 | return self.ui.add_pipspager(pos, 165 | bg='#f3f3f3',fg='#868686', 166 | buttonfg='#8a8a8a',buttonbg='#f9f9f9', 167 | activefg='#5f5f5f',activebg='#f9f9f9', 168 | buttononfg='#5f5f5f',buttononbg='#f9f9f9', 169 | *arg,**kw) 170 | 171 | def add_notebook(self,pos,*arg,**kw): 172 | return self.ui.add_notebook(pos, 173 | color='#f3f3f3',fg='#5d5d5d',bg='#f3f3f3', 174 | activefg='#595959',activebg='#eaeaea', 175 | onfg='#1a1a1a',onbg='#f9f9f9', 176 | scrollbg='#f9f9f9',scrollcolor='#8d8d8d',scrollon='#8a8a8a', 177 | *arg,**kw) 178 | 179 | def add_radiobox(self,pos,*arg,**kw): 180 | return self.ui.add_radiobox(pos, 181 | fontfg='black',fg='#8b8b8b',bg='#ededed', 182 | activefg='#898989',activebg='#e5e5e5', 183 | onfg='#3041d8',onbg='#ffffff', 184 | *arg,**kw) 185 | 186 | def add_ratingbar(self,pos,*arg,**kw): 187 | return self.ui.add_ratingbar(pos, 188 | fg='#5d5d5d',bg='#f3f3f3', 189 | onfg='#3041d8',onbg='#3041d8', 190 | *arg,**kw) 191 | 192 | def add_notecard(self,pos,*arg,**kw): 193 | return self.ui.add_notecard(pos, 194 | tfg='#1b1b1b',tbg='#fbfbfb',fg='#1a1a1a', 195 | bg='#f4f4f4',sep='#e5e5e5', 196 | *arg,**kw) 197 | 198 | def add_pivot(self,pos,*arg,**kw): 199 | return self.ui.add_pivot(pos, 200 | fg='#616161',bg='', 201 | activefg='#000000',activecolor='#5969e0', 202 | *arg,**kw) 203 | 204 | def add_button2(self,pos,*arg,**kw): 205 | return self.ui.add_button2(pos,fg='#1b1b1b',bg='#fbfbfb', 206 | activefg='#1a1a1a',activebg='#f6f6f6', 207 | line='#cccccc',linew=1,activeline='#cccccc', 208 | onfg='#5d5d5d',onbg='#f5f5f5',online='#e5e5e5', 209 | *arg,**kw) 210 | 211 | def add_expander(self,pos,*arg,**kw): 212 | return self.ui.add_expander(pos, 213 | tfg='#1b1b1b',tbg='#fbfbfb', 214 | bg='#f4f4f4',sep='#e5e5e5', 215 | buttonfg='#1b1b1b',buttonbg='#fbfbfb',buttonline='#fbfbfb', 216 | activefg='#1a1a1a',activebg='#f2f2f2',activeline='#f2f2f2', 217 | onfg='#1a1a1a',onbg='#f5f5f5',online='#f5f5f5', 218 | *arg,**kw) 219 | 220 | def add_waitframe(self,pos,*arg,**kw): 221 | return self.ui.add_waitframe(pos, 222 | fg='#fbfbfb',bg='#f6f6f6', 223 | *arg,**kw) 224 | 225 | def add_listview(self,pos,*arg,**kw): 226 | return self.ui.add_listview(pos, 227 | bg='#f3f3f3',activebg='#eaeaea',oncolor='#3041d8', 228 | scrobg='#f8f8f8',scroc='#868686',scrooc='#898989', 229 | *arg,**kw) 230 | 231 | def add_treeview(self,pos,*arg,**kw): 232 | return self.ui.add_treeview(pos, 233 | fg='#1a1a1a',bg='#f3f3f3', 234 | onfg='#1a1a1a',onbg='#eaeaea', 235 | oncolor='#3041d8',signcolor='#8a8a8a', 236 | *arg,**kw) 237 | 238 | def add_togglebutton(self,pos,*arg,**kw): 239 | return self.ui.add_togglebutton(pos, 240 | fg='#1b1b1b',bg='#fbfbfb',line='#cccccc', 241 | activefg='#f3f4fd',activebg='#3041d8',activeline='#5360de', 242 | *arg,**kw) 243 | 244 | def add_swipecontrol(self,pos,*arg,**kw): 245 | return self.ui.add_swipecontrol(pos, 246 | fg='#1a1a1a',bg='#f3f3f3',line='#fbfbfb', 247 | data={'left':({'text':'✔️\nok','fg':'#202020','bg':'#bcbcbc','command':print},), 248 | 'right':({'text':'❌\nclose'},)}, 249 | *arg,**kw) 250 | 251 | def add_picker(self,pos,*arg,**kw): 252 | return self.ui.add_picker(pos, 253 | fg='#1b1b1b',bg='#fbfbfb', 254 | outline='#ececec',activefg='#1b1b1b', 255 | activebg='#f6f6f6',onfg='#eaecfb',onbg='#3748d9', 256 | buttonfg='#1a1a1a',buttonbg='#fbfbfb', 257 | buttonactivefg='#1a1a1a',buttonactivebg='#f3f3f3', 258 | *arg,**kw) 259 | 260 | def add_menubutton(self,pos,*arg,**kw): 261 | return self.ui.add_menubutton(pos, 262 | fg='#1b1b1b',bg='#fbfbfb',line='#CCCCCC', 263 | activefg='#1a1a1a',activebg='#f6f6f6',activeline='#cccccc', 264 | onfg='#5d5d5d',onbg='#f5f5f5',online='#e5e5e5', 265 | menuonfg='#191919',menuonbg='#f0f0f0',menuonline='#f0f0f0', 266 | *arg,**kw) 267 | 268 | def add_barbutton(self,pos,*arg,**kw): 269 | return self.ui.add_barbutton(pos, 270 | fg='#636363',bg='#f3f3f3',line='#f3f3f3', 271 | activefg='#191919',activebg='#eaeaea',activeline='#eaeaea', 272 | onfg='#5a5a5a',onbg='#ededed',online='#ededed',sepcolor='#e5e5e5', 273 | *arg,**kw) 274 | 275 | def add_flyout(self,fid,*arg,**kw): 276 | return self.ui.add_flyout(fid, 277 | line='#dcdcdc', bg='#f9f9f9', 278 | *arg,**kw) 279 | 280 | def add_back(self,pos,*arg,**kw): 281 | return self.ui.add_back(pos, 282 | fg='#f3f3f3',bg='#f3f3f3', 283 | *arg,**kw) 284 | -------------------------------------------------------------------------------- /theme/tinuilightcyan.py: -------------------------------------------------------------------------------- 1 | # generate by 豆包 2 | from typing import Union 3 | import sys 4 | try: 5 | from tinui import TinUI, BasicTinUI, TinUITheme 6 | except: 7 | sys.path.append('../') 8 | from TinUI import TinUI, BasicTinUI, TinUITheme 9 | 10 | class TinUILightCyan(TinUITheme): 11 | def __init__(self,ui:Union[TinUI,BasicTinUI]): 12 | super().__init__(ui,'tinui-light-cyan-theme') 13 | self.label='light-cyan' 14 | self.ui['background']='#f0f8ff' 15 | 16 | def add_button(self,pos,*arg,**kw): 17 | return self.ui.add_button(pos,fg='#1e3799',bg='#e0f7fa', 18 | activefg='#1976d2',activebg='#b3e5fc', 19 | line='#80deea',linew=1,activeline='#80deea', 20 | *arg,**kw) 21 | 22 | def add_checkbutton(self,pos,*arg,**kw): 23 | return self.ui.add_checkbutton(pos, 24 | fontfg='#1976d2',fg='#00acc1',bg='#e0f7fa', 25 | activefg='#00acc1',activebg='#b2ebf2', 26 | onfg='white',onbg='#00bcd4', 27 | *arg,**kw) 28 | 29 | def add_label(self,pos,*arg,**kw): 30 | return self.ui.add_label(pos,fg='#1976d2',bg='#f0f8ff', 31 | outline='#f0f8ff',*arg,**kw) 32 | 33 | def add_entry(self,pos,*arg,**kw): 34 | return self.ui.add_entry(pos,fg='#42a5f5',bg='#e0f7fa', 35 | activefg='#1976d2',activebg='#ffffff', 36 | line='#80deea',activeline='#80deea', 37 | outline='#00acc1',onoutline='#0097a7',insert='#000000', 38 | *arg,**kw) 39 | 40 | def add_separate(self,pos,*arg,**kw): 41 | return self.ui.add_separate(pos,fg='#80deea', 42 | *arg,**kw) 43 | 44 | def add_radiobutton(self,pos,*arg,**kw): 45 | return self.ui.add_radiobutton(pos, 46 | fg='#1976d2',bg='#e0f7fa', 47 | activefg='#1565c0',activebg='#b3e5fc', 48 | *arg,**kw) 49 | 50 | def add_link(self,pos,*arg,**kw): 51 | return self.ui.add_link(pos,fg='#007bff', 52 | activefg='red',activebg='#e3f2fd', 53 | *arg,**kw) 54 | 55 | def add_waitbar1(self,pos,*arg,**kw): 56 | return self.ui.add_waitbar1(pos,fg='#0097a7', 57 | bg='#f0f8ff',okfg='#0097a7',bd=5, 58 | *arg,**kw) 59 | 60 | def add_labelframe(self,uids:tuple,*arg,**kw): 61 | return self.ui.add_labelframe(uids,fg='#1976d2',bg='#e8f5e9', 62 | *arg,**kw) 63 | 64 | def add_waitbar2(self,pos,*arg,**kw): 65 | return self.ui.add_waitbar2(pos, 66 | fg='#0097a7',bg='#f0f8ff',okcolor='#4caf50', 67 | *arg,**kw) 68 | 69 | def add_combobox(self,pos,*arg,**kw): 70 | return self.ui.add_combobox(pos, 71 | fg='#1976d2',bg='#e0f7fa',outline='#80deea', 72 | activefg='#1976d2',activebg='#e3f2fd', 73 | scrollbg='#f5f5f5',scrollcolor='#9e9e9e',scrollon='#757575', 74 | *arg,**kw) 75 | 76 | def add_progressbar(self,pos,*arg,**kw): 77 | return self.ui.add_progressbar(pos, 78 | fg='#00acc1',bg='#0097a7',back='#f0f8ff', 79 | fontc='#b3e5fc',*arg,**kw) 80 | 81 | def add_table(self,pos,*arg,**kw): 82 | return self.ui.add_table(pos, 83 | outline='#80deea',fg='black',bg='white', 84 | headbg='#e0f7fa',*arg,**kw) 85 | 86 | def add_onoff(self,pos,*arg,**kw): 87 | return self.ui.add_onoff(pos, 88 | fg='#42a5f5',bg='#e0f7fa', 89 | onfg='#ffffff',onbg='#00bcd4', 90 | *arg,**kw) 91 | 92 | def add_spinbox(self,pos,*arg,**kw): 93 | return self.ui.add_spinbox(pos, 94 | fg='#1976d2',bg='#e0f7fa',line='#80deea', 95 | activefg='#1565c0',activebg='#e3f2fd', 96 | onfg='#00acc1',onbg='#e0f7fa', 97 | boxfg='#42a5f5',boxbg='#e0f7fa', 98 | boxactivefg='#3949ab',boxactivebg='#d0d0d0', 99 | *arg,**kw) 100 | 101 | def add_scalebar(self,pos,*arg,**kw): 102 | return self.ui.add_scalebar(pos, 103 | fg='#0097a7',bg='#00acc1',activefg='#0097a7', 104 | buttonbg='#ffffff',buttonoutline='#80deea', 105 | *arg,**kw) 106 | 107 | def add_info(self,pos,*arg,**kw): 108 | return self.ui.add_info(pos, 109 | fg='#007bff',bg='#e3f2fd',info_fg='#1976d2', 110 | *arg,**kw) 111 | 112 | def add_menubar(self,uid,*arg,**kw): 113 | return self.ui.add_menubar(uid, 114 | fg='#1976d2',bg='#e3f2fd',line='#80deea', 115 | activefg='#1565c0',activebg='#e0e0e0',activeline='#e0e0e0',*arg,**kw) 116 | 117 | def add_tooltip(self,uid,*arg,**kw): 118 | return self.ui.add_tooltip(uid,fg='#1976d2',bg='#e0e0e0', 119 | *arg,**kw) 120 | 121 | def add_waitbar3(self,pos,*arg,**kw): 122 | return self.ui.add_waitbar3(pos, 123 | fg='#0097a7',bg='#f0f8ff',okcolor='#0097a7', 124 | *arg,**kw) 125 | 126 | def add_textbox(self,pos,*arg,**kw): 127 | return self.ui.add_textbox(pos,fg='#1976d2',bg='white', 128 | outline='#00acc1',onoutline='#0097a7', 129 | scrollbg='#e0f7fa',scrollcolor='#8d8d8d',scrollon='#8a8a8a', 130 | *arg,**kw) 131 | 132 | def add_scrollbar(self,pos,widget,*arg,**kw): 133 | return self.ui.add_scrollbar(pos,widget, 134 | bg='#e0f7fa',color='#8d8d8d', 135 | oncolor='#8a8a8a',*arg,**kw) 136 | 137 | def add_listbox(self,pos,*arg,**kw): 138 | return self.ui.add_listbox(pos, 139 | bg='#e0f7fa',fg='black',activebg='#b3e5fc',sel='#80deea', 140 | scrollbg='#e0f7fa',scrollcolor='#8d8d8d',scrollon='#8a8a8a', 141 | *arg,**kw) 142 | 143 | def add_canvas(self,pos,*arg,**kw): 144 | return self.ui.add_canvas(pos, 145 | outline='#808080',linew=1, 146 | scrollbg='#e0f7fa',scrollcolor='#8d8d8d',scrollon='#8a8a8a', 147 | *arg,**kw) 148 | 149 | def add_pipspager(self,pos,*arg,**kw): 150 | return self.ui.add_pipspager(pos, 151 | bg='#f0f8ff',fg='#00acc1', 152 | buttonfg='#42a5f5',buttonbg='#e0f7fa', 153 | activefg='#3949ab',activebg='#e0f7fa', 154 | buttononfg='#3949ab',buttononbg='#e0f7fa', 155 | *arg,**kw) 156 | 157 | def add_notebook(self,pos,*arg,**kw): 158 | return self.ui.add_notebook(pos, 159 | color='#f0f8ff',fg='#42a5f5',bg='#f0f8ff', 160 | activefg='#3949ab',activebg='#e3f2fd', 161 | onfg='#1976d2',onbg='#e3f2fd', 162 | scrollbg='#e0f7fa',scrollcolor='#8d8d8d',scrollon='#8a8a8a', 163 | *arg,**kw) 164 | 165 | def add_radiobox(self,pos,*arg,**kw): 166 | return self.ui.add_radiobox(pos, 167 | fontfg='black',fg='#00acc1',bg='#e0f7fa', 168 | activefg='#0097a7',activebg='#b2ebf2', 169 | onfg='#007bff',onbg='#ffffff', 170 | *arg,**kw) 171 | 172 | def add_ratingbar(self,pos,*arg,**kw): 173 | return self.ui.add_ratingbar(pos, 174 | fg='#42a5f5',bg='#f0f8ff', 175 | onfg='#0097a7',onbg='#0097a7', 176 | *arg,**kw) 177 | 178 | def add_notecard(self,pos,*arg,**kw): 179 | return self.ui.add_notecard(pos, 180 | tfg='#1976d2',tbg='#e0f7fa',fg='#1976d2', 181 | bg='#e8f5e9',sep='#80deea', 182 | *arg,**kw) 183 | 184 | def add_pivot(self,pos,*arg,**kw): 185 | return self.ui.add_pivot(pos, 186 | fg='#42a5f5',bg='', 187 | activefg='#000000',activecolor='#0097a7', 188 | *arg,**kw) 189 | 190 | def add_button2(self,pos,*arg,**kw): 191 | return self.ui.add_button2(pos,fg='#1976d2',bg='#e0f7fa', 192 | activefg='#1565c0',activebg='#b3e5fc', 193 | line='#80deea',linew=1,activeline='#80deea', 194 | onfg='#42a5f5',onbg='#e0f7fa',online='#80deea', 195 | *arg,**kw) 196 | 197 | def add_expander(self,pos,*arg,**kw): 198 | return self.ui.add_expander(pos, 199 | tfg='#1976d2',tbg='#e0f7fa', 200 | bg='#e8f5e9',sep='#80deea', 201 | buttonfg='#1976d2',buttonbg='#e0f7fa',buttonline='#e0f7fa', 202 | activefg='#1565c0',activebg='#e3f2fd',activeline='#e3f2fd', 203 | onfg='#1976d2',onbg='#e0f7fa',online='#e0f7fa', 204 | *arg,**kw) 205 | 206 | def add_waitframe(self,pos,*arg,**kw): 207 | return self.ui.add_waitframe(pos, 208 | fg='#e0f7fa',bg='#e3f2fd', 209 | *arg,**kw) 210 | 211 | def add_listview(self,pos,*arg,**kw): 212 | return self.ui.add_listview(pos, 213 | bg='#f0f8ff',activebg='#e3f2fd',oncolor='#0097a7', 214 | scrobg='#e0f7fa',scroc='#868686',scrooc='#898989', 215 | *arg,**kw) 216 | 217 | def add_treeview(self,pos,*arg,**kw): 218 | return self.ui.add_treeview(pos, 219 | fg='#1976d2',bg='#f0f8ff', 220 | onfg='#1976d2',onbg='#e3f2fd', 221 | oncolor='#0097a7',signcolor='#8a8a8a', 222 | *arg,**kw) 223 | 224 | def add_togglebutton(self,pos,*arg,**kw): 225 | return self.ui.add_togglebutton(pos, 226 | fg='#1976d2',bg='#e0f7fa',line='#80deea', 227 | activefg='#e0f7fa',activebg='#0097a7',activeline='#00838f', 228 | *arg,**kw) 229 | 230 | def add_swipecontrol(self,pos,*arg,**kw): 231 | return self.ui.add_swipecontrol(pos, 232 | fg='#1976d2',bg='#f0f8ff',line='#e0f7fa', 233 | data={'left':({'text':'✔️\nok','fg':'#202020','bg':'#b2ebf2','command':print},), 234 | 'right':({'text':'❌\nclose'},)}, 235 | *arg,**kw) 236 | 237 | def add_picker(self,pos,*arg,**kw): 238 | return self.ui.add_picker(pos, 239 | fg='#1976d2',bg='#e0f7fa', 240 | outline='#e0e0e0',activefg='#1976d2', 241 | activebg='#e3f2fd',onfg='#e3f2fd',onbg='#0097a7', 242 | buttonfg='#1976d2',buttonbg='#e0f7fa', 243 | buttonactivefg='#1976d2',buttonactivebg='#e0f7fa', 244 | *arg,**kw) 245 | 246 | def add_menubutton(self,pos,*arg,**kw): 247 | return self.ui.add_menubutton(pos, 248 | fg='#1976d2',bg='#e0f7fa',line='#80deea', 249 | activefg='#1565c0',activebg='#b3e5fc',activeline='#80deea', 250 | onfg='#42a5f5',onbg='#e0f7fa',online='#80deea', 251 | menuonfg='#1565c0',menuonbg='#e0e0e0',menuonline='#e0e0e0', 252 | *arg,**kw) 253 | 254 | def add_barbutton(self,pos,*arg,**kw): 255 | return self.ui.add_barbutton(pos, 256 | fg='#42a5f5',bg='#f0f8ff',line='#f0f8ff', 257 | activefg='#1565c0',activebg='#e3f2fd',activeline='#e3f2fd', 258 | onfg='#42a5f5',onbg='#e0f7fa',online='#e0f7fa',sepcolor='#80deea', 259 | *arg,**kw) 260 | 261 | def add_flyout(self,fid,*arg,**kw): 262 | return self.ui.add_flyout(fid, 263 | line='#80deea', bg='#e3f2fd', 264 | *arg,**kw) 265 | -------------------------------------------------------------------------------- /theme/tinuilightred.py: -------------------------------------------------------------------------------- 1 | # generate by 豆包 2 | from typing import Union 3 | import sys 4 | try: 5 | from tinui import TinUI, BasicTinUI, TinUITheme 6 | except: 7 | sys.path.append('../') 8 | from TinUI import TinUI, BasicTinUI, TinUITheme 9 | 10 | 11 | class TinUILightRed(TinUITheme): 12 | def __init__(self, ui: Union[TinUI, BasicTinUI]): 13 | super().__init__(ui, 'tinui-light-red-theme') 14 | self.label = 'light-red' 15 | self.ui['background'] = '#fef0f0' 16 | 17 | def add_button(self, pos, *arg, **kw): 18 | return self.ui.add_button(pos, fg='#7f0000', bg='#ffe4e1', 19 | activefg='#b22222', activebg='#ffc0cb', 20 | line='#ff9999', linew=1, activeline='#ff9999', 21 | *arg, **kw) 22 | 23 | def add_checkbutton(self, pos, *arg, **kw): 24 | return self.ui.add_checkbutton(pos, 25 | fontfg='#b22222', fg='#ff6347', bg='#ffe4e1', 26 | activefg='#ff6347', activebg='#ffd1dc', 27 | onfg='white', onbg='#ff0000', 28 | *arg, **kw) 29 | 30 | def add_label(self, pos, *arg, **kw): 31 | return self.ui.add_label(pos, fg='#b22222', bg='#fef0f0', 32 | outline='#fef0f0', *arg, **kw) 33 | 34 | def add_entry(self, pos, *arg, **kw): 35 | return self.ui.add_entry(pos, fg='#ff4500', bg='#ffe4e1', 36 | activefg='#b22222', activebg='#ffffff', 37 | line='#ff9999', activeline='#ff9999', 38 | outline='#ff6347', onoutline='#ff0000', insert='#000000', 39 | *arg, **kw) 40 | 41 | def add_separate(self, pos, *arg, **kw): 42 | return self.ui.add_separate(pos, fg='#ff9999', 43 | *arg, **kw) 44 | 45 | def add_radiobutton(self, pos, *arg, **kw): 46 | return self.ui.add_radiobutton(pos, 47 | fg='#b22222', bg='#ffe4e1', 48 | activefg='#990000', activebg='#ffc0cb', 49 | *arg, **kw) 50 | 51 | def add_link(self, pos, *arg, **kw): 52 | return self.ui.add_link(pos, fg='#ff0000', 53 | activefg='red', activebg='#ffe4e1', 54 | *arg, **kw) 55 | 56 | def add_waitbar1(self, pos, *arg, **kw): 57 | return self.ui.add_waitbar1(pos, fg='#ff0000', 58 | bg='#fef0f0', okfg='#ff0000', bd=5, 59 | *arg, **kw) 60 | 61 | def add_labelframe(self, uids: tuple, *arg, **kw): 62 | return self.ui.add_labelframe(uids, fg='#b22222', bg='#fbe9e7', 63 | *arg, **kw) 64 | 65 | def add_waitbar2(self, pos, *arg, **kw): 66 | return self.ui.add_waitbar2(pos, 67 | fg='#ff0000', bg='#fef0f0', okcolor='#ff0000', 68 | *arg, **kw) 69 | 70 | def add_combobox(self, pos, *arg, **kw): 71 | return self.ui.add_combobox(pos, 72 | fg='#b22222', bg='#ffe4e1', outline='#ff9999', 73 | activefg='#b22222', activebg='#ffe4e1', 74 | scrollbg='#f5f5f5', scrollcolor='#9e9e9e', scrollon='#757575', 75 | *arg, **kw) 76 | 77 | def add_progressbar(self, pos, *arg, **kw): 78 | return self.ui.add_progressbar(pos, 79 | fg='#ff6347', bg='#ff0000', back='#fef0f0', 80 | fontc='#ffb6c1', *arg, **kw) 81 | 82 | def add_table(self, pos, *arg, **kw): 83 | return self.ui.add_table(pos, 84 | outline='#ff9999', fg='black', bg='white', 85 | headbg='#ffe4e1', *arg, **kw) 86 | 87 | def add_onoff(self, pos, *arg, **kw): 88 | return self.ui.add_onoff(pos, 89 | fg='#ff4500', bg='#ffe4e1', 90 | onfg='#ffffff', onbg='#ff0000', 91 | *arg, **kw) 92 | 93 | def add_spinbox(self, pos, *arg, **kw): 94 | return self.ui.add_spinbox(pos, 95 | fg='#b22222', bg='#ffe4e1', line='#ff9999', 96 | activefg='#990000', activebg='#ffd1dc', 97 | onfg='#ff6347', onbg='#ffe4e1', 98 | boxfg='#ff4500', boxbg='#ffe4e1', 99 | boxactivefg='#7f0000', boxactivebg='#ffe4e1', 100 | *arg, **kw) 101 | 102 | def add_scalebar(self, pos, *arg, **kw): 103 | return self.ui.add_scalebar(pos, 104 | fg='#ff0000', bg='#ff6347', activefg='#ff0000', 105 | buttonbg='#ffffff', buttonoutline='#ff9999', 106 | *arg, **kw) 107 | 108 | def add_info(self, pos, *arg, **kw): 109 | return self.ui.add_info(pos, 110 | fg='#ff0000', bg='#ffe4e1', info_fg='#b22222', 111 | *arg, **kw) 112 | 113 | def add_menubar(self, uid, *arg, **kw): 114 | return self.ui.add_menubar(uid, 115 | fg='#b22222', bg='#ffe4e1', line='#ff9999', 116 | activefg='#990000', activebg='#ffe4e1', activeline='#ffe4e1', *arg, **kw) 117 | 118 | def add_tooltip(self, uid, *arg, **kw): 119 | return self.ui.add_tooltip(uid, fg='#b22222', bg='#ffe4e1', 120 | *arg, **kw) 121 | 122 | def add_waitbar3(self, pos, *arg, **kw): 123 | return self.ui.add_waitbar3(pos, 124 | fg='#ff0000', bg='#fef0f0', okcolor='#ff0000', 125 | *arg, **kw) 126 | 127 | def add_textbox(self, pos, *arg, **kw): 128 | return self.ui.add_textbox(pos, fg='#b22222', bg='white', 129 | outline='#ff6347', onoutline='#ff0000', 130 | scrollbg='#ffe4e1', scrollcolor='#8d8d8d', scrollon='#8a8a8a', 131 | *arg, **kw) 132 | 133 | def add_scrollbar(self, pos, widget, *arg, **kw): 134 | return self.ui.add_scrollbar(pos, widget, 135 | bg='#ffe4e1', color='#8d8d8d', 136 | oncolor='#8a8a8a', *arg, **kw) 137 | 138 | def add_listbox(self, pos, *arg, **kw): 139 | return self.ui.add_listbox(pos, 140 | bg='#ffe4e1', fg='black', activebg='#ffc0cb', sel='#ff9999', 141 | scrollbg='#ffe4e1', scrollcolor='#8d8d8d', scrollon='#8a8a8a', 142 | *arg, **kw) 143 | 144 | def add_canvas(self, pos, *arg, **kw): 145 | return self.ui.add_canvas(pos, 146 | outline='#808080', linew=1, 147 | scrollbg='#ffe4e1', scrollcolor='#8d8d8d', scrollon='#8a8a8a', 148 | *arg, **kw) 149 | 150 | def add_pipspager(self, pos, *arg, **kw): 151 | return self.ui.add_pipspager(pos, 152 | bg='#fef0f0', fg='#ff6347', 153 | buttonfg='#ff4500', buttonbg='#ffe4e1', 154 | activefg='#7f0000', activebg='#ffe4e1', 155 | buttononfg='#7f0000', buttononbg='#ffe4e1', 156 | *arg, **kw) 157 | 158 | def add_notebook(self, pos, *arg, **kw): 159 | return self.ui.add_notebook(pos, 160 | color='#fef0f0', fg='#ff4500', bg='#fef0f0', 161 | activefg='#7f0000', activebg='#ffe4e1', 162 | onfg='#b22222', onbg='#ffe4e1', 163 | scrollbg='#ffe4e1', scrollcolor='#8d8d8d', scrollon='#8a8a8a', 164 | *arg, **kw) 165 | 166 | def add_radiobox(self, pos, *arg, **kw): 167 | return self.ui.add_radiobox(pos, 168 | fontfg='black', fg='#ff6347', bg='#ffe4e1', 169 | activefg='#ff0000', activebg='#ffd1dc', 170 | onfg='#ff0000', onbg='#ffffff', 171 | *arg, **kw) 172 | 173 | def add_ratingbar(self, pos, *arg, **kw): 174 | return self.ui.add_ratingbar(pos, 175 | fg='#ff4500', bg='#fef0f0', 176 | onfg='#ff0000', onbg='#ff0000', 177 | *arg, **kw) 178 | 179 | def add_notecard(self, pos, *arg, **kw): 180 | return self.ui.add_notecard(pos, 181 | tfg='#b22222', tbg='#ffe4e1', fg='#b22222', 182 | bg='#fbe9e7', sep='#ff9999', 183 | *arg, **kw) 184 | 185 | def add_pivot(self, pos, *arg, **kw): 186 | return self.ui.add_pivot(pos, 187 | fg='#ff4500', bg='', 188 | activefg='#000000', activecolor='#ff0000', 189 | *arg, **kw) 190 | 191 | def add_button2(self, pos, *arg, **kw): 192 | return self.ui.add_button2(pos, fg='#b22222', bg='#ffe4e1', 193 | activefg='#990000', activebg='#ffc0cb', 194 | line='#ff9999', linew=1, activeline='#ff9999', 195 | onfg='#ff4500', onbg='#ffe4e1', online='#ff9999', 196 | *arg, **kw) 197 | 198 | def add_expander(self, pos, *arg, **kw): 199 | return self.ui.add_expander(pos, 200 | tfg='#b22222', tbg='#ffe4e1', 201 | bg='#fbe9e7', sep='#ff9999', 202 | buttonfg='#b22222', buttonbg='#ffe4e1', buttonline='#ffe4e1', 203 | activefg='#990000', activebg='#ffd1dc', activeline='#ffd1dc', 204 | onfg='#b22222', onbg='#ffe4e1', online='#ffe4e1', 205 | *arg, **kw) 206 | 207 | def add_waitframe(self, pos, *arg, **kw): 208 | return self.ui.add_waitframe(pos, 209 | fg='#ffe4e1', bg='#ffd1dc', 210 | *arg, **kw) 211 | 212 | def add_listview(self, pos, *arg, **kw): 213 | return self.ui.add_listview(pos, 214 | bg='#fef0f0', activebg='#ffe4e1', oncolor='#ff0000', 215 | scrobg='#ffe4e1', scroc='#868686', scrooc='#898989', 216 | *arg, **kw) 217 | 218 | def add_treeview(self, pos, *arg, **kw): 219 | return self.ui.add_treeview(pos, 220 | fg='#b22222', bg='#fef0f0', 221 | onfg='#b22222', onbg='#ffe4e1', 222 | oncolor='#ff0000', signcolor='#8a8a8a', 223 | *arg, **kw) 224 | 225 | def add_togglebutton(self, pos, *arg, **kw): 226 | return self.ui.add_togglebutton(pos, 227 | fg='#b22222', bg='#ffe4e1', line='#ff9999', 228 | activefg='#ffe4e1', activebg='#ff0000', activeline='#ff0000', 229 | *arg, **kw) 230 | 231 | def add_swipecontrol(self, pos, *arg, **kw): 232 | return self.ui.add_swipecontrol(pos, 233 | fg='#b22222', bg='#fef0f0', line='#ffe4e1', 234 | data={'left': ({'text': '✔️\nok', 'fg': '#202020', 'bg': '#ffc0cb', 'command': print},), 235 | 'right': ({'text': '❌\nclose'},)}, 236 | *arg, **kw) 237 | 238 | def add_picker(self, pos, *arg, **kw): 239 | return self.ui.add_picker(pos, 240 | fg='#b22222', bg='#ffe4e1', 241 | outline='#ffe4e1', activefg='#b22222', 242 | activebg='#ffe4e1', onfg='#ffe4e1', onbg='#ff0000', 243 | buttonfg='#b22222', buttonbg='#ffe4e1', 244 | buttonactivefg='#b22222', buttonactivebg='#ffe4e1', 245 | *arg, **kw) 246 | 247 | def add_menubutton(self, pos, *arg, **kw): 248 | return self.ui.add_menubutton(pos, 249 | fg='#b22222', bg='#ffe4e1', line='#ff9999', 250 | activefg='#990000', activebg='#ffc0cb', activeline='#ff9999', 251 | onfg='#ff4500', onbg='#ffe4e1', online='#ff9999', 252 | menuonfg='#990000', menuonbg='#ffe4e1', menuonline='#ffe4e1', 253 | *arg, **kw) 254 | 255 | def add_barbutton(self, pos, *arg, **kw): 256 | return self.ui.add_barbutton(pos, 257 | fg='#ff4500', bg='#fef0f0', line='#fef0f0', 258 | activefg='#990000', activebg='#ffe4e1', activeline='#ffe4e1', 259 | onfg='#ff4500', onbg='#ffe4e1', online='#ffe4e1', sepcolor='#ff9999', 260 | *arg, **kw) 261 | 262 | def add_flyout(self, fid, *arg, **kw): 263 | return self.ui.add_flyout(fid, 264 | line='#ff9999', bg='#ffe4e1', 265 | *arg, **kw) 266 | -------------------------------------------------------------------------------- /theme/tinuimoderndark.py: -------------------------------------------------------------------------------- 1 | # 由chatglm-4生成,作者小改。作为范例,不会维护 2 | from typing import Union 3 | import sys 4 | try: 5 | from tinui import TinUI, BasicTinUI, TinUITheme 6 | except: 7 | sys.path.append('../') 8 | from TinUI import TinUI, BasicTinUI, TinUITheme 9 | 10 | 11 | 12 | class TinUIModernDark(TinUITheme): 13 | ''' 14 | 这是TinUI现代黑暗模式的托管类,不是继承类 15 | 调用时需要注意文本和数据,样式类参数无需理会 16 | ''' 17 | 18 | def __init__(self, ui: Union[TinUI, BasicTinUI]): 19 | super().__init__(ui, 'tinui-modern-dark-theme') 20 | self.label = 'modern-dark' 21 | self.ui['background'] = '#1e1e1e' 22 | 23 | def add_button(self, pos, *arg, **kw): 24 | return self.ui.add_button(pos, fg='#d9d9d9', bg='#2a2a2a', activefg='#ffffff', activebg='#3c3c3c', line='#424242', linew=1, activeline='#525252', *arg, **kw) 25 | 26 | def add_checkbutton(self, pos, *arg, **kw): 27 | return self.ui.add_checkbutton(pos, fontfg='#d9d9d9', fg='#8c8c8c', bg='#212121', activefg='#9c9c9c', activebg='#2a2a2a', onfg='#010101', onbg='#3b78e7', *arg, **kw) 28 | 29 | def add_label(self, pos, *arg, **kw): 30 | return self.ui.add_label(pos, fg='#d9d9d9', bg='#1e1e1e', outline='#1e1e1e', *arg, **kw) 31 | 32 | def add_entry(self, pos, *arg, **kw): 33 | return self.ui.add_entry(pos, fg='#cfcfcf', bg='#2a2a2a', activefg='#e6e6e6', activebg='#212121', line='#424242', activeline='#525252', outline='#8c8c8c', onoutline='#3b78e7', insert='#e0e0e0', *arg, **kw) 34 | 35 | def add_separate(self, pos, *arg, **kw): 36 | return self.ui.add_separate(pos, fg='#3c3c3c', *arg, **kw) 37 | 38 | def add_radiobutton(self, pos, *arg, **kw): 39 | return self.ui.add_radiobutton(pos, fg='#f2f2f2', bg='#2a2a2a', activefg='#ffffff', activebg='#3c3c3c', *arg, **kw) 40 | 41 | def add_link(self, pos, *arg, **kw): 42 | return self.ui.add_link(pos, fg='#3b78e7', activefg='#3b78e7', activebg='#2a2a2a', *arg, **kw) 43 | 44 | def add_waitbar1(self, pos, *arg, **kw): 45 | return self.ui.add_waitbar1(pos, fg='#3b78e7', bg='#1e1e1e', okfg='#3b78e7', bd=5, *arg, **kw) 46 | 47 | def add_labelframe(self, uids: tuple, *arg, **kw): 48 | return self.ui.add_labelframe(uids, fg='#d9d9d9', bg='#212121', *arg, **kw) 49 | 50 | def add_waitbar2(self, pos, *arg, **kw): 51 | return self.ui.add_waitbar2(pos, fg='#3b78e7', bg='#1e1e1e', okcolor='#6ccb5f', *arg, **kw) 52 | 53 | def add_combobox(self, pos, *arg, **kw): 54 | return self.ui.add_combobox(pos, fg='#cfcfcf', bg='#2a2a2a', outline='#424242', activefg='#ffffff', activebg='#3c3c3c', scrollbg='#212121', scrollcolor='#8c8c8c', scrollon='#9c9c9c', *arg, **kw) 55 | 56 | def add_progressbar(self, pos, *arg, **kw): 57 | return self.ui.add_progressbar(pos, fg='#8c8c8c', bg='#3b78e7', back='#1e1e1e', fontc='#0000ff', *arg, **kw) 58 | 59 | def add_table(self, pos, *arg, **kw): 60 | return self.ui.add_table(pos, outline='#8c8c8c', fg='#d9d9d9', bg='#2a2a2a', headbg='#1e1e1e', *arg, **kw) 61 | 62 | def add_onoff(self, pos, *arg, **kw): 63 | return self.ui.add_onoff(pos, fg='#cfcfcf', bg='#212121', onfg='#000000', onbg='#3b78e7', *arg, **kw) 64 | 65 | def add_spinbox(self, pos, *arg, **kw): 66 | return self.ui.add_spinbox(pos, fg='#d9d9d9', bg='#2a2a2a', line='#424242', activefg='#c0c0c0', activebg='#3c3c3c', boxfg='#cfcfcf', boxbg='#212121', boxactivefg='#d2d2d2', boxactivebg='#323232', onfg='#8c8c8c', onbg='#2a2a2a', *arg, **kw) 67 | 68 | def add_scalebar(self, pos, *arg, **kw): 69 | return self.ui.add_scalebar(pos, fg='#3b78e7', bg='#8c8c8c', activefg='#3b78e7', buttonbg='#3c3c3c', buttonoutline='#424242', *arg, **kw) 70 | 71 | def add_info(self, pos, *arg, **kw): 72 | return self.ui.add_info(pos, fg='#3b78e7', bg='#2a2a2a', info_fg='#d9d9d9', *arg, **kw) 73 | 74 | def add_menubar(self, uid, *arg, **kw): 75 | return self.ui.add_menubar(uid, fg='#d9d9d9', bg='#212121', line='#8c8c8c', activefg='#ffffff', activebg='#3c3c3c', activeline='#3c3c3c', *arg, **kw) 76 | 77 | def add_tooltip(self, uid, *arg, **kw): 78 | return self.ui.add_tooltip(uid, fg='#e8e8e8', bg='#3c3c3c', *arg, **kw) 79 | 80 | def add_waitbar3(self, pos, *arg, **kw): 81 | return self.ui.add_waitbar3(pos, fg='#3b78e7', bg='#1e1e1e', okcolor='#3b78e7', *arg, **kw) 82 | 83 | def add_textbox(self, pos, *arg, **kw): 84 | return self.ui.add_textbox(pos, fg='#d9d9d9', bg='#2a2a2a', outline='#8c8c8c', onoutline='#3b78e7', scrollbg='#212121', scrollcolor='#8c8c8c', scrollon='#9c9c9c', *arg, **kw) 85 | 86 | def add_scrollbar(self, pos, widget, *arg, **kw): 87 | return self.ui.add_scrollbar(pos, widget, bg='#212121', color='#8c8c8c', oncolor='#9c9c9c', *arg, **kw) 88 | 89 | def add_listbox(self, pos, *arg, **kw): 90 | return self.ui.add_listbox(pos, bg='#2a2a2a', fg='white', activebg='#3b78e7', sel='#465097', scrollbg='#212121', scrollcolor='#8c8c8c', scrollon='#9c9c9c', *arg, **kw) 91 | 92 | def add_canvas(self, pos, *arg, **kw): 93 | return self.ui.add_canvas(pos, outline='#8c8c8c', linew=1, scrollbg='#212121', scrollcolor='#8c8c8c', scrollon='#9c9c9c', *arg, **kw) 94 | 95 | def add_pipspager(self, pos, *arg, **kw): 96 | return self.ui.add_pipspager(pos, bg='#1e1e1e', fg='#8c8c8c', buttonfg='#9c9c9c', buttonbg='#212121', activefg='#d9d9d9', activebg='#212121', buttononfg='#d9d9d9', buttononbg='#212121', *arg, **kw) 97 | 98 | def add_notebook(self, pos, *arg, **kw): 99 | return self.ui.add_notebook(pos, color='#1e1e1e', fg='#d9d9d9', bg='#1e1e1e', activefg='#ffffff', activebg='#3c3c3c', onfg='#d9d9d9', onbg='#212121', scrollbg='#212121', scrollcolor='#8c8c8c', scrollon='#9c9c9c', *arg, **kw) 100 | 101 | def add_ratingbar(self, pos, *arg, **kw): 102 | return self.ui.add_ratingbar(pos, fg='#cfcfcf', bg='#1e1e1e', onfg='#3b78e7', onbg='#3b78e7', *arg, **kw) 103 | 104 | def add_radiobox(self, pos, *arg, **kw): 105 | return self.ui.add_radiobox(pos, fontfg='#d9d9d9', fg='#8c8c8c', bg='#2a2a2a', activefg='#9c9c9c', activebg='#2a2a2a', onfg='#3b78e7', onbg='#000000', *arg, **kw) 106 | 107 | def add_notecard(self, pos, *arg, **kw): 108 | return self.ui.add_notecard(pos, tfg='#d9d9d9', tbg='#2a2a2a', fg='#d9d9d9', bg='#212121', sep='#1d1d1d', *arg, **kw) 109 | 110 | def add_pivot(self, pos, *arg, **kw): 111 | return self.ui.add_pivot(pos, fg='#8c8c8c', bg='', activefg='#ffffff', activecolor='#3b78e7', *arg, **kw) 112 | 113 | def add_button2(self, pos, *arg, **kw): 114 | return self.ui.add_button2(pos, fg='#d9d9d9', bg='#2a2a2a', activefg='#ffffff', activebg='#3c3c3c', line='#424242', linew=1, activeline='#1e1e1e', onfg='#cecece', onbg='#212121', online='#424242', *arg, **kw) 115 | 116 | def add_expander(self, pos, *arg, **kw): 117 | return self.ui.add_expander(pos, tfg='#d9d9d9', tbg='#2a2a2a', bg='#212121', sep='#1d1d1d', buttonfg='#d9d9d9', buttonbg='#2a2a2a', buttonline='#2a2a2a', activefg='#ffffff', activebg='#3c3c3c', activeline='#3c3c3c', onfg='#d9d9d9', onbg='#232323', online='#3c3c3c', *arg, **kw) 118 | 119 | def add_waitframe(self, pos, *arg, **kw): 120 | return self.ui.add_waitframe(pos, fg='#2a2a2a', bg='#3c3c3c', *arg, **kw) 121 | 122 | def add_listview(self, pos, *arg, **kw): 123 | return self.ui.add_listview(pos, bg='#1e1e1e', activebg='#2a2a2a', oncolor='#3b78e7', scrobg='#212121', scroc='#8c8c8c', scrooc='#9c9c9c', *arg, **kw) 124 | 125 | def add_treeview(self, pos, *arg, **kw): 126 | return self.ui.add_treeview(pos, fg='#d9d9d9', bg='#1e1e1e', onfg='#d9d9d9', onbg='#2a2a2a', oncolor='#3b78e7', signcolor='#8c8c8c', *arg, **kw) 127 | 128 | def add_togglebutton(self, pos, *arg, **kw): 129 | return self.ui.add_togglebutton(pos, fg='#d9d9d9', bg='#2a2a2a', line='#424242', activefg='#000000', activebg='#3b78e7', activeline='#3b78e7', *arg, **kw) 130 | 131 | def add_swipecontrol(self, pos, *arg, **kw): 132 | return self.ui.add_swipecontrol(pos, fg='#d9d9d9', bg='#1e1e1e', line='#2a2a2a', data={'left':({'text':'✔️\nok','fg':'#000000','bg':'#a9a9a9','command':print},),'right':({'text':'❌\nclose'},)}, *arg, **kw) 133 | 134 | def add_picker(self, pos, *arg, **kw): 135 | return self.ui.add_picker(pos, fg='#cfcfcf', bg='#2a2a2a', outline='#424242', activefg='#ffffff', activebg='#3c3c3c', onfg='#000000', onbg='#3b78e7', buttonfg='#d9d9d9', buttonbg='#2a2a2a', buttonactivefg='#ffffff', buttonactivebg='#3c3c3c', *arg, **kw) 136 | 137 | def add_menubutton(self, pos, *arg, **kw): 138 | return self.ui.add_menubutton(pos, fg='#d9d9d9', bg='#2a2a2a', line='#424242', activefg='#ffffff', activebg='#3c3c3c', activeline='#1e1e1e', onfg='#cecece', onbg='#212121', online='#424242', menuonfg='#d9d9d9', menuonbg='#3c3c3c', menuonline='#3c3c3c', *arg, **kw) 139 | 140 | def add_barbutton(self, pos, *arg, **kw): 141 | return self.ui.add_barbutton(pos, fg='#d9d9d9', bg='#1e1e1e', line='#1e1e1e', activefg='#cecece', activebg='#2a2a2a', activeline='#2a2a2a', onfg='#cecece', onbg='#232323', online='#232323', sepcolor='#e5e5e5', *arg, **kw) 142 | 143 | def add_flyout(self, fid, *arg, **kw): 144 | return self.ui.add_flyout(fid, line='#b0b0b0', bg='#212121', *arg, **kw) 145 | 146 | -------------------------------------------------------------------------------- /theme/tinuimodernlight.py: -------------------------------------------------------------------------------- 1 | # 由chatglm-4生成,作者小改。作为范例,不会维护 2 | from typing import Union 3 | import sys 4 | try: 5 | from tinui import TinUI, BasicTinUI, TinUITheme 6 | except: 7 | sys.path.append('../') 8 | from TinUI import TinUI, BasicTinUI, TinUITheme 9 | 10 | 11 | class TinUIModernLight(TinUITheme): 12 | def __init__(self, ui: Union[TinUI, BasicTinUI]): 13 | super().__init__(ui, 'tinui-modern-light-theme') 14 | self.label = 'modern-light' 15 | self.ui['background'] = '#ffffff' 16 | 17 | def add_button(self, pos, *arg, **kw): 18 | return self.ui.add_button(pos, fg='#ffffff', bg='#007bff', 19 | activefg='#ffffff', activebg='#0056b3', 20 | line='#007bff', linew=1, activeline='#0056b3', 21 | *arg, **kw) 22 | 23 | def add_checkbutton(self, pos, *arg, **kw): 24 | return self.ui.add_checkbutton(pos, 25 | fontfg='#555555', fg='#555555', bg='#ffffff', 26 | activefg='#555555', activebg='#f0f0f0', 27 | onfg='#ffffff', onbg='#007bff', 28 | *arg, **kw) 29 | 30 | def add_label(self, pos, *arg, **kw): 31 | return self.ui.add_label(pos, fg='#333333', bg='#ffffff', 32 | outline='#ffffff', *arg, **kw) 33 | 34 | def add_entry(self, pos, *arg, **kw): 35 | return self.ui.add_entry(pos, fg='#333333', bg='#ffffff', 36 | activefg='#000000', activebg='#ffffff', 37 | line='#cccccc', activeline='#007bff', 38 | outline='#cccccc', onoutline='#007bff', 39 | insert='#000000', *arg, **kw) 40 | 41 | def add_separate(self, pos, *arg, **kw): 42 | return self.ui.add_separate(pos, fg='#e6e6e6', *arg, **kw) 43 | 44 | def add_radiobutton(self, pos, *arg, **kw): 45 | return self.ui.add_radiobutton(pos, 46 | fg='#333333', bg='#ffffff', 47 | activefg='#000000', activebg='#f0f0f0', 48 | *arg, **kw) 49 | 50 | def add_link(self, pos, *arg, **kw): 51 | return self.ui.add_link(pos, fg='#007bff', 52 | activefg='red', activebg='#eaeaea', 53 | *arg, **kw) 54 | 55 | def add_waitbar1(self, pos, *arg, **kw): 56 | return self.ui.add_waitbar1(pos, fg='#007bff', 57 | bg='#ffffff', okfg='#007bff', bd=5, 58 | *arg, **kw) 59 | 60 | def add_labelframe(self, uids: tuple, *arg, **kw): 61 | return self.ui.add_labelframe(uids, fg='#333333', bg='#ffffff', 62 | *arg, **kw) 63 | 64 | def add_waitbar2(self, pos, *arg, **kw): 65 | return self.ui.add_waitbar2(pos, 66 | fg='#007bff', bg='#ffffff', okcolor='#0f7b0f', 67 | *arg, **kw) 68 | 69 | def add_combobox(self, pos, *arg, **kw): 70 | return self.ui.add_combobox(pos, 71 | fg='#333333', bg='#ffffff', 72 | activefg='#333333', activebg='#ededee', 73 | *arg, **kw) 74 | 75 | def add_progressbar(self, pos, *arg, **kw): 76 | return self.ui.add_progressbar(pos, 77 | fg='#555555', bg='#007bff', back='#ffffff', 78 | fontc='#79b8f8', *arg, **kw) 79 | 80 | def add_table(self, pos, *arg, **kw): 81 | return self.ui.add_table(pos, 82 | outline='#dadad8', fg='black', bg='white', 83 | headbg='#f4f4f2', *arg, **kw) 84 | 85 | def add_onoff(self, pos, *arg, **kw): 86 | return self.ui.add_onoff(pos, 87 | fg='#5a5a5a', bg='#ededed', 88 | onfg='#ffffff', onbg='#007bff', 89 | *arg, **kw) 90 | 91 | def add_spinbox(self, pos, *arg, **kw): 92 | return self.ui.add_spinbox(pos, 93 | fg='#333333', bg='#fefefe', line='#e5e5e5', 94 | activefg='#333333', activebg='#fafafa', 95 | onfg='#555555', onbg='#f3f3f3', 96 | boxfg='#5f5f5f', boxbg='#f9f9f9', 97 | boxactivefg='#5b5b5b', boxactivebg='#f0f0f0', 98 | *arg, **kw) 99 | 100 | def add_scalebar(self, pos, *arg, **kw): 101 | return self.ui.add_scalebar(pos, 102 | fg='#3b50ba', bg='#555555', activefg='#3b50ba', 103 | buttonbg='#ffffff', buttonoutline='#cccccc', 104 | *arg, **kw) 105 | 106 | def add_info(self, pos, *arg, **kw): 107 | return self.ui.add_info(pos, 108 | fg='#007bff', bg='#f9f9f9', info_fg='#333333', 109 | *arg, **kw) 110 | 111 | def add_menubar(self, uid, *arg, **kw): 112 | return self.ui.add_menubar(uid, 113 | fg='#333333', bg='#ffffff', line='#e6e6e6', 114 | activefg='#000000', activebg='#f0f0f0', activeline='#f0f0f0', 115 | *arg, **kw) 116 | 117 | def add_tooltip(self, uid, *arg, **kw): 118 | return self.ui.add_tooltip(uid, fg='#333333', bg='#efefef', 119 | *arg, **kw) 120 | 121 | def add_waitbar3(self, pos, *arg, **kw): 122 | return self.ui.add_waitbar3(pos, 123 | fg='#007bff', bg='#ffffff', okcolor='#007bff', 124 | *arg, **kw) 125 | 126 | def add_textbox(self, pos, *arg, **kw): 127 | return self.ui.add_textbox(pos, fg='#333333', bg='white', 128 | outline='#cccccc', onoutline='#007bff', 129 | scrollbg='#f9f9f9', scrollcolor='#cccccc', scrollon='#cccccc', 130 | *arg, **kw) 131 | 132 | def add_scrollbar(self, pos, widget, *arg, **kw): 133 | return self.ui.add_scrollbar(pos, widget, 134 | bg='#f9f9f9', color='#cccccc', 135 | oncolor='#aaaaaa', *arg, **kw) 136 | 137 | def add_listbox(self, pos, *arg, **kw): 138 | return self.ui.add_listbox(pos, 139 | bg='#ffffff', fg='black', activebg='#f0f0f0', sel='#007bff', 140 | scrollbg='#f9f9f9', scrollcolor='#cccccc', scrollon='#cccccc', 141 | *arg, **kw) 142 | 143 | def add_canvas(self, pos, *arg, **kw): 144 | return self.ui.add_canvas(pos, 145 | outline='#cccccc', linew=1, 146 | scrollbg='#f9f9f9', scrollcolor='#cccccc', scrollon='#cccccc', 147 | *arg, **kw) 148 | 149 | def add_pipspager(self, pos, *arg, **kw): 150 | return self.ui.add_pipspager(pos, 151 | bg='#ffffff', fg='#555555', 152 | buttonfg='#555555', buttonbg='#f9f9f9', 153 | activefg='#333333', activebg='#f9f9f9', 154 | buttononfg='#333333', buttononbg='#f9f9f9', 155 | *arg, **kw) 156 | 157 | def add_notebook(self, pos, *arg, **kw): 158 | return self.ui.add_notebook(pos, 159 | color='#ffffff', fg='#555555', bg='#ffffff', 160 | activefg='#333333', activebg='#f0f0f0', 161 | onfg='#333333', onbg='#f9f9f9', 162 | scrollbg='#f9f9f9', scrollcolor='#cccccc', scrollon='#cccccc', 163 | *arg, **kw) 164 | 165 | def add_radiobox(self, pos, *arg, **kw): 166 | return self.ui.add_radiobox(pos, 167 | fontfg='black', fg='#555555', bg='#ffffff', 168 | activefg='#333333', activebg='#f0f0f0', 169 | onfg='#007bff', onbg='#ffffff', 170 | *arg, **kw) 171 | 172 | def add_ratingbar(self, pos, *arg, **kw): 173 | return self.ui.add_ratingbar(pos, 174 | fg='#555555', bg='#ffffff', 175 | onfg='#007bff', onbg='#007bff', 176 | *arg, **kw) 177 | 178 | def add_notecard(self, pos, *arg, **kw): 179 | return self.ui.add_notecard(pos, 180 | tfg='#333333', tbg='#fbfbfb', fg='#333333', 181 | bg='#f4f4f4', sep='#e5e5e5', 182 | *arg, **kw) 183 | 184 | def add_pivot(self, pos, *arg, **kw): 185 | return self.ui.add_pivot(pos, 186 | fg='#555555', bg='', 187 | activefg='#000000', activecolor='#007bff', 188 | *arg, **kw) 189 | 190 | def add_button2(self, pos, *arg, **kw): 191 | return self.ui.add_button2(pos, fg='#333333', bg='#ffffff', 192 | activefg='#000000', activebg='#f0f0f0', 193 | line='#cccccc', linew=1, activeline='#cccccc', 194 | onfg='#555555', onbg='#f5f5f5', online='#e5e5e5', 195 | *arg, **kw) 196 | 197 | def add_expander(self, pos, *arg, **kw): 198 | return self.ui.add_expander(pos, 199 | tfg='#333333', tbg='#ffffff', 200 | bg='#f4f4f4', sep='#e5e5e5', 201 | buttonfg='#333333', buttonbg='#ffffff', buttonline='#ffffff', 202 | activefg='#000000', activebg='#f0f0f0', activeline='#f0f0f0', 203 | onfg='#555555', onbg='#f5f5f5', online='#e5e5e5', 204 | *arg, **kw) 205 | 206 | def add_waitframe(self, pos, *arg, **kw): 207 | return self.ui.add_waitframe(pos, 208 | fg='#ffffff', bg='#f6f6f6', 209 | *arg, **kw) 210 | 211 | def add_listview(self, pos, *arg, **kw): 212 | return self.ui.add_listview(pos, 213 | bg='#ffffff', activebg='#f0f0f0', oncolor='#007bff', 214 | scrobg='#f8f8f8', scroc='#cccccc', scrooc='#aaaaaa', 215 | *arg, **kw) 216 | 217 | def add_treeview(self, pos, *arg, **kw): 218 | return self.ui.add_treeview(pos, 219 | fg='#333333', bg='#ffffff', 220 | onfg='#333333', onbg='#f0f0f0', 221 | oncolor='#007bff', signcolor='#aaaaaa', 222 | *arg, **kw) 223 | 224 | def add_togglebutton(self, pos, *arg, **kw): 225 | return self.ui.add_togglebutton(pos, 226 | fg='#333333', bg='#ffffff', line='#cccccc', 227 | activefg='#f3f4fd', activebg='#007bff', activeline='#5360de', 228 | *arg, **kw) 229 | 230 | def add_swipecontrol(self, pos, *arg, **kw): 231 | return self.ui.add_swipecontrol(pos, 232 | fg='#333333', bg='#ffffff', line='#ffffff', 233 | data={'left':({'text':'✔️\nok','fg':'#202020','bg':'#bcbcbc','command':print},), 234 | 'right':({'text':'❌\nclose'},)}, 235 | *arg, **kw) 236 | 237 | def add_picker(self, pos, *arg, **kw): 238 | return self.ui.add_picker(pos, 239 | fg='#333333', bg='#ffffff', 240 | outline='#ececec', activefg='#333333', 241 | activebg='#f0f0f0', onfg='#eaecfb', onbg='#007bff', 242 | buttonfg='#333333', buttonbg='#ffffff', 243 | buttonactivefg='#333333', buttonactivebg='#f0f0f0', 244 | *arg, **kw) 245 | 246 | def add_menubutton(self, pos, *arg, **kw): 247 | return self.ui.add_menubutton(pos, 248 | fg='#333333', bg='#ffffff', line='#cccccc', 249 | activefg='#000000', activebg='#f0f0f0', activeline='#cccccc', 250 | onfg='#555555', onbg='#f5f5f5', online='#e5e5e5', 251 | menuonfg='#000000', menuonbg='#f0f0f0', menuonline='#f0f0f0', 252 | *arg, **kw) 253 | 254 | def add_barbutton(self, pos, *arg, **kw): 255 | return self.ui.add_barbutton(pos, 256 | fg='#666666', bg='#ffffff', line='#ffffff', 257 | activefg='#000000', activebg='#f0f0f0', activeline='#f0f0f0', 258 | onfg='#555555', onbg='#ededed', online='#ededed', sepcolor='#e5e5e5', 259 | *arg, **kw) 260 | 261 | def add_flyout(self, fid, *arg, **kw): 262 | return self.ui.add_flyout(fid, 263 | line='#e6e6e6', bg='#ffffff', 264 | *arg, **kw) 265 | -------------------------------------------------------------------------------- /theme/window.py: -------------------------------------------------------------------------------- 1 | import sys 2 | sys.path.append('..') 3 | from TinUI import * 4 | 5 | from tkinter import Tk 6 | from tkinter.ttk import Button 7 | 8 | 9 | class win: 10 | def __init__(self): 11 | self.r=Tk() 12 | self.r.geometry('500x500+10+10') 13 | self.u=TinUI(self.r)#,bg='#01FF11') 14 | self.u.pack(fill='both',expand=True) 15 | #gomap=((10,0),(460,0),(460,450),(10,450),(10,0)) 16 | #self.u.create_polygon(gomap,fill='#f0f0f0',outline='#f0f0f0',width=15) 17 | #self.r.attributes('-transparent','#01FF11') 18 | Button(self.r,text='上一页(ctrl+U)',command=self.upit).pack() 19 | Button(self.r,text='下一页(ctrl+D)',command=self.downit).pack() 20 | self.r.bind('',self.upit) 21 | self.r.bind('',self.downit) 22 | def go(self): 23 | self.r.mainloop() 24 | def upit(self,*e): 25 | self.u.yview("scroll", -1, "pages") 26 | def downit(self,*e): 27 | self.u.yview("scroll", 1, "pages") 28 | 29 | 30 | if __name__=='__main__': 31 | root=win() 32 | root.go() 33 | --------------------------------------------------------------------------------