mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
Merge pull request #108479 from timothyqiu/static-clipboard
Make editor property clipboard static
This commit is contained in:
commit
356fd8fc62
3 changed files with 9 additions and 10 deletions
|
|
@ -1407,10 +1407,10 @@ Control *EditorProperty::make_custom_tooltip(const String &p_text) const {
|
||||||
void EditorProperty::menu_option(int p_option) {
|
void EditorProperty::menu_option(int p_option) {
|
||||||
switch (p_option) {
|
switch (p_option) {
|
||||||
case MENU_COPY_VALUE: {
|
case MENU_COPY_VALUE: {
|
||||||
InspectorDock::get_inspector_singleton()->set_property_clipboard(object->get(property));
|
EditorInspector::set_property_clipboard(object->get(property));
|
||||||
} break;
|
} break;
|
||||||
case MENU_PASTE_VALUE: {
|
case MENU_PASTE_VALUE: {
|
||||||
emit_changed(property, InspectorDock::get_inspector_singleton()->get_property_clipboard());
|
emit_changed(property, EditorInspector::get_property_clipboard());
|
||||||
} break;
|
} break;
|
||||||
case MENU_COPY_PROPERTY_PATH: {
|
case MENU_COPY_PROPERTY_PATH: {
|
||||||
DisplayServer::get_singleton()->clipboard_set(property_path);
|
DisplayServer::get_singleton()->clipboard_set(property_path);
|
||||||
|
|
@ -5822,7 +5822,7 @@ void EditorInspector::set_property_clipboard(const Variant &p_value) {
|
||||||
property_clipboard = p_value;
|
property_clipboard = p_value;
|
||||||
}
|
}
|
||||||
|
|
||||||
Variant EditorInspector::get_property_clipboard() const {
|
Variant EditorInspector::get_property_clipboard() {
|
||||||
return property_clipboard;
|
return property_clipboard;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -5934,7 +5934,6 @@ EditorInspector::EditorInspector() {
|
||||||
set_process(false);
|
set_process(false);
|
||||||
set_focus_mode(FocusMode::FOCUS_ALL);
|
set_focus_mode(FocusMode::FOCUS_ALL);
|
||||||
property_focusable = -1;
|
property_focusable = -1;
|
||||||
property_clipboard = Variant();
|
|
||||||
|
|
||||||
get_v_scroll_bar()->connect(SceneStringName(value_changed), callable_mp(this, &EditorInspector::_vscroll_changed));
|
get_v_scroll_bar()->connect(SceneStringName(value_changed), callable_mp(this, &EditorInspector::_vscroll_changed));
|
||||||
update_scroll_request = -1;
|
update_scroll_request = -1;
|
||||||
|
|
|
||||||
|
|
@ -38,14 +38,12 @@
|
||||||
|
|
||||||
class AddMetadataDialog;
|
class AddMetadataDialog;
|
||||||
class AcceptDialog;
|
class AcceptDialog;
|
||||||
class ConfirmationDialog;
|
|
||||||
class EditorInspector;
|
class EditorInspector;
|
||||||
class EditorValidationPanel;
|
class EditorValidationPanel;
|
||||||
class HSeparator;
|
class HSeparator;
|
||||||
class LineEdit;
|
class LineEdit;
|
||||||
class MarginContainer;
|
class MarginContainer;
|
||||||
class OptionButton;
|
class OptionButton;
|
||||||
class PanelContainer;
|
|
||||||
class PopupMenu;
|
class PopupMenu;
|
||||||
class SpinBox;
|
class SpinBox;
|
||||||
class StyleBoxFlat;
|
class StyleBoxFlat;
|
||||||
|
|
@ -779,7 +777,8 @@ class EditorInspector : public ScrollContainer {
|
||||||
|
|
||||||
String property_prefix; // Used for sectioned inspector.
|
String property_prefix; // Used for sectioned inspector.
|
||||||
String object_class;
|
String object_class;
|
||||||
Variant property_clipboard;
|
|
||||||
|
static inline Variant property_clipboard;
|
||||||
|
|
||||||
bool restrict_to_basic = false;
|
bool restrict_to_basic = false;
|
||||||
|
|
||||||
|
|
@ -850,6 +849,9 @@ public:
|
||||||
static void initialize_category_theme(EditorInspectorCategory::ThemeCache &p_cache, Control *p_control);
|
static void initialize_category_theme(EditorInspectorCategory::ThemeCache &p_cache, Control *p_control);
|
||||||
static void initialize_property_theme(EditorProperty::ThemeCache &p_cache, Control *p_control);
|
static void initialize_property_theme(EditorProperty::ThemeCache &p_cache, Control *p_control);
|
||||||
|
|
||||||
|
static void set_property_clipboard(const Variant &p_value);
|
||||||
|
static Variant get_property_clipboard();
|
||||||
|
|
||||||
bool is_main_editor_inspector() const;
|
bool is_main_editor_inspector() const;
|
||||||
String get_selected_path() const;
|
String get_selected_path() const;
|
||||||
|
|
||||||
|
|
@ -908,8 +910,6 @@ public:
|
||||||
void set_use_deletable_properties(bool p_enabled);
|
void set_use_deletable_properties(bool p_enabled);
|
||||||
|
|
||||||
void set_restrict_to_basic_settings(bool p_restrict);
|
void set_restrict_to_basic_settings(bool p_restrict);
|
||||||
void set_property_clipboard(const Variant &p_value);
|
|
||||||
Variant get_property_clipboard() const;
|
|
||||||
|
|
||||||
EditorInspector();
|
EditorInspector();
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,7 @@
|
||||||
|
|
||||||
class CheckBox;
|
class CheckBox;
|
||||||
class ColorPickerButton;
|
class ColorPickerButton;
|
||||||
|
class ConfirmationDialog;
|
||||||
class CreateDialog;
|
class CreateDialog;
|
||||||
class EditorFileDialog;
|
class EditorFileDialog;
|
||||||
class EditorLocaleDialog;
|
class EditorLocaleDialog;
|
||||||
|
|
@ -41,7 +42,6 @@ class EditorResourcePicker;
|
||||||
class EditorSpinSlider;
|
class EditorSpinSlider;
|
||||||
class EditorVariantTypePopupMenu;
|
class EditorVariantTypePopupMenu;
|
||||||
class MenuButton;
|
class MenuButton;
|
||||||
class PropertySelector;
|
|
||||||
class SceneTreeDialog;
|
class SceneTreeDialog;
|
||||||
class TextEdit;
|
class TextEdit;
|
||||||
class TextureButton;
|
class TextureButton;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue