Skip to content

Add linking the navigation bar with the content example #7746

Answered by hunger
zhuyu4839 asked this question in Q&A
Discussion options

You must be logged in to vote

With a bit of math :-)

You can get the y position of red, green and blue Rectangles and calculate the value when to show any of those from that (taking the viewport width and height into account).

If you have a dynamic number of Elements in the layout you probably need something a bit more scalable. Maybe along these lines?

import { Button, HorizontalBox, ScrollView, AboutSlint } from "std-widgets.slint";

component ColorFeedback inherits Rectangle {
    preferred-width: 200px;
    height: self.width / 2;

    in property <length> marker;
    // Ugly workaround to #7747 :-/
    private property <length> dummy: marker;

    callback update-color(color: color);

    changed dummy => {
        

Replies: 2 comments 10 replies

Comment options

You must be logged in to vote
3 replies
@zhuyu4839
Comment options

@hunger
Comment options

hunger Mar 10, 2025
Collaborator

@zhuyu4839
Comment options

Comment options

You must be logged in to vote
7 replies
@zhuyu4839
Comment options

@hunger
Comment options

hunger Mar 13, 2025
Collaborator

Answer selected by zhuyu4839
@zhuyu4839
Comment options

@hunger
Comment options

hunger Mar 14, 2025
Collaborator

@zhuyu4839
Comment options

@hunger
Comment options

hunger Mar 14, 2025
Collaborator

# for free to join this conversation on GitHub. Already have an account? # to comment
Category
Q&A
Labels
None yet
2 participants