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.64k stars 607 forks source link

live-preview: Popup a list of eleemnts at a position when right-clicking on select-mode #6800

Closed hunger closed 2 days ago

hunger commented 6 days ago

This PR adds a new popup that shows when right clicking somewhere in the preview area in select-mode.

It has a list of all the elements at that position with a little bit of extra information and you can select any of them by clicking on them.

Screenshot From 2024-11-15 17-26-25

hunger commented 6 days ago

I am not yet completely happy with this PR, but it is starting to come together.

The popup size and popup location can still use improvement and the scrolling is erratic at times...

I also need to shorten the file names this thing shows :-)

But as a side-effect: This PR has caused some selection bugs to be fixed already and includes a bit of fine-tuning of the selection.

hunger commented 6 days ago

We really need to improve the popup more:-/

tronical commented 3 days ago

I also need to shorten the file names this thing shows :-)

Suggestion: strip the common prefix for all paths. And in the future, preserve library mappings (and exclude from stripping).

hunger commented 3 days ago

@simon: "Zwei Dumme ein Gedanke" :-)

szecket commented 3 days ago

image

has turned into image

it appears the name := assigned to the component was lost

also, the top item here is supposed to be in the controls_page.slint but isn't image

hunger commented 2 days ago

@szecket: I was wondering how long you would take to spot this:-)

I need the frames to all have the same height all the calculations are off.

szecket commented 2 days ago

can you be more specific about "the frames"? the preview or the container for all the info for each selectable item?

hunger commented 2 days ago

@szecket: The element I add into the list view that gets added in the for loop. The file name was (conditionally) above the Rectangle which all preview and the text fields with extra information.

szecket commented 2 days ago

with our changes, this looks quite good!