From 11e8904e157a42e6e0cb858eb24ed35f192a458a Mon Sep 17 00:00:00 2001 From: sam <43527203+bytemunch@users.noreply.github.com> Date: Wed, 4 Oct 2023 12:06:39 +0100 Subject: [PATCH] show cursor on readonly widget (#71) --- src/cursor.rs | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/cursor.rs b/src/cursor.rs index d1a8530..037d88f 100644 --- a/src/cursor.rs +++ b/src/cursor.rs @@ -1,6 +1,6 @@ use bevy::{input::mouse::MouseMotion, prelude::*, window::PrimaryWindow}; -use crate::{CosmicEditor, CosmicTextChanged, ReadOnly}; +use crate::{CosmicEditor, CosmicTextChanged}; /// For use with custom cursor control; Event is emitted when cursor enters a text widget #[derive(Event)] @@ -33,13 +33,9 @@ pub fn change_cursor( } } -// TODO: Only emit events; If configured to, have a fn to act on the events pub fn hover_sprites( windows: Query<&Window, With<PrimaryWindow>>, - mut cosmic_edit_query: Query< - (&mut Sprite, &GlobalTransform), - (With<CosmicEditor>, Without<ReadOnly>), - >, + mut cosmic_edit_query: Query<(&mut Sprite, &GlobalTransform), With<CosmicEditor>>, camera_q: Query<(&Camera, &GlobalTransform)>, mut hovered: Local<bool>, mut last_hovered: Local<bool>, @@ -76,13 +72,7 @@ pub fn hover_sprites( } pub fn hover_ui( - mut interaction_query: Query< - &Interaction, - ( - Changed<Interaction>, - (With<CosmicEditor>, Without<ReadOnly>), - ), - >, + mut interaction_query: Query<&Interaction, (Changed<Interaction>, With<CosmicEditor>)>, mut evw_hover_in: EventWriter<TextHoverIn>, mut evw_hover_out: EventWriter<TextHoverOut>, ) { -- GitLab