Merge pull request #96786 from passivestar/spin-slider-focus-fix
Fix EditorSpinSlider blocking viewport from getting focus
This commit is contained in:
@ -37,10 +37,6 @@
|
|||||||
#include "editor/themes/editor_scale.h"
|
#include "editor/themes/editor_scale.h"
|
||||||
#include "scene/theme/theme_db.h"
|
#include "scene/theme/theme_db.h"
|
||||||
|
|
||||||
bool EditorSpinSlider::is_text_field() const {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const {
|
String EditorSpinSlider::get_tooltip(const Point2 &p_pos) const {
|
||||||
if (!read_only && grabber->is_visible()) {
|
if (!read_only && grabber->is_visible()) {
|
||||||
Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL;
|
Key key = (OS::get_singleton()->has_feature("macos") || OS::get_singleton()->has_feature("web_macos") || OS::get_singleton()->has_feature("web_ios")) ? Key::META : Key::CTRL;
|
||||||
|
|||||||
@ -101,8 +101,6 @@ protected:
|
|||||||
void _focus_entered();
|
void _focus_entered();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual bool is_text_field() const override;
|
|
||||||
|
|
||||||
String get_tooltip(const Point2 &p_pos) const override;
|
String get_tooltip(const Point2 &p_pos) const override;
|
||||||
|
|
||||||
String get_text_value() const;
|
String get_text_value() const;
|
||||||
|
|||||||
@ -156,11 +156,12 @@ void SceneTreeDock::shortcut_input(const Ref<InputEvent> &p_event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ED_IS_SHORTCUT("scene_tree/rename", p_event)) {
|
if (ED_IS_SHORTCUT("scene_tree/rename", p_event)) {
|
||||||
// Prevent renaming if a button is focused
|
// Prevent renaming if a button or a range is focused
|
||||||
// to avoid conflict with Enter shortcut on macOS
|
// to avoid conflict with Enter shortcut on macOS.
|
||||||
if (!focus_owner || !Object::cast_to<BaseButton>(focus_owner)) {
|
if (focus_owner && (Object::cast_to<BaseButton>(focus_owner) || Object::cast_to<Range>(focus_owner))) {
|
||||||
_tool_selected(TOOL_RENAME);
|
return;
|
||||||
}
|
}
|
||||||
|
_tool_selected(TOOL_RENAME);
|
||||||
#ifdef MODULE_REGEX_ENABLED
|
#ifdef MODULE_REGEX_ENABLED
|
||||||
} else if (ED_IS_SHORTCUT("scene_tree/batch_rename", p_event)) {
|
} else if (ED_IS_SHORTCUT("scene_tree/batch_rename", p_event)) {
|
||||||
_tool_selected(TOOL_BATCH_RENAME);
|
_tool_selected(TOOL_BATCH_RENAME);
|
||||||
|
|||||||
Reference in New Issue
Block a user