mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 22:00:10 +00:00
Merge pull request #105222 from kitbdev/fix-mouse-filter-recursive-and-rename
Fix and rename mouse filter recursive behavior and focus mode recursive behavior
This commit is contained in:
commit
00bd421089
10 changed files with 282 additions and 173 deletions
|
|
@ -68,10 +68,10 @@ public:
|
|||
FOCUS_ACCESSIBILITY,
|
||||
};
|
||||
|
||||
enum RecursiveBehavior {
|
||||
RECURSIVE_BEHAVIOR_INHERITED,
|
||||
RECURSIVE_BEHAVIOR_DISABLED,
|
||||
RECURSIVE_BEHAVIOR_ENABLED,
|
||||
enum FocusBehaviorRecursive {
|
||||
FOCUS_BEHAVIOR_INHERITED,
|
||||
FOCUS_BEHAVIOR_DISABLED,
|
||||
FOCUS_BEHAVIOR_ENABLED,
|
||||
};
|
||||
|
||||
enum SizeFlags {
|
||||
|
|
@ -90,6 +90,12 @@ public:
|
|||
MOUSE_FILTER_IGNORE
|
||||
};
|
||||
|
||||
enum MouseBehaviorRecursive {
|
||||
MOUSE_BEHAVIOR_INHERITED,
|
||||
MOUSE_BEHAVIOR_DISABLED,
|
||||
MOUSE_BEHAVIOR_ENABLED,
|
||||
};
|
||||
|
||||
enum CursorShape {
|
||||
CURSOR_ARROW,
|
||||
CURSOR_IBEAM,
|
||||
|
|
@ -197,8 +203,8 @@ private:
|
|||
real_t offset[4] = { 0.0, 0.0, 0.0, 0.0 };
|
||||
real_t anchor[4] = { ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN, ANCHOR_BEGIN };
|
||||
FocusMode focus_mode = FOCUS_NONE;
|
||||
RecursiveBehavior parent_focus_recursive_behavior = RECURSIVE_BEHAVIOR_INHERITED;
|
||||
RecursiveBehavior focus_recursive_behavior = RECURSIVE_BEHAVIOR_INHERITED;
|
||||
FocusBehaviorRecursive focus_behavior_recursive = FOCUS_BEHAVIOR_INHERITED;
|
||||
bool parent_focus_behavior_recursive_enabled = false;
|
||||
GrowDirection h_grow = GROW_DIRECTION_END;
|
||||
GrowDirection v_grow = GROW_DIRECTION_END;
|
||||
|
||||
|
|
@ -227,8 +233,8 @@ private:
|
|||
// Input events and rendering.
|
||||
|
||||
MouseFilter mouse_filter = MOUSE_FILTER_STOP;
|
||||
RecursiveBehavior parent_mouse_recursive_behavior = RECURSIVE_BEHAVIOR_INHERITED;
|
||||
RecursiveBehavior mouse_recursive_behavior = RECURSIVE_BEHAVIOR_INHERITED;
|
||||
MouseBehaviorRecursive mouse_behavior_recursive = MOUSE_BEHAVIOR_INHERITED;
|
||||
bool parent_mouse_behavior_recursive_enabled = true;
|
||||
bool force_pass_scroll_events = true;
|
||||
|
||||
bool clip_contents = false;
|
||||
|
|
@ -325,17 +331,17 @@ private:
|
|||
|
||||
// Mouse Filter.
|
||||
|
||||
bool _is_parent_mouse_disabled() const;
|
||||
bool _is_mouse_filter_enabled() const;
|
||||
void _update_mouse_behavior_recursive();
|
||||
void _propagate_mouse_behavior_recursive_recursively(bool p_enabled, bool p_skip_non_inherited);
|
||||
|
||||
// Focus.
|
||||
|
||||
void _window_find_focus_neighbor(const Vector2 &p_dir, Node *p_at, const Rect2 &p_rect, const Rect2 &p_clamp, real_t p_min, real_t &r_closest_dist_squared, Control **r_closest);
|
||||
Control *_get_focus_neighbor(Side p_side, int p_count = 0);
|
||||
bool _is_focus_disabled_recursively() const;
|
||||
void _propagate_focus_behavior_recursively(RecursiveBehavior p_focus_recursive_behavior, bool p_force);
|
||||
void _propagate_mouse_behavior_recursively(RecursiveBehavior p_focus_recursive_behavior, bool p_force);
|
||||
void _set_mouse_recursive_behavior_ignore_cache(RecursiveBehavior p_recursive_mouse_behavior);
|
||||
void _set_focus_recursive_behavior_ignore_cache(RecursiveBehavior p_recursive_mouse_behavior);
|
||||
bool _is_focus_mode_enabled() const;
|
||||
void _update_focus_behavior_recursive();
|
||||
void _propagate_focus_behavior_recursive_recursively(bool p_enabled, bool p_skip_non_inherited);
|
||||
|
||||
// Theming.
|
||||
|
||||
|
|
@ -541,10 +547,10 @@ public:
|
|||
|
||||
void set_mouse_filter(MouseFilter p_filter);
|
||||
MouseFilter get_mouse_filter() const;
|
||||
MouseFilter get_mouse_filter_with_recursive() const;
|
||||
MouseFilter get_mouse_filter_with_override() const;
|
||||
|
||||
void set_mouse_recursive_behavior(RecursiveBehavior p_recursive_mouse_behavior);
|
||||
RecursiveBehavior get_mouse_recursive_behavior() const;
|
||||
void set_mouse_behavior_recursive(MouseBehaviorRecursive p_mouse_behavior_recursive);
|
||||
MouseBehaviorRecursive get_mouse_behavior_recursive() const;
|
||||
|
||||
void set_force_pass_scroll_events(bool p_force_pass_scroll_events);
|
||||
bool is_force_pass_scroll_events() const;
|
||||
|
|
@ -571,9 +577,9 @@ public:
|
|||
|
||||
void set_focus_mode(FocusMode p_focus_mode);
|
||||
FocusMode get_focus_mode() const;
|
||||
FocusMode get_focus_mode_with_recursive() const;
|
||||
void set_focus_recursive_behavior(RecursiveBehavior p_recursive_mouse_behavior);
|
||||
RecursiveBehavior get_focus_recursive_behavior() const;
|
||||
FocusMode get_focus_mode_with_override() const;
|
||||
void set_focus_behavior_recursive(FocusBehaviorRecursive p_focus_behavior_recursive);
|
||||
FocusBehaviorRecursive get_focus_behavior_recursive() const;
|
||||
bool has_focus() const;
|
||||
void grab_focus();
|
||||
void grab_click_focus();
|
||||
|
|
@ -695,7 +701,8 @@ public:
|
|||
};
|
||||
|
||||
VARIANT_ENUM_CAST(Control::FocusMode);
|
||||
VARIANT_ENUM_CAST(Control::RecursiveBehavior);
|
||||
VARIANT_ENUM_CAST(Control::FocusBehaviorRecursive);
|
||||
VARIANT_ENUM_CAST(Control::MouseBehaviorRecursive);
|
||||
VARIANT_BITFIELD_CAST(Control::SizeFlags);
|
||||
VARIANT_ENUM_CAST(Control::CursorShape);
|
||||
VARIANT_ENUM_CAST(Control::LayoutPreset);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue