slint-ui / slint

Slint is a declarative GUI toolkit to build native user interfaces for Rust, C++, or JavaScript apps.
https://slint.dev
Other
16.94k stars 568 forks source link

LSP Previewer UI Todos #3558

Closed hunger closed 8 months ago

hunger commented 12 months ago

MVP in feature/lsp_preview_ui

In general

ogoffart commented 12 months ago

Add a background of the right color behind the ComponentContainer

This is https://github.com/slint-ui/slint/issues/3117 : the Window doesn't print its own background when used as a child. To fix it we could either:

Allow changing the size of the preview area (by mouse;-)

If you want inspiration for Sub window in slint code, have a look at the fancy_demo

https://slintpad.com/preview?load_url=https://raw.githubusercontent.com/slint-ui/slint/master/examples/fancy_demo/main.slint


Reply from @hunger:

This is https://github.com/slint-ui/slint/issues/3117 : the Window doesn't print its own background when used as a child.

I edited the text to reflect this.

To fix it we could either: [...]

I was thinking of hacking this by having the ComponentContainer look at its root element. When it can downcast it to a Window element, it can grab the style metrics from the globals and render a rectangle in the background. This may of course not work :-)

hunger commented 12 months ago

Oh, sorry, I did not mean to edit your text:-/

hunger commented 8 months ago

Done and merged!