#4375·slint

react has-hover of TouchArea for both children and parent element

Author: wuanzhuanCreated Jan 18, 2024Updated Sep 17, 2026
Labelsa:runtime

how can i set the row_element's has-hover by TableViewCell's has-hover. Only the TableViewCell has the TouchArea. I need handle hover event for both some TableViewCells and one TableViewRow. the TableViewCell is a child element of TableViewRow. i try the <=> binding ,it can't work.

i-scroll-view := ListView {
    for row[idx] in root.rows : row_element := TableViewRow {
        selected: idx == root.current-row;
        even: mod(idx, 2) == 0;
        has-hover: ;

        // order number
        if has-order-number : TableViewCell {
            width: root.order-column-width;
            text: idx;
            index-row: idx;
            index-column: 0;
            horizontal-alignment: center;

            pointer-event(pe, pos) => {
                root.row-pointer-event(idx, pe, {
                    x: pos.x - root.absolute-position.x,
                    y: pos.y - root.absolute-position.y,
                });
            }

            clicked => {
                root.focus();
                root.set-current-row(idx);
            }

        }
        for cell[index] in row : TableViewCell {
            horizontal-stretch: root.columns[index].horizontal-stretch;
            width: root.columns[index].width;
            text: cell.text;
            index-row: idx;
            index-column: index + 1;
            horizontal-alignment: left;


            pointer-event(pe, pos) => {
                root.row-pointer-event(idx, pe, {
                    x: pos.x - root.absolute-position.x,
                    y: pos.y - root.absolute-position.y,
                });
            }

            clicked => {
                root.focus();
                root.set-current-row(idx);
            }
        }
    }
}