add selection callback to channel list UI (& fix deselect)

CrepeGoat
Oct 12, 2024, 3:33 AM
M5HBKVCED5GY7KC3AOMORMSD75BETBJP53UCDYDHMJINRPGO6GVQC

Dependencies

  • [2] VU6Z6IPY made channel entries interactable
  • [3] G2CHQAOP parsed `pijul log` text blob into individual entries & fields
  • [4] 337EO2TU add selection callback to changelog UI (& fix deselection)
  • [5] ZGSCV5DI split channel labels into discrete component
  • [6] XERTHGSY consolidated `pijul log` UI elements into their own component
  • [*] NSE6BLWA init slint project from https://github.com/slint-ui/slint-rust-template
  • [*] 6ECOC7L5 parsed `pijul channel` text blob into individual UI components

Change contents

  • replacement in ui/app-window.slint at line 119
    [3.359][2.254:379](),[2.379][3.872:882](),[3.403][3.872:882](),[3.872][3.872:882](),[3.882][3.882:888]()
    in-out property <bool> is-selected: false;
    touch := TouchArea {
    clicked => {
    is-selected = true;
    }
    }
    [3.359]
    [2.380]
    in property <bool> is-selected: false;
    in property <bool> has-hover: false;
  • replacement in ui/app-window.slint at line 127
    [2.565][2.565:624]()
    lowlighted when !is-selected && touch.has-hover: {
    [2.565]
    [2.624]
    lowlighted when has-hover: {
  • replacement in ui/app-window.slint at line 131
    [2.758][2.758:811]()
    off when !is-selected && !touch.has-hover: {
    [2.758]
    [2.811]
    off when true: {
  • edit in ui/app-window.slint at line 141
    [9.196]
    [3.890]
    in-out property <int> selected: -1;
    callback selection-changed(/*new selection*/ int);
  • edit in ui/app-window.slint at line 155
    [3.525]
    [9.758]
    is-selected: selected == index;
    has-hover: touch.has-hover;
    touch := TouchArea {
    clicked => {
    root.selected = index;
    root.selection-changed(index);
    }
    }