slint
slint copied to clipboard
Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
Working on tweaking animations that use animation-tick() is painful as the refresh button doesn't reset the value from animation-tick(). Instead I had to restart the LSP which also kills the...
Word and paragraph selection by double and triple clicks doen't work for `TextInput` placed inside `Flickable`. Simple example: ```slint Flickable { width: parent.width; viewport-width: txt.preferred-width; txt:=TextInput { text: "Some text...
`max-width` and `max-height` of a `component` inheriting `Window` are `340282350000000000000000000000000000000`. But, at least on Windows 10, windows can maximally be resized manually to about the size of the [virtual screen](https://learn.microsoft.com/en-us/windows/win32/gdi/the-virtual-screen)....
Under certain circumstances, `Dialog` buttons are stretched, which should never happen, because it looks awful ([SlintPad](https://slintpad.com/?snippet=import+%7B+Button%2C+VerticalBox+%7D+from+%22std-widgets.slint%22%3B%0A%0Aexport+component+UserAgreement+inherits+Dialog+%7B%0A++++VerticalBox+%7B%0A++++++++alignment%3A+start%3B%0A%0A++++++++Text+%7B%0A++++++++++++text%3A+%22Lorem+ipsum+dolor+sit+amet%2C%5Cnconsetetur+sadipscing+elitr%5Cn...%22%3B%0A++++++++%7D%0A++++%7D%0A%0A++++Button+%7B%0A++++++++text%3A+%22I+Agree%22%3B%0A++++++++dialog-button-role%3A+accept%3B%0A++++%7D%0A%0A++++Button+%7B%0A++++++++text%3A+%22Quit%22%3B%0A++++++++dialog-button-role%3A+reject%3B%0A++++%7D%0A%7D%0A&style=native)): ```slint import { Button, VerticalBox } from "std-widgets.slint"; export component UserAgreement inherits Dialog {...
There can be cases where the existence of `Dialog` buttons depends on conditions ([SlintPad](https://slintpad.com/?snippet=import+%7B+Button%2C+VerticalBox+%7D+from+%22std-widgets.slint%22%3B%0A%0Aexport+component+UserAgreement+inherits+Dialog+%7B%0A++++%2F%2F+%60false%60+means+initial+agreement+is+necessary+to+run+the+software.%0A++++%2F%2F+The+dialog+can+then+later+be+used+with+%60true%60+for+informational+purposes.%0A++++in+property+%3Cbool%3E+did-confirm%3B%0A%0A++++VerticalBox+%7B%0A++++++++alignment%3A+start%3B%0A%0A++++++++Text+%7B%0A++++++++++++text%3A+%22Lorem+ipsum+dolor+sit+amet%22%3B%0A++++++++%7D%0A++++%7D%0A%0A++++Button+%7B%0A++++++++text%3A+root.did-confirm+%3F+%22Close%22+%3A+%22I+Agree%22%3B%0A++++++++dialog-button-role%3A+accept%3B%0A++++%7D%0A%0A++++if+%21root.did-confirm+%3A+Button+%7B%0A++++++++text%3A+%22Quit%22%3B%0A++++++++dialog-button-role%3A+reject%3B%0A++++%7D%0A%7D%0A&style=native)): ```slint import { Button, VerticalBox } from "std-widgets.slint"; export component UserAgreement inherits Dialog { // `false`...
See this [example](https://slintpad.com/?snippet=import+%7B+Button+%7D+from+%22std-widgets.slint%22%3B%0Aexport+component+Demo+%7B%0A++++width%3A+400px%3B%0A++++height%3A+400px%3B%0A++++Rectangle+%7B%0A++++++++background%3A+white%3B%0A++++%7D%0A%0A++++Rectangle+%7B%0A++++++++width%3A+b.width%3B%0A++++++++height%3A+b.height%3B%0A++++++++x%3A+b.x%3B%0A++++++++y%3A+b.y%3B%0A++++++++background%3A+darkgray%3B%0A++++%7D%0A%0A++++b+%3A%3D+Button+%7B%0A++++++++x%3A+10px%3B%0A++++++++y%3A+10px%3B%0A++++++++text%3A+%22Toggle+Touch%3A+%22+%2B+%28ta.enabled+%3F+%22on%22+%3A+%22off%22%29%3B%0A++++++++clicked+%3D%3E+%7B%0A++++++++++++ta.enabled+%3D+%21ta.enabled%3B%0A++++++++%7D%0A++++%7D%0A%0A++++sgh+%3A%3D+SwipeGestureHandler+%7B%0A++++++++width%3A+60%25%3B%0A++++++++height%3A+60%25%3B%0A++++++++Rectangle+%7B%0A++++++++++++background%3A+yellow%3B%0A++++++++%7D%0A++++++++handle-swipe-down%3A+true%3B%0A++++++++handle-swipe-up%3A+true%3B%0A++++++++handle-swipe-left%3A+true%3B%0A++++++++handle-swipe-right%3A+true%3B%0A++++++++ta+%3A%3D+TouchArea+%7B%0A++++++++++++%0A++++++++%7D%0A++++%7D%0A%0A++++Text+%7B%0A++++++++color%3A+black%3B%0A++++++++text%3A+%22swiping%3A+%22+%2B+%28sgh.swiping+%3F+%22true%22+%3A+%22false%22%29%3B%0A++++%7D%0A%7D%0A&style=native) When working on the side bar for a recent demo it was noticed that it was a lot easier to get the swipe to work when there...
Load up this [example](https://slintpad.com/?snippet=export+component+Demo+%7B%0A++++width%3A+400px%3B%0A++++height%3A+400px%3B%0A++++Rectangle+%7B%0A++++++++background%3A+white%3B%0A++++%7D%0A%0A++++sgh+%3A%3D+SwipeGestureHandler+%7B%0A++++++++width%3A+60%25%3B%0A++++++++height%3A+60%25%3B%0A++++++++Rectangle+%7B%0A++++++++++++background%3A+yellow%3B%0A++++++++%7D%0A++++++++handle-swipe-down%3A+true%3B%0A++++++++handle-swipe-up%3A+true%3B%0A++++++++handle-swipe-left%3A+true%3B%0A++++++++handle-swipe-right%3A+true%3B%0A++++%7D%0A%0A++++Text+%7B%0A++++++++color%3A+black%3B%0A++++++++text%3A+%22swiping%3A+%22+%2B+%28sgh.swiping+%3F+%22true%22+%3A+%22false%22%29%3B%0A++++%7D%0A%7D%0A&style=native) Start a swipe inside the yellow area and swipe all the way till the mouse in in the white part of the screen. This cancels the...
Consider [this SlintPad demo](https://slintpad.com/?snippet=import+%7B+Button+%7D+from+%22std-widgets.slint%22%3B%0A%0Aexport+component+Demo+%7B%0A++++preferred-width%3A+500px%3B%0A++++preferred-height%3A+500px%3B%0A%0A++++Button+%7B%0A++++++++%2F%2F+Commenting+this+property+out%2C+or+making+it+an+empty%0A++++++++%2F%2F+string+makes+the+component+tiny+and+unresizable.%0A++++++++text%3A+%22Foo%22%3B%0A++++%7D%0A%7D%0A&style=native) (see comment): ```slint import { Button } from "std-widgets.slint"; export component Demo { preferred-width: 500px; preferred-height: 500px; Button { // Commenting this property out, or making...
OS: Android 14, Pixel 8, Google Source: https://github.com/beac0n/slint-debug `x doctor` output: ``` > $ x doctor [±main ●] --------------------clang/llvm toolchain-------------------- clang 18.1.8 /sbin/clang clang++ 18.1.8 /sbin/clang++ llvm-ar unknown /sbin/llvm-ar llvm-lib...
thread 'main' panicked at /Users/runner/work/slint/slint/internal/core/model.rs:929:38: already borrowed: BorrowMutError stack backtrace: 0: 0x10558959c - ::fmt::h243268f17d714c7f 1: 0x104e70a9c - core::fmt::write::hb3cfb8a30e72d7ff 2: 0x1055630cc - std::io::Write::write_fmt::hfb2314975de9ecf1 3: 0x10558d5cc - std::panicking::default_hook::{{closure}}::h14c7718ccf39d316 4: 0x10558d01c - std::panicking::default_hook::hc62e60da3be2f352...