slint-ui / slint

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

Border around ScrollView native widget #824

Closed jrmoulton closed 9 months ago

jrmoulton commented 2 years ago

https://github.com/sixtyfpsui/sixtyfps/blob/ce7a13b70d0a4be183626a234834251e62046589/sixtyfps_runtime/rendering_backends/qt/qt_widgets/scrollview.rs#L270

This section of code and it's references create a black border around a ScrollView that becomes obvious and distracting and non-removable when it's x or y are set inside the window. Why does this border exist? If I delete this section of code and its references everything compiles fine and the ScrollView looks much better in my opinion without the distracting border. Why is that border created by default?

jrmoulton commented 2 years ago
Screen Shot 2022-01-09 at 10 05 18 PM

vs.

Screen Shot 2022-01-09 at 10 05 05 PM
ogoffart commented 2 years ago

It depends on the QStyle used. For some QStyle it might be required. But there is definitively something wrong. Looks like we should draw this differently. As this is a problem for this style. What desktop environment are you using? Is that Gnome? Do you know if Qt is using the GTK style? Is it Qt5 or Qt6 ?

jrmoulton commented 2 years ago

I'm currently on macOS and I'm running Qt6

dilawar commented 2 years ago

I also agree with @jrmoulton. I also don't like border around ScrollView and ListView. Is there a simple way to disable the border? I am on Windows + Rust, and using defaults.

image

dilawar commented 2 years ago

Setting border-width : 0px for ScrollView removed the border for me. I feel dumb for not trying the first obvious thing before commenting here 😳.

ogoffart commented 1 year ago

Perhaps this is related to https://github.com/slint-ui/slint/issues/686 ?

tronical commented 9 months ago

As discussed with Florian, this does not seem relevant anymore - with QStyle not being used on macOS and Windows anymore, and the ability to set the border-width manually.