Skip to content

Commit

Permalink
Combine interaction + events into one system. Remove double click. Ad…
Browse files Browse the repository at this point in the history
…d hover/move positions. Use enums to lower amount of events.
  • Loading branch information
tommyminds committed Sep 5, 2020
1 parent 5c4d265 commit 9df757e
Show file tree
Hide file tree
Showing 6 changed files with 254 additions and 346 deletions.
6 changes: 1 addition & 5 deletions crates/bevy_ui/src/entity.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use super::Node;
use crate::{
render::UI_PIPELINE_HANDLE,
widget::{Button, Image, Text},
CalculatedSize, FocusPolicy, Interaction, PropagatePolicy, Style,
CalculatedSize, Interaction, PropagatePolicy, Style,
};
use bevy_asset::Handle;
use bevy_ecs::Bundle;
Expand Down Expand Up @@ -117,7 +117,6 @@ pub struct TextComponents {
pub draw: Draw,
pub text: Text,
pub calculated_size: CalculatedSize,
pub focus_policy: FocusPolicy,
pub propagate_policy: PropagatePolicy,
pub transform: Transform,
pub local_transform: LocalTransform,
Expand All @@ -126,7 +125,6 @@ pub struct TextComponents {
impl Default for TextComponents {
fn default() -> Self {
TextComponents {
focus_policy: FocusPolicy::Pass,
propagate_policy: PropagatePolicy::Pass,
draw: Draw {
is_transparent: true,
Expand All @@ -148,7 +146,6 @@ pub struct ButtonComponents {
pub button: Button,
pub style: Style,
pub interaction: Interaction,
pub focus_policy: FocusPolicy,
pub propagate_policy: PropagatePolicy,
pub mesh: Handle<Mesh>, // TODO: maybe abstract this out
pub material: Handle<ColorMaterial>,
Expand Down Expand Up @@ -182,7 +179,6 @@ impl Default for ButtonComponents {
},
)]),
interaction: Default::default(),
focus_policy: Default::default(),
propagate_policy: Default::default(),
node: Default::default(),
style: Default::default(),
Expand Down
183 changes: 0 additions & 183 deletions crates/bevy_ui/src/events.rs

This file was deleted.

93 changes: 0 additions & 93 deletions crates/bevy_ui/src/focus.rs

This file was deleted.

Loading

0 comments on commit 9df757e

Please sign in to comment.