zng-ui / zng

Cross-platform GUI framework.
Apache License 2.0
58 stars 1 forks source link

Getter property `#gesture::is_hovered` is inverted in root wigets #462

Closed SamRodri closed 2 months ago

SamRodri commented 2 months ago

I tried this code:

  Window! {
      widget::background_color = colors::BLUE;
      when #gesture::is_hovered {
          widget::background_color = colors::RED;
      }
      child_align = Align::CENTER;
      child = Container! {
          layout::size = 50;
          widget::background_color = colors::BLUE;
          when #gesture::is_hovered {
              widget::background_color = colors::RED;
          }
      }
  }

Following these steps:

1 - Run. 2 - Observe window opening not under mouse cursor.

I saw this happen:

On init, the Window! background is RED (wrong), the Container! background is BLUE (correct).

I expected this to happen:

Window background also BLUE.

Cargo version:

cargo 1.81.0 (2dbb1af80 2024-08-20)
release: 1.81.0
commit-hash: 2dbb1af80a2914475ba76827a312e29cedfa6b2f
commit-date: 2024-08-20
host: x86_64-unknown-linux-gnu
libgit2: 1.8.1 (sys:0.19.0 vendored)
libcurl: 8.8.0-DEV (sys:0.4.73+curl-8.8.0 vendored ssl:OpenSSL/1.1.1w)
ssl: OpenSSL 1.1.1w  11 Sep 2023
os: Ubuntu 24.4.0 (noble) [64-bit]