mirror of
https://github.com/FyroxEngine/Fyrox.git
synced 2026-10-12 02:02:20 +00:00
continue with PartialEq impls
This commit is contained in:
@@ -213,6 +213,10 @@ macro_rules! blank_reflect_ref {
|
||||
None
|
||||
}
|
||||
|
||||
fn try_compare(&self, other: &dyn Reflect) -> Option<bool> {
|
||||
None
|
||||
}
|
||||
|
||||
fn fields_ref(&self, func: &mut dyn FnMut(&[$crate::reflect::FieldRef])) {
|
||||
func(&[])
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ repository = "https://github.com/FyroxEngine/Fyrox"
|
||||
rust-version = "1.87"
|
||||
|
||||
[dependencies]
|
||||
rectutils = "0.5.0"
|
||||
rectutils = "0.6.0"
|
||||
nalgebra = { version = "0.34", features = ["bytemuck", "convert-glam030"] }
|
||||
arrayvec = "0.7.4"
|
||||
num-traits = "0.2.18"
|
||||
|
||||
@@ -118,7 +118,7 @@ pub mod prelude {
|
||||
///
|
||||
/// The node does **not** contain any animations, instead it just takes animations from an animation
|
||||
/// player node and mixes them.
|
||||
#[derive(Visit, Reflect, Clone, Debug, Default)]
|
||||
#[derive(Visit, PartialEq, Reflect, Clone, Debug, Default)]
|
||||
#[reflect(type_uuid = "4b08c753-2a10-41e3-8fb2-4fd0517e86bc")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct AnimationBlendingStateMachine {
|
||||
@@ -276,7 +276,7 @@ pub struct EventAction {
|
||||
}
|
||||
|
||||
/// A widget that listens for particular events and sets parameters in an ABSM accordingly.
|
||||
#[derive(Visit, Reflect, Clone, Debug, Default)]
|
||||
#[derive(Visit, PartialEq, Reflect, Clone, Debug, Default)]
|
||||
#[reflect(type_uuid = "15f306b8-3bb8-4b35-87bd-6e9e5d748455")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct AbsmEventProvider {
|
||||
|
||||
@@ -142,7 +142,7 @@ impl BoundValueCollectionExt for BoundValueCollection {
|
||||
/// Animation player is a node that contains multiple animations. It updates and plays all the animations.
|
||||
/// The node could be a source of animations for animation blending state machines. To learn more about
|
||||
/// animations, see [`Animation`] docs.
|
||||
#[derive(Visit, Reflect, Clone, Debug)]
|
||||
#[derive(Visit, PartialEq, Reflect, Clone, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "44d1c94e-354f-4f9a-b918-9d31c28aa16a"
|
||||
|
||||
+1
-1
@@ -113,7 +113,7 @@ impl<T: BitContainer> ConstructorProvider<UiNode, UserInterface> for BitField<T>
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Reflect, Visit, Debug)]
|
||||
#[derive(Default, Clone, PartialEq, Reflect, Visit, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "6c19b266-18be-46d2-bfd3-f1dc9cb3f36c"
|
||||
|
||||
@@ -99,7 +99,7 @@ use fyrox_graph::constructor::{ConstructorProvider, GraphNodeConstructor};
|
||||
/// .with_stroke_thickness(Thickness {left: 2.0, right: 2.0, top: 2.0, bottom: 2.0}.into())
|
||||
/// .build(&mut ui.build_ctx());
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "6aba3dc5-831d-481a-bc83-ec10b2b2bf12")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct Border {
|
||||
|
||||
@@ -90,7 +90,7 @@ impl MessageData for ButtonMessage {}
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "2abcf12b-2f19-46da-b900-ae8890f7c9c6")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct Button {
|
||||
|
||||
@@ -66,7 +66,7 @@ use fyrox_graph::constructor::{ConstructorProvider, GraphNodeConstructor};
|
||||
/// .build(ctx)
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "6b843a36-53da-467b-b85e-2380fe891ca1")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct Canvas {
|
||||
|
||||
@@ -148,7 +148,7 @@ impl MessageData for CheckBoxMessage {}
|
||||
/// 2) [`CheckBoxBuilder::with_check_mark`] - sets the widget that will be used as checked icon.
|
||||
/// 3) [`CheckBoxBuilder::with_uncheck_mark`] - sets the widget that will be used as unchecked icon.
|
||||
/// 4) [`CheckBoxBuilder::with_undefined_mark`] - sets the widget that will be used as undefined icon.
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "3a866ba8-7682-4ce7-954a-46360f5837dc")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct CheckBox {
|
||||
|
||||
@@ -56,7 +56,7 @@ pub enum ColorGradientEditorMessage {
|
||||
}
|
||||
impl MessageData for ColorGradientEditorMessage {}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "50d00eb7-f30b-4973-8a36-03d6b8f007ec")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct ColorGradientField {
|
||||
@@ -182,7 +182,7 @@ impl ColorGradientFieldBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "82843d8b-1972-46e6-897c-9619b74059cc")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct ColorGradientEditor {
|
||||
@@ -469,7 +469,7 @@ pub enum ColorPointMessage {
|
||||
}
|
||||
impl MessageData for ColorPointMessage {}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "a493a603-3451-4005-8c80-559707729e70")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct ColorPoint {
|
||||
@@ -602,7 +602,7 @@ impl ColorPointBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "2608955a-4095-4fd1-af71-99bcdf2600f0")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct ColorPointsCanvas {
|
||||
|
||||
@@ -103,7 +103,7 @@ pub enum ColorFieldMessage {
|
||||
}
|
||||
impl MessageData for ColorFieldMessage {}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "956d4cae-7953-486b-99da-a9b852c2e144"
|
||||
@@ -384,7 +384,7 @@ impl AlphaBarBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "af28f977-85e7-4c9e-9a61-7f208844acb5"
|
||||
@@ -547,7 +547,7 @@ impl HueBarBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "ab6bfad5-0c4b-42a5-8da5-fc5687b1afc7"
|
||||
@@ -764,7 +764,7 @@ impl SaturationBrightnessFieldBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "b7a5d650-5b77-4938-83c1-37f3fe107885"
|
||||
@@ -1154,7 +1154,7 @@ impl ColorPickerBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "68dec1ac-23c6-41df-bc85-499f2a82e908"
|
||||
|
||||
@@ -30,7 +30,7 @@ use crate::{
|
||||
};
|
||||
use std::cmp::Ordering;
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "ae6110cd-f1dd-45b5-98e1-d8ae8bf3d0cc")]
|
||||
pub struct CurveKeyView {
|
||||
pub position: Vector2<f32>,
|
||||
@@ -48,7 +48,7 @@ impl From<&CurveKey> for CurveKeyView {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "866c6360-2c6a-4218-aebc-530036b59a87")]
|
||||
pub struct CurveKeyViewContainer {
|
||||
id: Uuid,
|
||||
|
||||
@@ -110,6 +110,12 @@ pub struct HighlightZone {
|
||||
#[derive(Debug, Default)]
|
||||
pub struct CurveTransformCell(Mutex<CurveTransform>);
|
||||
|
||||
impl PartialEq for CurveTransformCell {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
*self.0.safe_lock() == *other.0.safe_lock()
|
||||
}
|
||||
}
|
||||
|
||||
impl Clone for CurveTransformCell {
|
||||
fn clone(&self) -> Self {
|
||||
Self(Mutex::new(self.0.safe_lock().clone()))
|
||||
@@ -211,7 +217,7 @@ fn standardize_step(step: f32) -> f32 {
|
||||
///
|
||||
/// Since widgets are not mutable during layout and rendering, a CurveTransform
|
||||
/// is intended to be used within a [CurveTransformCell] which provides interior mutability.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub struct CurveTransform {
|
||||
/// Position of the center of the curve editor in the curve coordinate space.
|
||||
pub position: Vector2<f32>,
|
||||
@@ -358,7 +364,7 @@ impl Iterator for StepIterator {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "4b640057-639e-4f47-9a08-c08d94eca68e")]
|
||||
pub struct CurvesContainer {
|
||||
curves: Vec<CurveKeyViewContainer>,
|
||||
@@ -412,7 +418,7 @@ impl CurvesContainer {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "5c7b087e-871e-498d-b064-187b604a37d8"
|
||||
@@ -471,7 +477,7 @@ impl ConstructorProvider<UiNode, UserInterface> for CurveEditor {
|
||||
|
||||
crate::define_widget_deref!(CurveEditor);
|
||||
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "c81d942c-394d-498d-b460-1dc508288ed3")]
|
||||
struct ContextMenu {
|
||||
widget: RcUiNodeHandle,
|
||||
@@ -495,7 +501,7 @@ struct DragEntry {
|
||||
initial_position: Vector2<f32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
enum OperationContext {
|
||||
DragKeys {
|
||||
// In local coordinates.
|
||||
@@ -527,7 +533,7 @@ impl OperationContext {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone,PartialEq, Debug)]
|
||||
enum Selection {
|
||||
Keys { keys: FxHashSet<Uuid> },
|
||||
LeftTangent { key_id: Uuid },
|
||||
|
||||
@@ -86,7 +86,7 @@ impl MessageData for DecoratorMessage {}
|
||||
/// .build(ctx)
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "bb4b60aa-c657-4ed6-8db6-d7f374397c73"
|
||||
|
||||
@@ -160,7 +160,7 @@ impl MessageData for DockingManagerMessage {}
|
||||
/// To be able to restore the layout to its defaults, just create a desired layout from code,
|
||||
/// save the layout and use the returned layout descriptor when you need to restore the layout
|
||||
/// to its defaults.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "b04299f7-3f6b-45f1-89a6-0dce4ad929e1"
|
||||
|
||||
@@ -256,7 +256,7 @@ fn deminimize_other_window(
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "8ed17fa9-890e-4dd7-b4f9-a24660882234"
|
||||
|
||||
@@ -40,7 +40,7 @@ use fyrox_texture::TextureResource;
|
||||
use std::fmt::{Display, Formatter};
|
||||
use std::ops::Range;
|
||||
|
||||
#[derive(Clone, Copy, Debug, Pod, Zeroable)]
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Pod, Zeroable)]
|
||||
#[repr(C)]
|
||||
pub struct Vertex {
|
||||
pub pos: Vector2<f32>,
|
||||
@@ -58,7 +58,7 @@ impl Vertex {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum CommandTexture {
|
||||
None,
|
||||
Texture(TextureResource),
|
||||
@@ -70,7 +70,7 @@ pub enum CommandTexture {
|
||||
}
|
||||
|
||||
/// A set of triangles that will be used for clipping.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub struct ClippingGeometry {
|
||||
pub vertex_buffer: Vec<Vertex>,
|
||||
pub triangle_buffer: Vec<TriangleDefinition>,
|
||||
@@ -126,7 +126,7 @@ impl ClippingGeometry {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub struct Command {
|
||||
/// Clipping bounds, should be used for scissor-test. Screen-space.
|
||||
pub clip_bounds: Rect<f32>,
|
||||
@@ -753,7 +753,7 @@ pub trait Draw {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub struct TransformStack {
|
||||
transform: Matrix3<f32>,
|
||||
stack: Vec<Matrix3<f32>>,
|
||||
@@ -806,7 +806,7 @@ impl TransformStack {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
#[derive(Debug, Clone, PartialEq, Default)]
|
||||
pub struct RenderData {
|
||||
pub vertex_buffer: Vec<Vertex>,
|
||||
pub triangle_buffer: Vec<TriangleDefinition>,
|
||||
|
||||
@@ -167,7 +167,7 @@ impl MessageData for DropdownListMessage {}
|
||||
///
|
||||
/// A dropdown list could be opened and closed manually using [`DropdownListMessage::Open`] and
|
||||
/// [`DropdownListMessage::Close`] messages.
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "1da2f69a-c8b4-4ae2-a2ad-4afe61ee2a32"
|
||||
|
||||
@@ -34,7 +34,7 @@ use std::sync::mpsc::Sender;
|
||||
|
||||
/// A simple widget that opens a popup when clicked. It could be used to create dropdown menus that
|
||||
/// consolidates content of a group.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "c0a4c51b-f041-453b-a89d-7ceb5394e321")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct DropdownMenu {
|
||||
|
||||
@@ -151,7 +151,7 @@ impl MessageData for ExpanderMessage {}
|
||||
///
|
||||
/// To switch expander state at runtime, send [`ExpanderMessage::Expand`] to your Expander widget instance with
|
||||
/// [`crate::message::MessageDirection::ToWidget`].
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "24976179-b338-4c55-84c3-72d21663efd2"
|
||||
|
||||
@@ -41,7 +41,7 @@ pub enum FolderNameDialogMessage {
|
||||
}
|
||||
impl MessageData for FolderNameDialogMessage {}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Default, Debug)]
|
||||
#[derive(Clone, Visit, PartialEq, Reflect, Default, Debug)]
|
||||
#[reflect(type_uuid = "832f63b8-1372-49b8-8ce5-7564920343a8")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct FolderNameDialog {
|
||||
|
||||
@@ -46,7 +46,7 @@ impl MessageData for FileSelectorFieldMessage {}
|
||||
|
||||
define_widget_deref!(FileSelectorField);
|
||||
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "2dbda730-8a60-4f62-aee8-2ff0ccd15bf2"
|
||||
|
||||
@@ -43,7 +43,7 @@ use std::{
|
||||
sync::mpsc::Sender,
|
||||
};
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "6a9d597f-6a9f-4bad-b569-4cff1a6deff7"
|
||||
|
||||
@@ -100,7 +100,7 @@ enum FsEventMessage {
|
||||
}
|
||||
impl MessageData for FsEventMessage {}
|
||||
|
||||
#[derive(Default, Visit, Reflect)]
|
||||
#[derive(Default, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "b7f4610e-4b0c-4671-9b4a-60bb45268928")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct FileBrowser {
|
||||
@@ -120,7 +120,6 @@ pub struct FileBrowser {
|
||||
#[visit(skip)]
|
||||
#[reflect(hidden)]
|
||||
pub item_context_menu: RcUiNodeHandle,
|
||||
#[allow(clippy::type_complexity)]
|
||||
#[visit(skip)]
|
||||
#[reflect(hidden)]
|
||||
pub watcher: Option<notify::RecommendedWatcher>,
|
||||
|
||||
@@ -73,7 +73,7 @@ impl MessageData for FileSelectorMessage {}
|
||||
|
||||
/// File selector is a modal window that allows you to select a file (or directory) and commit or
|
||||
/// cancel selection.
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "878b2220-03e6-4a50-a97d-3a8e5397b6cb"
|
||||
|
||||
@@ -330,7 +330,7 @@ impl Atlas {
|
||||
}
|
||||
|
||||
/// A font resource and the associated data required for rendering glyphs from the font.
|
||||
#[derive(Default, Clone, Debug, Reflect, PartialEq, Visit)]
|
||||
#[derive(Default, Clone, Debug, Reflect, Visit)]
|
||||
#[reflect(type_uuid = "692fec79-103a-483c-bb0b-9fc3a349cb48")]
|
||||
pub struct Font {
|
||||
/// The source font data, such as might come from a ttf file.
|
||||
@@ -361,6 +361,17 @@ pub struct Font {
|
||||
pub fallbacks: Vec<Option<FontResource>>,
|
||||
}
|
||||
|
||||
impl PartialEq for Font {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.atlases == other.atlases
|
||||
&& self.page_size == other.page_size
|
||||
&& self.bold == other.bold
|
||||
&& self.italic == other.italic
|
||||
&& self.bold_italic == other.bold_italic
|
||||
&& self.fallbacks == other.fallbacks
|
||||
}
|
||||
}
|
||||
|
||||
impl ResourceData for Font {
|
||||
fn save(&mut self, _path: &Path) -> Result<(), Box<dyn Error>> {
|
||||
Ok(())
|
||||
|
||||
@@ -55,7 +55,7 @@ pub struct Position {
|
||||
pub offset: usize,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Default)]
|
||||
#[derive(Debug, PartialEq, Clone, Default)]
|
||||
pub struct TextGlyph {
|
||||
pub bounds: Rect<f32>,
|
||||
pub tex_coords: [Vector2<f32>; 4],
|
||||
@@ -63,7 +63,7 @@ pub struct TextGlyph {
|
||||
pub source_char_index: usize,
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Default)]
|
||||
#[derive(Copy, Clone, PartialEq, Debug, Default)]
|
||||
pub struct TextLine {
|
||||
/// Index of starting symbol in text array.
|
||||
pub begin: usize,
|
||||
@@ -256,7 +256,7 @@ impl LineSink for WrapSink<'_> {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "a48f1f1d-24ce-4a84-a45d-706ac541cf0a")]
|
||||
pub struct FormattedText {
|
||||
font: InheritableVariable<Option<FontResource>>,
|
||||
|
||||
@@ -217,7 +217,7 @@ pub type Row = GridDimension;
|
||||
/// You can add any number of rows and columns to a grid widget, and each grid cell does **not** need to have a UI widget
|
||||
/// in it to be valid. For example, you can add a column and set it to a specific size via strict to provide spacing between
|
||||
/// two other columns.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "98ce15e2-bd62-497d-a37b-9b1cb4a1918c"
|
||||
@@ -262,7 +262,7 @@ crate::define_widget_deref!(Grid);
|
||||
|
||||
/// Cell of the grid, that contains additional information for layout purposes. It does not have any
|
||||
/// particular use outside of grid's internals.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub struct Cell {
|
||||
/// A set of nodes of the cell.
|
||||
pub nodes: Vec<Handle<UiNode>>,
|
||||
|
||||
@@ -157,7 +157,7 @@ impl MessageData for ImageMessage {}
|
||||
/// It is useful if you have many custom UI elements packed in a single texture atlas. Drawing using atlases is much more
|
||||
/// efficient and faster. This could also be used for animations when you have multiple frames packed in a single atlas
|
||||
/// and changing texture coordinates over time.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "18e18d0f-cb84-4ac1-8050-3480a2ec3de5")]
|
||||
#[visit(optional)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
|
||||
@@ -88,7 +88,7 @@ pub enum InputBoxResult {
|
||||
/// There's no way to change the style of the input box, nor add some widgets to it. If you need a
|
||||
/// custom input box, then you need to create your own widget. This input box is meant to be used as
|
||||
/// a standard dialog box for standard situations in the UI.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "6b7b6b82-939b-4f98-9bb9-9bd19ce68b21")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct InputBox {
|
||||
|
||||
@@ -53,7 +53,7 @@ pub enum ArrayEditorMessage {
|
||||
}
|
||||
impl MessageData for ArrayEditorMessage {}
|
||||
|
||||
#[derive(Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "5c6e4785-8e2d-441f-8478-523900394b93"
|
||||
|
||||
@@ -57,11 +57,11 @@ pub struct Item {
|
||||
remove: Handle<Button>,
|
||||
}
|
||||
|
||||
pub trait CollectionItem: Clone + Reflect + Default + Send + 'static {}
|
||||
pub trait CollectionItem: Clone + PartialEq + Reflect + Default + Send + 'static {}
|
||||
|
||||
impl<T> CollectionItem for T where T: Clone + Reflect + Default + Send + 'static {}
|
||||
impl<T> CollectionItem for T where T: Clone + PartialEq + Reflect + Default + Send + 'static {}
|
||||
|
||||
#[derive(Debug, Visit, Reflect)]
|
||||
#[derive(Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "316b0319-f8ee-4b63-9ed9-3f59a857e2bc"
|
||||
|
||||
@@ -48,9 +48,9 @@ use strum::VariantNames;
|
||||
|
||||
const LOCAL_SYNC_FLAG: u64 = 0xFF;
|
||||
|
||||
pub trait InspectableEnum: Debug + Reflect + Clone + Send + 'static {}
|
||||
pub trait InspectableEnum: Debug + Reflect + PartialEq + Clone + Send + 'static {}
|
||||
|
||||
impl<T: Debug + Reflect + Clone + Send + 'static> InspectableEnum for T {}
|
||||
impl<T: Debug + Reflect + PartialEq + Clone + Send + 'static> InspectableEnum for T {}
|
||||
|
||||
#[derive(Debug, Clone, PartialEq)]
|
||||
pub enum EnumPropertyEditorMessage {
|
||||
@@ -59,7 +59,7 @@ pub enum EnumPropertyEditorMessage {
|
||||
}
|
||||
impl MessageData for EnumPropertyEditorMessage {}
|
||||
|
||||
#[derive(Visit, Reflect)]
|
||||
#[derive(Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "0dbefddc-70fa-45a9-96f0-8fe25f6c1669"
|
||||
|
||||
@@ -60,7 +60,7 @@ pub enum InheritablePropertyEditorMessage {
|
||||
}
|
||||
impl MessageData for InheritablePropertyEditorMessage {}
|
||||
|
||||
#[derive(Debug, Clone, Visit, Reflect)]
|
||||
#[derive(Debug, Clone, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "d5dce72c-a54b-4754-96a3-2e923eaa802f")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct InheritablePropertyEditor {
|
||||
|
||||
@@ -77,7 +77,7 @@ pub enum StyledPropertyEditorMessage {
|
||||
}
|
||||
impl MessageData for StyledPropertyEditorMessage {}
|
||||
|
||||
#[derive(Debug, Clone, Visit, Reflect)]
|
||||
#[derive(Debug, Clone, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "3a863a0f-7414-44f5-a7aa-7a6668a6d406")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct StyledPropertySelector {
|
||||
@@ -308,7 +308,7 @@ impl StyledPropertySelectorBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Visit, Reflect)]
|
||||
#[derive(Debug, Clone, Visit, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "1b8fb74a-3911-4b44-bb71-1a0382ebb9a7")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct StyledPropertyEditor {
|
||||
|
||||
@@ -84,7 +84,7 @@ struct DragContext {
|
||||
texture_region: Rect<u32>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Reflect, Visit, Debug)]
|
||||
#[derive(Clone, PartialEq, Reflect, Visit, Debug)]
|
||||
#[reflect(type_uuid = "bd89b59f-13be-4804-bd9c-ed40cfd48b92")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct TextureSliceEditor {
|
||||
@@ -470,7 +470,7 @@ impl TextureSliceEditorBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Reflect, Visit, Debug)]
|
||||
#[derive(Clone, PartialEq, Reflect, Visit, Debug)]
|
||||
#[reflect(type_uuid = "0293081d-55fd-4aa2-a06e-d53fba1a2617")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct TextureSliceEditorWindow {
|
||||
@@ -694,7 +694,7 @@ impl TextureSliceEditorWindowBuilder {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Reflect, Visit, Debug)]
|
||||
#[derive(Clone, PartialEq, Reflect, Visit, Debug)]
|
||||
#[reflect(type_uuid = "024f3a3a-6784-4675-bd99-a4c6c19a8d91")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct TextureSliceFieldEditor {
|
||||
|
||||
@@ -511,7 +511,7 @@ pub trait InspectorEnvironment: Send + Sync + Reflect {
|
||||
/// .build(ctx)
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "c599c0f5-f749-4033-afed-1a9949c937a1"
|
||||
|
||||
+2
-2
@@ -187,7 +187,7 @@ impl MessageData for HotKeyEditorMessage {}
|
||||
/// ## Messages
|
||||
///
|
||||
/// Use [`HotKeyEditorMessage`] message to alternate the state of a hot key widget, or to listen to its changes.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "7bc49843-1302-4e36-b901-63af5cea6c60"
|
||||
@@ -398,7 +398,7 @@ impl MessageData for KeyBindingEditorMessage {}
|
||||
/// ## Messages
|
||||
///
|
||||
/// Use [`KeyBindingEditorMessage`] message to alternate the state of a key binding widget, or to listen to its changes.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "150113ce-f95e-4c76-9ac9-4503e78b960f"
|
||||
|
||||
+1
-1
@@ -693,7 +693,7 @@ pub enum RenderMode {
|
||||
OnChanges,
|
||||
}
|
||||
|
||||
#[derive(Reflect)]
|
||||
#[derive(Reflect, PartialEq)]
|
||||
#[reflect(type_uuid = "0d065c93-ef9c-4dd2-9fe7-e2b33c1a21b6")]
|
||||
pub struct UserInterface {
|
||||
screen_size: Vector2<f32>,
|
||||
|
||||
@@ -233,7 +233,7 @@ impl ListViewMessage {
|
||||
/// ui.send(my_list_view, ListViewMessage::BringItemIntoView(my_item));
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[visit(optional)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
@@ -325,7 +325,7 @@ impl ListView {
|
||||
}
|
||||
|
||||
/// A wrapper for list view items, that is used to add selection functionality to arbitrary items.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "02f21415-5843-42f5-a3e4-b4a21e7739ad"
|
||||
|
||||
@@ -73,7 +73,7 @@ where
|
||||
}
|
||||
impl<const R: usize, const C: usize, T: NumericType> MessageData for MatrixEditorMessage<R, C, T> {}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "9f05427a-5862-4574-bb21-ebaf52aa8c72"
|
||||
|
||||
@@ -197,7 +197,7 @@ impl MessageData for MenuItemMessage {}
|
||||
/// .build(ctx)
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "582a04f3-a7fd-4e70-bbd1-eb95e2275b75"
|
||||
@@ -344,7 +344,7 @@ enum NavigationDirection {
|
||||
Vertical,
|
||||
}
|
||||
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[doc(hidden)]
|
||||
#[reflect(type_uuid = "667bb0c3-9f55-4850-bb19-b9fdf3f8d27b")]
|
||||
pub struct ItemsContainer {
|
||||
@@ -411,7 +411,7 @@ impl ItemsContainer {
|
||||
|
||||
/// Menu item is a widget with arbitrary content, that has a "floating" panel (popup) for sub-items if the menu item. This was menu items can form
|
||||
/// arbitrary hierarchies. See [`Menu`] docs for examples.
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "72e002c6-6060-4583-b5b7-0c5500244fef"
|
||||
@@ -1140,7 +1140,7 @@ impl MenuItemBuilder {
|
||||
|
||||
/// A simple wrapper over [`Popup`] widget, that holds the sub-items of a menu item and provides
|
||||
/// an ability for keyboard navigation.
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "ad8e9e76-c213-4232-9bab-80ebcabd69fa"
|
||||
|
||||
@@ -163,7 +163,7 @@ pub enum MessageBoxButtons {
|
||||
///
|
||||
/// There's no way to change the style of the message box, nor add some widgets to it. If you need a custom message box, then you
|
||||
/// need to create your own widget. This message box is meant to be used as a standard dialog box for standard situations in the UI.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "b14c0012-4383-45cf-b9a1-231415d95373"
|
||||
|
||||
@@ -74,7 +74,7 @@ use fyrox_graph::SceneGraph;
|
||||
///
|
||||
/// This example shows how to create a simple confirmation dialog, that allows a user to use Tab key
|
||||
/// to cycle from one button to another. A focused button then can be "clicked" using Enter key.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "135d347b-5019-4743-906c-6df5c295a3be")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct NavigationLayer {
|
||||
|
||||
@@ -157,7 +157,7 @@ impl TextureSlice {
|
||||
/// .build(&mut ui.build_ctx())
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(type_uuid = "c345033e-8c10-4186-b101-43f73b85981d")]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
pub struct NinePatch {
|
||||
|
||||
@@ -35,7 +35,7 @@ use fyrox_core::visitor::error::VisitError;
|
||||
|
||||
/// A wrapper for widget pool record that allows to define custom visit method to have full
|
||||
/// control over instantiation process at deserialization.
|
||||
#[derive(Debug, Clone, Default, Reflect)]
|
||||
#[derive(Debug, Clone, Default, PartialEq, Reflect)]
|
||||
#[reflect(type_uuid = "8d572e59-9594-435d-844f-c78cd7696744")]
|
||||
pub struct WidgetContainer(Option<UiNode>);
|
||||
|
||||
|
||||
@@ -47,6 +47,12 @@ pub mod container;
|
||||
#[reflect(type_uuid = "d9b45ecc-91b0-40ea-a92a-4a7dee4667c9")]
|
||||
pub struct UiNode(#[reflect(deref, display_name = "UiNode")] pub Box<dyn Control>);
|
||||
|
||||
impl PartialEq for UiNode {
|
||||
fn eq(&self, other: &Self) -> bool {
|
||||
self.0.try_compare(other.0.deref()).unwrap_or_default()
|
||||
}
|
||||
}
|
||||
|
||||
impl<T: Control> From<T> for UiNode {
|
||||
fn from(value: T) -> Self {
|
||||
Self(Box::new(value))
|
||||
|
||||
@@ -65,6 +65,7 @@ pub trait NumericType:
|
||||
+ Copy
|
||||
+ NumOps
|
||||
+ PartialOrd
|
||||
+ PartialEq
|
||||
+ Display
|
||||
+ Bounded
|
||||
+ Debug
|
||||
@@ -85,6 +86,7 @@ impl<T> NumericType for T where
|
||||
+ Copy
|
||||
+ NumOps
|
||||
+ PartialOrd
|
||||
+ PartialEq
|
||||
+ Bounded
|
||||
+ Display
|
||||
+ Debug
|
||||
@@ -121,7 +123,7 @@ pub enum NumericUpDownMessage<T: NumericType> {
|
||||
impl<T: NumericType> MessageData for NumericUpDownMessage<T> {}
|
||||
|
||||
/// Used to store drag info when dragging the cursor on the up/down buttons.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub enum DragContext<T: NumericType> {
|
||||
/// Dragging is just started.
|
||||
PreDrag {
|
||||
@@ -233,7 +235,7 @@ pub enum DragContext<T: NumericType> {
|
||||
/// .build(ctx)
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "f852eda4-18e5-4480-83ae-a607ce1c26f7"
|
||||
|
||||
@@ -71,7 +71,7 @@ impl MessageData for PathEditorMessage {}
|
||||
///
|
||||
/// To receive the changes, listen to [`PathEditorMessage::Path`] and check for its direction, it should be [`crate::message::MessageDirection::FromWidget`].
|
||||
/// To set a new path value, send [`PathEditorMessage::Path`] message, but with [`crate::message::MessageDirection::ToWidget`].
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "51cfe7ec-ec31-4354-9578-047004b213a1"
|
||||
|
||||
@@ -287,7 +287,7 @@ impl Placement {
|
||||
///
|
||||
/// Popup widget can automatically adjust its position to always remain on screen, which is useful for tooltips, dropdown lists,
|
||||
/// etc. To enable this option, use [`PopupBuilder::with_smart_placement`] with `true` as the first argument.
|
||||
#[derive(Default, Clone, Visit, Debug, Reflect)]
|
||||
#[derive(Default, Clone, Visit, Debug, PartialEq, Reflect)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(type_uuid = "5c4bf90d-cfe7-464f-bcf8-71deacb14dd8")]
|
||||
pub struct Popup {
|
||||
|
||||
@@ -87,7 +87,7 @@ impl MessageData for ProgressBarMessage {}
|
||||
/// ui.send(progress_bar, ProgressBarMessage::Progress(0.33));
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "d6ebb853-d945-46bc-86db-4c8b5d5faf8e"
|
||||
|
||||
@@ -106,7 +106,7 @@ impl<T: NumericType> MessageData for RangeEditorMessage<T> {}
|
||||
///
|
||||
/// Be very careful about the type of the range when sending a message, you need to send a range of exact type, that match the type
|
||||
/// of your editor, otherwise the message have no effect. The same applied to fetching.
|
||||
#[derive(Default, Debug, Clone, Reflect, Visit)]
|
||||
#[derive(Default, Debug, Clone, PartialEq, Reflect, Visit)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "0eb2948e-8485-490e-8719-18a0bb6fe275"
|
||||
|
||||
@@ -115,7 +115,7 @@ impl<T: NumericType> MessageData for RectEditorMessage<T> {}
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Debug, Clone, Visit, Reflect)]
|
||||
#[derive(Default, Debug, Clone, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "5a3daf9d-f33b-494b-b111-eb55721dc7ac"
|
||||
|
||||
@@ -105,7 +105,7 @@ use std::cell::Cell;
|
||||
/// .build(ctx)
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "3bc7649f-a1ba-49be-bc4e-e0624654e40c"
|
||||
|
||||
@@ -129,7 +129,7 @@ impl MessageData for ScrollBarMessage {}
|
||||
///
|
||||
/// Scroll bar provides arrows to change the current value using a fixed step value. You can change it using
|
||||
/// [`ScrollBarBuilder::with_step`] method.
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "92accc96-b334-424d-97ea-332c4787acf6"
|
||||
|
||||
@@ -143,7 +143,7 @@ impl MessageData for ScrollPanelMessage {
|
||||
/// ui.send(scroll_panel, ScrollPanelMessage::BringIntoView(child))
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "1ab4936d-58c8-4cf7-b33c-4b56092f4826"
|
||||
|
||||
@@ -166,7 +166,7 @@ impl ScrollViewerMessage {
|
||||
/// ui.send(scroll_viewer, ScrollViewerMessage::BringIntoView(child))
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "173e869f-7da0-4ae2-915a-5d545d8150cc"
|
||||
|
||||
@@ -97,7 +97,7 @@ impl MessageData for SearchBarMessage {}
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "23db1179-0e07-493d-98fd-2b3c0c795215"
|
||||
|
||||
@@ -118,7 +118,7 @@ impl MessageData for SelectorMessage {}
|
||||
/// }
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(type_uuid = "25118853-5c3c-4197-9e4b-2e3b9d92f4d2")]
|
||||
pub struct Selector {
|
||||
|
||||
@@ -107,7 +107,7 @@ impl MessageData for StackPanelMessage {}
|
||||
/// .build(ctx);
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "d868f554-a2c5-4280-abfc-396d10a0e1ed"
|
||||
|
||||
@@ -54,7 +54,7 @@ use std::{
|
||||
use strum_macros::{AsRefStr, EnumString, VariantNames};
|
||||
|
||||
/// A set of potential values for styled properties.
|
||||
#[derive(Visit, Reflect, Debug, Clone, AsRefStr, EnumString, VariantNames)]
|
||||
#[derive(Visit, PartialEq, Reflect, Debug, Clone, AsRefStr, EnumString, VariantNames)]
|
||||
#[reflect(type_uuid = "85b8c1e4-03a2-4a28-acb4-1850d1a29227")]
|
||||
pub enum StyleProperty {
|
||||
/// A numeric property.
|
||||
@@ -150,9 +150,9 @@ pub static LIGHT_STYLE: LazyLock<BuiltInResource<Style>> = LazyLock::new(|| {
|
||||
/// the style and why do we need to store the value as well? The answer is flexibility. In this
|
||||
/// approach, style becomes not necessary and the value can be hardcoded. Also, the values of such
|
||||
/// properties can be updated individually.
|
||||
#[derive(Clone, Debug, Reflect, Default)]
|
||||
#[derive(Clone, Debug, PartialEq, Reflect, Default)]
|
||||
#[reflect(
|
||||
bounds = "T: Reflect + Clone",
|
||||
bounds = "T: Reflect + Clone + PartialEq",
|
||||
type_uuid = "71e84137-2832-42a1-bcb5-f8ee95784997"
|
||||
)]
|
||||
pub struct StyledProperty<T> {
|
||||
@@ -220,7 +220,7 @@ impl<T: Visit> Visit for StyledProperty<T> {
|
||||
}
|
||||
|
||||
/// Named style property container.
|
||||
#[derive(Visit, Reflect, Clone, Default, Debug)]
|
||||
#[derive(Visit, PartialEq, Reflect, Clone, Default, Debug)]
|
||||
#[reflect(type_uuid = "6238f37c-c067-4dd1-be67-6a8bb8853a59")]
|
||||
pub struct StylePropertyContainer {
|
||||
/// Name of the property.
|
||||
@@ -298,7 +298,7 @@ pub struct StylePropertyContainer {
|
||||
/// ui.set_style(StyleResource::new_embedded(style));
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Visit, Reflect, Clone, Default, Debug)]
|
||||
#[derive(Visit, PartialEq, Reflect, Clone, Default, Debug)]
|
||||
#[reflect(type_uuid = "38a63b49-d765-4c01-8fb5-202cc43d607e")]
|
||||
pub struct Style {
|
||||
parent: Option<StyleResource>,
|
||||
|
||||
@@ -205,7 +205,7 @@ pub struct Tab {
|
||||
/// };
|
||||
/// # }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "d54cfac3-0afc-464b-838a-158b3a2253f5"
|
||||
|
||||
@@ -319,7 +319,7 @@ impl MessageData for TextMessage {}
|
||||
///
|
||||
/// Please keep in mind, that like any other situation when you "changing" something via messages, you should remember
|
||||
/// that the change is **not** immediate.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "22f7f502-7622-4ecb-8c5f-ba436e7ee823"
|
||||
|
||||
@@ -393,7 +393,7 @@ pub type FilterCallback = dyn FnMut(char) -> bool + Send;
|
||||
///
|
||||
/// You can change brush of caret by using [`TextBoxBuilder::with_caret_brush`] and also selection brush by using
|
||||
/// [`TextBoxBuilder::with_selection_brush`], it could be useful if you don't like default colors.
|
||||
#[derive(Default, Clone, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "536276f2-a175-4c05-a376-5a7d8bf0d10b"
|
||||
|
||||
@@ -98,7 +98,7 @@ impl MessageData for ThumbMessage {}
|
||||
///
|
||||
/// This example creates a new thumb widget 5px wide and shows how to use its messages to get
|
||||
/// information about the actual movement.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(type_uuid = "71ad2ff4-6e9e-461d-b7c2-867bd4039684")]
|
||||
pub struct Thumb {
|
||||
|
||||
@@ -32,7 +32,7 @@ use fyrox_core::pool::ObjectOrVariant;
|
||||
use crate::message::MessageData;
|
||||
use fyrox_graph::constructor::{ConstructorProvider, GraphNodeConstructor};
|
||||
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(derived_type = "UiNode")]
|
||||
#[reflect(type_uuid = "8d8f114d-7fc6-4d7e-8f57-cd4e39958c36")]
|
||||
pub struct ToggleButton {
|
||||
|
||||
@@ -292,7 +292,7 @@ impl MessageData for TreeRootMessage {}
|
||||
/// });
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Debug, Clone, Visit, Reflect)]
|
||||
#[derive(Default, Debug, Clone, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "e090e913-393a-4192-a220-e1d87e272170"
|
||||
@@ -809,7 +809,7 @@ fn build_expander(
|
||||
/// ui.send(tree, TreeRootMessage::Select(new_selection));
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Debug, Clone, Visit, Reflect)]
|
||||
#[derive(Default, Debug, Clone, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "cf7c0476-f779-4e4b-8b7e-01a23ff51a72"
|
||||
|
||||
@@ -66,7 +66,7 @@ impl MessageData for UuidEditorMessage {}
|
||||
/// .build(ctx)
|
||||
/// }
|
||||
/// ```
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "667f7f48-2448-42da-91dd-cd743ca7117e"
|
||||
|
||||
+1
-1
@@ -91,7 +91,7 @@ where
|
||||
}
|
||||
impl<T: NumericType, const D: usize> MessageData for VecEditorMessage<T, D> {}
|
||||
|
||||
#[derive(Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "0332144f-c70e-456a-812b-f9b89980d2ba"
|
||||
|
||||
@@ -197,7 +197,7 @@ impl Primitive {
|
||||
///
|
||||
/// Keep in mind that all primitives located in local coordinates. The color of the vector image can be changed by
|
||||
/// setting a new foreground brush.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, Visit, PartialEq, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "7e535b65-0178-414e-b310-e208afc0eeb5"
|
||||
|
||||
@@ -519,7 +519,7 @@ impl DerefMut for WidgetMaterial {
|
||||
}
|
||||
|
||||
/// A set of data emitted by a widget during the draw pass.
|
||||
#[derive(Default, Debug, Clone)]
|
||||
#[derive(Default, Debug, PartialEq, Clone)]
|
||||
pub struct WidgetRenderDataSet {
|
||||
/// The result of calling the [`crate::control::Control::draw`] method.
|
||||
pub draw_result: RenderData,
|
||||
@@ -539,7 +539,7 @@ impl WidgetRenderDataSet {
|
||||
/// Widget is a base UI element, that is always used to build derived, more complex, widgets. In general, it is a container
|
||||
/// for layout information, basic visual appearance, visibility options, parent-child information. It does almost nothing
|
||||
/// on its own, instead, the user interface modifies its state accordingly.
|
||||
#[derive(Default, Debug, Clone, Reflect, Visit)]
|
||||
#[derive(Default, Debug, Clone, Reflect, PartialEq, Visit)]
|
||||
#[reflect(type_uuid = "77e1b0ed-0d0a-4fae-9956-19bbd7145401")]
|
||||
#[visit(optional)]
|
||||
pub struct Widget {
|
||||
|
||||
@@ -217,7 +217,7 @@ pub enum WindowSizeState {
|
||||
/// to interact with anything else until the modal is dismissed.
|
||||
///
|
||||
/// Any window can be set and unset as a modal via the *modal* function.
|
||||
#[derive(Default, Clone, Visit, Reflect, Debug)]
|
||||
#[derive(Default, Clone, PartialEq, Visit, Reflect, Debug)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "9331bf32-8614-4005-874c-5239e56bb15e"
|
||||
@@ -292,7 +292,7 @@ const GRIP_SIZE: f32 = 6.0;
|
||||
const CORNER_GRIP_SIZE: f32 = GRIP_SIZE * 2.0;
|
||||
|
||||
/// Kind of a resizing grip.
|
||||
#[derive(Copy, Clone, Debug, Visit, Reflect, Default)]
|
||||
#[derive(Copy, Clone, Debug, Visit, PartialEq, Reflect, Default)]
|
||||
#[reflect(type_uuid = "fea2073e-f44e-45db-a373-c9fcee201c2d")]
|
||||
pub enum GripKind {
|
||||
/// Left-top corner grip.
|
||||
@@ -315,7 +315,7 @@ pub enum GripKind {
|
||||
}
|
||||
|
||||
/// Resizing grip.
|
||||
#[derive(Clone, Visit, Default, Debug, Reflect)]
|
||||
#[derive(Clone, Visit, PartialEq, Default, Debug, Reflect)]
|
||||
#[reflect(type_uuid = "373815d8-77d2-4624-80de-2d851f7fd6e5")]
|
||||
pub struct Grip {
|
||||
/// Kind of the grip.
|
||||
|
||||
@@ -76,7 +76,7 @@ impl MessageData for WrapPanelMessage {}
|
||||
///
|
||||
/// Wrap panel can stack your widgets either in vertical or horizontal direction. Use `.with_orientation` while building
|
||||
/// the panel to switch orientation to desired.
|
||||
#[derive(Default, Clone, Debug, Visit, Reflect)]
|
||||
#[derive(Default, Clone, Debug, Visit, PartialEq, Reflect)]
|
||||
#[reflect(
|
||||
derived_type = "UiNode",
|
||||
type_uuid = "f488ab8e-8f8b-473c-a450-5ac33f1afb39"
|
||||
@@ -108,7 +108,7 @@ impl ConstructorProvider<UiNode, UserInterface> for WrapPanel {
|
||||
crate::define_widget_deref!(WrapPanel);
|
||||
|
||||
/// Represents a single line (either vertical or horizontal) with arranged widgets.
|
||||
#[derive(Clone, Debug)]
|
||||
#[derive(Clone, PartialEq, Debug)]
|
||||
pub struct Line {
|
||||
/// Indices of the children widgets that belongs to this line.
|
||||
pub children: Range<usize>,
|
||||
|
||||
Reference in New Issue
Block a user