From 841a9ef820925b6960e92a86f4482d1654e66897 Mon Sep 17 00:00:00 2001 From: kobewi Date: Tue, 7 Dec 2021 17:15:18 +0100 Subject: ScrollContainer's scrollbar visibility is now enum --- editor/plugins/animation_tree_editor_plugin.cpp | 3 +-- editor/plugins/asset_library_editor_plugin.cpp | 9 +++------ editor/plugins/sprite_2d_editor_plugin.cpp | 2 -- editor/plugins/sprite_frames_editor_plugin.cpp | 2 -- editor/plugins/theme_editor_plugin.cpp | 6 +++--- editor/plugins/theme_editor_preview.cpp | 2 -- editor/plugins/tiles/tile_set_atlas_source_editor.cpp | 6 +++--- .../plugins/tiles/tile_set_scenes_collection_source_editor.cpp | 6 +++--- 8 files changed, 13 insertions(+), 23 deletions(-) (limited to 'editor/plugins') diff --git a/editor/plugins/animation_tree_editor_plugin.cpp b/editor/plugins/animation_tree_editor_plugin.cpp index 6c5606fbfd..258eb9005f 100644 --- a/editor/plugins/animation_tree_editor_plugin.cpp +++ b/editor/plugins/animation_tree_editor_plugin.cpp @@ -226,8 +226,7 @@ AnimationTreeEditor::AnimationTreeEditor() { AnimationNodeAnimation::get_editable_animation_list = get_animation_list; path_edit = memnew(ScrollContainer); add_child(path_edit); - path_edit->set_enable_h_scroll(true); - path_edit->set_enable_v_scroll(false); + path_edit->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); path_hb = memnew(HBoxContainer); path_edit->add_child(path_hb); path_hb->add_child(memnew(Label(TTR("Path:")))); diff --git a/editor/plugins/asset_library_editor_plugin.cpp b/editor/plugins/asset_library_editor_plugin.cpp index 1a216b3862..5cfd7525e5 100644 --- a/editor/plugins/asset_library_editor_plugin.cpp +++ b/editor/plugins/asset_library_editor_plugin.cpp @@ -288,8 +288,7 @@ EditorAssetLibraryItemDescription::EditorAssetLibraryItemDescription() { previews = memnew(ScrollContainer); previews_bg->add_child(previews); - previews->set_enable_v_scroll(false); - previews->set_enable_h_scroll(true); + previews->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); preview_hb = memnew(HBoxContainer); preview_hb->set_v_size_flags(Control::SIZE_EXPAND_FILL); @@ -1431,8 +1430,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { library_scroll_bg->set_v_size_flags(Control::SIZE_EXPAND_FILL); library_scroll = memnew(ScrollContainer); - library_scroll->set_enable_v_scroll(true); - library_scroll->set_enable_h_scroll(false); + library_scroll->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); library_scroll_bg->add_child(library_scroll); @@ -1499,8 +1497,7 @@ EditorAssetLibrary::EditorAssetLibrary(bool p_templates_only) { set_process_unhandled_key_input(true); // Global shortcuts since there is no main element to be focused. downloads_scroll = memnew(ScrollContainer); - downloads_scroll->set_enable_h_scroll(true); - downloads_scroll->set_enable_v_scroll(false); + downloads_scroll->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); library_main->add_child(downloads_scroll); downloads_hb = memnew(HBoxContainer); downloads_scroll->add_child(downloads_hb); diff --git a/editor/plugins/sprite_2d_editor_plugin.cpp b/editor/plugins/sprite_2d_editor_plugin.cpp index eb5e527640..48b10d5a8b 100644 --- a/editor/plugins/sprite_2d_editor_plugin.cpp +++ b/editor/plugins/sprite_2d_editor_plugin.cpp @@ -526,8 +526,6 @@ Sprite2DEditor::Sprite2DEditor() { debug_uv_dialog->add_child(vb); ScrollContainer *scroll = memnew(ScrollContainer); scroll->set_custom_minimum_size(Size2(800, 500) * EDSCALE); - scroll->set_enable_h_scroll(true); - scroll->set_enable_v_scroll(true); vb->add_margin_child(TTR("Preview:"), scroll, true); debug_uv = memnew(Control); debug_uv->connect("draw", callable_mp(this, &Sprite2DEditor::_debug_uv_draw)); diff --git a/editor/plugins/sprite_frames_editor_plugin.cpp b/editor/plugins/sprite_frames_editor_plugin.cpp index d455f4618b..316ef7b195 100644 --- a/editor/plugins/sprite_frames_editor_plugin.cpp +++ b/editor/plugins/sprite_frames_editor_plugin.cpp @@ -1238,8 +1238,6 @@ SpriteFramesEditor::SpriteFramesEditor() { split_sheet_preview->connect("gui_input", callable_mp(this, &SpriteFramesEditor::_sheet_preview_input)); split_sheet_scroll = memnew(ScrollContainer); - split_sheet_scroll->set_enable_h_scroll(true); - split_sheet_scroll->set_enable_v_scroll(true); split_sheet_scroll->connect("gui_input", callable_mp(this, &SpriteFramesEditor::_sheet_scroll_input)); split_sheet_panel->add_child(split_sheet_scroll); CenterContainer *cc = memnew(CenterContainer); diff --git a/editor/plugins/theme_editor_plugin.cpp b/editor/plugins/theme_editor_plugin.cpp index f62dbfc2cc..a13cbfa515 100644 --- a/editor/plugins/theme_editor_plugin.cpp +++ b/editor/plugins/theme_editor_plugin.cpp @@ -941,7 +941,7 @@ ThemeItemImportTree::ThemeItemImportTree() { ScrollContainer *import_bulk_sc = memnew(ScrollContainer); import_bulk_sc->set_custom_minimum_size(Size2(260.0, 0.0) * EDSCALE); - import_bulk_sc->set_enable_h_scroll(false); + import_bulk_sc->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); import_main_hb->add_child(import_bulk_sc); VBoxContainer *import_bulk_vb = memnew(VBoxContainer); import_bulk_vb->set_h_size_flags(Control::SIZE_EXPAND_FILL); @@ -2113,7 +2113,7 @@ VBoxContainer *ThemeTypeEditor::_create_item_list(Theme::DataType p_data_type) { ScrollContainer *items_sc = memnew(ScrollContainer); items_sc->set_v_size_flags(SIZE_EXPAND_FILL); - items_sc->set_enable_h_scroll(false); + items_sc->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); items_tab->add_child(items_sc); VBoxContainer *items_list = memnew(VBoxContainer); items_list->set_h_size_flags(SIZE_EXPAND_FILL); @@ -3102,7 +3102,7 @@ ThemeTypeEditor::ThemeTypeEditor() { ScrollContainer *type_settings_sc = memnew(ScrollContainer); type_settings_sc->set_v_size_flags(SIZE_EXPAND_FILL); - type_settings_sc->set_enable_h_scroll(false); + type_settings_sc->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); type_settings_tab->add_child(type_settings_sc); VBoxContainer *type_settings_list = memnew(VBoxContainer); type_settings_list->set_h_size_flags(SIZE_EXPAND_FILL); diff --git a/editor/plugins/theme_editor_preview.cpp b/editor/plugins/theme_editor_preview.cpp index 7340c17b6e..52155a7136 100644 --- a/editor/plugins/theme_editor_preview.cpp +++ b/editor/plugins/theme_editor_preview.cpp @@ -228,8 +228,6 @@ ThemeEditorPreview::ThemeEditorPreview() { add_child(preview_body); preview_container = memnew(ScrollContainer); - preview_container->set_enable_v_scroll(true); - preview_container->set_enable_h_scroll(true); preview_body->add_child(preview_container); MarginContainer *preview_root = memnew(MarginContainer); diff --git a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp index a48c0e795c..436fea77d7 100644 --- a/editor/plugins/tiles/tile_set_atlas_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_atlas_source_editor.cpp @@ -2321,7 +2321,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { // Middle panel. ScrollContainer *middle_panel = memnew(ScrollContainer); - middle_panel->set_enable_h_scroll(false); + middle_panel->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); middle_panel->set_custom_minimum_size(Size2i(200, 0) * EDSCALE); split_container_right_side->add_child(middle_panel); @@ -2339,7 +2339,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { tile_inspector = memnew(EditorInspector); tile_inspector->set_undo_redo(undo_redo); - tile_inspector->set_enable_v_scroll(false); + tile_inspector->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); tile_inspector->edit(tile_proxy_object); tile_inspector->set_use_folding(true); tile_inspector->connect("property_selected", callable_mp(this, &TileSetAtlasSourceEditor::_inspector_property_selected)); @@ -2385,7 +2385,7 @@ TileSetAtlasSourceEditor::TileSetAtlasSourceEditor() { atlas_source_inspector = memnew(EditorInspector); atlas_source_inspector->set_undo_redo(undo_redo); - atlas_source_inspector->set_enable_v_scroll(false); + atlas_source_inspector->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); atlas_source_inspector->edit(atlas_source_proxy_object); middle_vbox_container->add_child(atlas_source_inspector); diff --git a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp index d687d9651d..035fe57d95 100644 --- a/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp +++ b/editor/plugins/tiles/tile_set_scenes_collection_source_editor.cpp @@ -459,7 +459,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() { // Middle panel. ScrollContainer *middle_panel = memnew(ScrollContainer); - middle_panel->set_enable_h_scroll(false); + middle_panel->set_horizontal_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); middle_panel->set_custom_minimum_size(Size2i(200, 0) * EDSCALE); split_container_right_side->add_child(middle_panel); @@ -477,7 +477,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() { scenes_collection_source_inspector = memnew(EditorInspector); scenes_collection_source_inspector->set_undo_redo(undo_redo); - scenes_collection_source_inspector->set_enable_v_scroll(false); + scenes_collection_source_inspector->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); scenes_collection_source_inspector->edit(scenes_collection_source_proxy_object); middle_vbox_container->add_child(scenes_collection_source_inspector); @@ -493,7 +493,7 @@ TileSetScenesCollectionSourceEditor::TileSetScenesCollectionSourceEditor() { tile_inspector = memnew(EditorInspector); tile_inspector->set_undo_redo(undo_redo); - tile_inspector->set_enable_v_scroll(false); + tile_inspector->set_vertical_scroll_mode(ScrollContainer::SCROLL_MODE_DISABLED); tile_inspector->edit(tile_proxy_object); tile_inspector->set_use_folding(true); middle_vbox_container->add_child(tile_inspector); -- cgit v1.2.3