Slint 1.17 Released
Slint 1.17 Released
Slint 1.17 版本发布
June 24, 2026 by Slint Developers 2026年6月24日,由 Slint 开发团队发布
We’re happy to announce Slint 1.17, another big step toward making Slint desktop-ready. This release brings drag and drop, system tray icons, tooltips, and two-way bindings on model rows. Slint is a toolkit written in Rust, with APIs for Rust, C++, JavaScript, and Python, for building native user interfaces for desktop, embedded, and mobile applications. 我们很高兴地宣布 Slint 1.17 的发布,这是 Slint 向桌面级应用迈出的又一大步。此版本带来了拖放功能、系统托盘图标、工具提示以及模型行(model rows)的双向绑定。Slint 是一个用 Rust 编写的工具包,提供 Rust、C++、JavaScript 和 Python API,用于为桌面、嵌入式和移动应用程序构建原生用户界面。
Making Slint Desktop-Ready
让 Slint 具备桌面级能力
Back in November we laid out a plan to make Slint desktop-ready. With 1.17 we’re checking off four more boxes from that list: 早在去年 11 月,我们就制定了让 Slint 具备桌面级能力的计划。随着 1.17 版本的发布,我们又完成了该列表中的四项任务:
- single-window drag and drop
- 单窗口拖放
- system tray icons
- 系统托盘图标
- tooltips as a built-in widget
- 作为内置组件的工具提示
- two-way bindings on model rows
- 模型行的双向绑定
Work on drag and drop, system tray icons, and tooltips was funded by NLnet as part of the Slintify LibrePCB project. We’re very grateful for their support. 拖放、系统托盘图标和工具提示的开发工作由 NLnet 作为 Slintify LibrePCB 项目的一部分资助。我们非常感谢他们的支持。
Drag and Drop
拖放功能
You can now add drag and drop interactions to your Slint apps. Try the kanban demo live in your browser. A DragArea marks the source of a drag, a DropArea marks the target, and the payload is an opaque data-transfer value that you construct and read in your host language.
现在,您可以为 Slint 应用程序添加拖放交互功能。您可以在浏览器中在线体验看板(kanban)演示。DragArea 标记拖拽源,DropArea 标记目标,而有效载荷(payload)是一个不透明的数据传输值,您可以在宿主语言中构建和读取它。
(Code block omitted for brevity)
can-drop runs while the drag hovers and returns a DragAction that drives the cursor and any visual feedback; dropped runs on release and confirms the action. A DragArea declares which actions it allows and reacts to the result through drag-finished. See the drag and drop guide for the full picture.
当拖拽悬停时,can-drop 会运行并返回一个 DragAction,用于驱动光标和任何视觉反馈;dropped 在释放时运行并确认操作。DragArea 声明了它允许的操作,并通过 drag-finished 对结果做出反应。详情请参阅拖放指南。
In this release, drag and drop works within the application. Dragging to other applications and receiving drops from them is in development upstream in winit. 在此版本中,拖放功能仅在应用程序内部生效。拖拽到其他应用程序以及从其他应用程序接收拖放的功能目前正在 winit 上游开发中。
System Tray Icons
系统托盘图标
Run a quiet background app, display status updates, or expose a quick-action menu from the system tray with the new SystemTrayIcon element:
通过新的 SystemTrayIcon 元素,您可以运行静默后台应用、显示状态更新,或从系统托盘中调出快捷操作菜单:
(Code block omitted for brevity)
The same SystemTrayIcon works on macOS, Windows, and Linux. The clip above shows it on Windows.
同一个 SystemTrayIcon 可在 macOS、Windows 和 Linux 上运行。上面的剪辑展示了它在 Windows 上的效果。
Tooltips and Radio Groups
工具提示与单选按钮组
Two new widgets that show up everywhere in a real desktop app. Add a tooltip to any element with the new Tooltip element:
这是两个在真实桌面应用中随处可见的新组件。使用新的 Tooltip 元素为任何组件添加工具提示:
(Code block omitted for brevity)
And bundle a set of radio buttons with RadioGroup, which manages selection and keyboard navigation for you:
并使用 RadioGroup 捆绑一组单选按钮,它会自动为您管理选择和键盘导航:
(Code block omitted for brevity)
Other Changes
其他更改
Additional items worth highlighting: 其他值得关注的更新:
-
MCP server for AI assistants: a Slint application can now embed a Model Context Protocol server. Once connected, an assistant can inspect a running application through its accessibility tree, drive the UI by injecting mouse, touch, and keyboard input, and capture screenshots to reason about the result. We also ship skills and plugins that teach AI coding assistants how to write Slint code; see the AI coding assistants guide to set them up.
-
AI 助手 MCP 服务器:Slint 应用程序现在可以嵌入模型上下文协议(Model Context Protocol)服务器。连接后,助手可以通过辅助功能树检查正在运行的应用程序,通过注入鼠标、触摸和键盘输入来驱动 UI,并捕获屏幕截图以分析结果。我们还提供了教 AI 编程助手如何编写 Slint 代码的技能和插件;请参阅 AI 编程助手指南进行设置。
-
Remote Slint viewer: a new
--remoteflag connectsslint-viewerto a Slint LSP running on another machine and renders the design locally, so you can edit a .slint file on your desktop and watch the result on a phone or tablet as you type. The viewer is in beta for Android on Google Play (or grab the APK), and for iOS through TestFlight while the App Store review is underway. -
远程 Slint 查看器:新的
--remote标志可以将slint-viewer连接到运行在另一台机器上的 Slint LSP,并在本地渲染设计。这样您可以在桌面上编辑 .slint 文件,并在输入时在手机或平板电脑上查看结果。该查看器目前在 Google Play 上提供 Android 测试版(或获取 APK),iOS 版本正在通过 TestFlight 进行测试,同时等待 App Store 审核。 -
Two-way bindings on model rows: following the two-way bindings on struct fields from Slint 1.15, you can now bind directly to model row data with
text <=> item.name, editing a row in place without bouncing through a callback to write the change back. -
模型行双向绑定:继 Slint 1.15 引入结构体字段双向绑定后,现在您可以直接使用
text <=> item.name绑定到模型行数据,从而原地编辑行,无需通过回调函数回写更改。 -
Cross-axis alignment on layouts: align children along the cross axis with the new
cross-axis-alignmentproperty onVerticalLayoutandHorizontalLayout(#2587). -
布局的交叉轴对齐:通过
VerticalLayout和HorizontalLayout上新的cross-axis-alignment属性,可以沿交叉轴对齐子组件 (#2587)。 -
A faster Node.js port: on Linux and macOS, Slint now ties its event loop to the libuv file descriptor that Node already polls, so the UI no longer wakes on a timer and idle CPU usage drops to near zero (Windows is still pending). A dedicated blog post on these changes is coming soon.
-
更快的 Node.js 移植:在 Linux 和 macOS 上,Slint 现在将其事件循环绑定到 Node 已经在轮询的 libuv 文件描述符上,因此 UI 不再通过定时器唤醒,空闲 CPU 使用率降至接近零(Windows 支持尚在开发中)。关于这些更改的专题博客文章即将发布。
-
C++ on Android: you can now build Slint apps for Android from a C++ codebase. See the Android guide to get started.
-
Android 上的 C++ 支持:现在您可以从 C++ 代码库构建 Android 版 Slint 应用程序。请参阅 Android 指南开始使用。
-
Markdown parsing in native code: the
StyledTextAPI in Rust, C++, JavaScript, and Python now parses markdown at runtime, so you can construct styled text from data your app loads at runtime, not just from .slint literals. -
原生代码中的 Markdown 解析:Rust、C++、JavaScript 和 Python 中的
StyledTextAPI 现在可以在运行时解析 Markdown,因此您可以从应用程序在运行时加载的数据中构建样式文本,而不仅仅是从 .slint 字面量中构建。 -
Drop-shadow improvements: we added
drop-shadow-spreadand a full set ofinner-shadow-*properties toRectangle(Skia only). -
投影改进:我们为
Rectangle添加了drop-shadow-spread和全套inner-shadow-*属性(仅限 Skia 后端)。
For the full picture, see the ChangeLog. 欲了解完整信息,请参阅 更新日志。
Getting Started with Slint 1.17
开始使用 Slint 1.17
- New to Slint? Start here: Get Started
- 新手?从这里开始:入门指南
- Upgrading? Follow the steps on our GitHub release page
- 升级?请按照我们 GitHub 发布页面 上的步骤操作
- Browse the latest docs at https://docs.slint.dev
- 浏览最新文档:https://docs.slint.dev
Don’t forget to star us on GitHub, join our Mattermost chat, and share your projects. 别忘了在 GitHub 上为我们点赞(Star),加入我们的 Mattermost 聊天室,并分享您的项目。
Thanks
感谢
Big thanks to everyone who contributed code, fixes, or feedback. You help us make Slint better with every release. 非常感谢所有贡献代码、修复问题或提供反馈的人。你们的帮助让 Slint 在每一次发布中都变得更好。
(List of contributors omitted)