mirror of
https://github.com/godotengine/godot.git
synced 2025-12-07 13:49:54 +00:00
Merge pull request #113296 from KoBeWi/soft_open_gently
Fix dock opening focus
This commit is contained in:
commit
6b0a74073c
4 changed files with 11 additions and 5 deletions
|
|
@ -77,6 +77,7 @@
|
|||
<return type="void" />
|
||||
<description>
|
||||
Opens the dock. It will appear in the last used dock slot. If the dock has no default slot, it will be opened floating.
|
||||
[b]Note:[/b] This does not focus the dock. If you want to open and focus the dock, use [method make_visible].
|
||||
</description>
|
||||
</method>
|
||||
</methods>
|
||||
|
|
|
|||
|
|
@ -111,7 +111,7 @@ EditorDock::EditorDock() {
|
|||
|
||||
void EditorDock::open() {
|
||||
if (!is_open) {
|
||||
EditorDockManager::get_singleton()->open_dock(this);
|
||||
EditorDockManager::get_singleton()->open_dock(this, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -373,7 +373,7 @@ void TileMapEditorPlugin::_update_tile_map() {
|
|||
Ref<TileSet> tile_set = edited_layer->get_tile_set();
|
||||
if (tile_set.is_valid() && tile_set_id != tile_set->get_instance_id()) {
|
||||
tile_set_plugin_singleton->edit(tile_set.ptr());
|
||||
tile_set_plugin_singleton->make_visible(true);
|
||||
tile_set_plugin_singleton->make_visible_no_focus();
|
||||
tile_set_id = tile_set->get_instance_id();
|
||||
} else if (tile_set.is_null()) {
|
||||
tile_set_plugin_singleton->edit(nullptr);
|
||||
|
|
@ -410,7 +410,7 @@ void TileMapEditorPlugin::_edit_tile_map_layer(TileMapLayer *p_tile_map_layer, b
|
|||
Ref<TileSet> tile_set = p_tile_map_layer->get_tile_set();
|
||||
if (tile_set.is_valid()) {
|
||||
tile_set_plugin_singleton->edit(tile_set.ptr());
|
||||
tile_set_plugin_singleton->make_visible(true);
|
||||
tile_set_plugin_singleton->make_visible_no_focus();
|
||||
tile_set_id = tile_set->get_instance_id();
|
||||
} else {
|
||||
tile_set_plugin_singleton->edit(nullptr);
|
||||
|
|
@ -479,7 +479,7 @@ bool TileMapEditorPlugin::handles(Object *p_object) const {
|
|||
|
||||
void TileMapEditorPlugin::make_visible(bool p_visible) {
|
||||
if (p_visible) {
|
||||
editor->open();
|
||||
editor->make_visible();
|
||||
} else {
|
||||
editor->close();
|
||||
TileSetEditor::get_singleton()->close();
|
||||
|
|
@ -533,12 +533,16 @@ bool TileSetEditorPlugin::handles(Object *p_object) const {
|
|||
|
||||
void TileSetEditorPlugin::make_visible(bool p_visible) {
|
||||
if (p_visible) {
|
||||
editor->open();
|
||||
editor->make_visible();
|
||||
} else {
|
||||
editor->close();
|
||||
}
|
||||
}
|
||||
|
||||
void TileSetEditorPlugin::make_visible_no_focus() {
|
||||
editor->open();
|
||||
}
|
||||
|
||||
ObjectID TileSetEditorPlugin::get_edited_tileset() const {
|
||||
return edited_tileset;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -165,6 +165,7 @@ public:
|
|||
virtual bool handles(Object *p_object) const override;
|
||||
virtual void make_visible(bool p_visible) override;
|
||||
|
||||
void make_visible_no_focus();
|
||||
ObjectID get_edited_tileset() const;
|
||||
|
||||
TileSetEditorPlugin();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue