diff --git a/project.godot b/project.godot index d28280b..3820b87 100644 --- a/project.godot +++ b/project.godot @@ -37,7 +37,7 @@ HandlerGUI="*res://src/autoload/HandlerGUI.gd" window/size/viewport_width=720 window/size/viewport_height=1280 window/energy_saving/keep_screen_on=false -window/handheld/orientation=1 +window/handheld/orientation=6 mouse_cursor/tooltip_position_offset=Vector2(0, 10) [editor_plugins] diff --git a/src/autoload/Configs.gd b/src/autoload/Configs.gd index 0aad1fc..0e3481c 100644 --- a/src/autoload/Configs.gd +++ b/src/autoload/Configs.gd @@ -35,9 +35,32 @@ signal tab_removed signal tab_selected(index: int) @warning_ignore("unused_signal") signal layout_changed +@warning_ignore("unused_signal") +signal orientation_changed var current_sdk: int = -1 +enum orientation {PORTRAIT, LANDSCAPE} +var current_orientation := orientation.PORTRAIT + +func _ready() -> void: + get_tree().root.size_changed.connect(check_orientation) + +func check_orientation(): + var width = DisplayServer.window_get_size().x + var height = DisplayServer.window_get_size().y + + var new_orientation: orientation + if width > height: + new_orientation = orientation.LANDSCAPE + else: + new_orientation = orientation.PORTRAIT + + if new_orientation != current_orientation: + current_orientation = new_orientation + orientation_changed.emit() + + const savedata_path = "user://savedata.tres" var savedata: SaveData: set(new_value): diff --git a/src/autoload/HandlerGUI.gd b/src/autoload/HandlerGUI.gd index 326ed82..4a1b718 100644 --- a/src/autoload/HandlerGUI.gd +++ b/src/autoload/HandlerGUI.gd @@ -8,6 +8,7 @@ const DonateMenuScene = preload("res://src/ui_parts/donate_menu.tscn") const UpdateMenuScene = preload("res://src/ui_parts/update_menu.tscn") const ExportMenuScene = preload("res://src/ui_parts/export_menu.tscn") const ShortcutPanelScene = preload("res://src/ui_parts/shortcut_panel.tscn") +const TabsPanel = preload("res://src/ui_parts/tabs_panel.tscn") # Menus should be added with add_menu() and removed by being freed. # To add them as modals that don't hide the previous one, use add_dialog(). @@ -15,6 +16,7 @@ var menu_stack: Array[ColorRect] var popup_stack: Array[Control] var shortcut_panel: PanelContainer +var tabs_panel: PanelContainer func _enter_tree() -> void: var window := get_window() @@ -33,6 +35,14 @@ func _ready() -> void: shortcut_panel = ShortcutPanelScene.instantiate() get_tree().root.add_child(shortcut_panel) + + tabs_panel = TabsPanel.instantiate() + var overlay_ref := ColorRect.new() + overlay_ref.color = Color(0, 0, 0, 0.4) + overlay_ref.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) + overlay_ref.hide() + get_tree().root.add_child.call_deferred(overlay_ref) + overlay_ref.add_child(tabs_panel) func _notification(what: int) -> void: if what == NOTIFICATION_WM_ABOUT: diff --git a/src/config_classes/SaveData.gd b/src/config_classes/SaveData.gd index ad27624..ad24193 100644 --- a/src/config_classes/SaveData.gd +++ b/src/config_classes/SaveData.gd @@ -59,11 +59,11 @@ func validate() -> void: _active_tab_index = _active_tab_index # Run the setter. # End of the method, would need to be rewritten if more things need validation. - for location in [LayoutLocation.TOP_LEFT, LayoutLocation.BOTTOM_LEFT]: + for location in [LayoutLocation.SIDE_PANEL_TOP, LayoutLocation.SIDE_PANEL_BOTTOM]: if _layout.has(location) and not _layout[location].is_empty(): return _layout = { - LayoutLocation.TOP_LEFT: [Utils.LayoutPart.INSPECTOR, Utils.LayoutPart.CODE_EDITOR] + LayoutLocation.SIDE_PANEL_TOP: [Utils.LayoutPart.INSPECTOR, Utils.LayoutPart.CODE_EDITOR] } @@ -755,7 +755,7 @@ func move_tab(old_idx: int, new_idx: int) -> void: Configs.tabs_changed.emit() -enum LayoutLocation {NONE, EXCLUDED, TOP_LEFT, BOTTOM_LEFT} +enum LayoutLocation { NONE, EXCLUDED, SIDE_PANEL_TOP, SIDE_PANEL_BOTTOM } @export var _layout: Dictionary[LayoutLocation, Array]: # Array[Utils.LayoutPart] set(new_value): @@ -840,14 +840,14 @@ func get_layout_part_index(part: Utils.LayoutPart) -> int: main_splitter_offset = new_value emit_changed() -@export var top_vertical_splitter_offset := -240: +@export var side_panel_splitter_offset := -240: set(new_value): # Validation if is_nan(new_value): new_value = 0 # Main part - if top_vertical_splitter_offset != new_value: - top_vertical_splitter_offset = new_value + if side_panel_splitter_offset != new_value: + side_panel_splitter_offset = new_value emit_changed() diff --git a/src/ui_parts/display.gd b/src/ui_parts/display.gd index 831a6bc..355f31d 100644 --- a/src/ui_parts/display.gd +++ b/src/ui_parts/display.gd @@ -1,7 +1,6 @@ extends VBoxContainer const NumberEdit = preload("res://src/ui_widgets/number_edit.gd") -const TabsPanel = preload("res://src/ui_parts/tabs_panel.tscn") @onready var viewport: SubViewport = %Viewport @onready var reference_texture: TextureRect = %Viewport/ReferenceTexture @@ -38,14 +37,6 @@ func _ready() -> void: update_theme() update_snap_config() get_window().window_input.connect(_update_input_debug) - - tabs_panel = TabsPanel.instantiate() - var overlay_ref := ColorRect.new() - overlay_ref.color = Color(0, 0, 0, 0.4) - overlay_ref.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT) - overlay_ref.hide() - get_tree().root.add_child.call_deferred(overlay_ref) - overlay_ref.add_child(tabs_panel) func update_translations() -> void: %LeftMenu/Visuals.tooltip_text = Translator.translate("Visuals") @@ -59,10 +50,12 @@ func update_theme() -> void: var frame := StyleBoxFlat.new() frame.draw_center = false - frame.border_width_top = 2 + if Configs.current_orientation == Configs.orientation.PORTRAIT: + frame.border_width_top = 2 + else: + frame.border_width_left = 2 frame.border_color = ThemeUtils.connected_button_border_color_pressed - frame.content_margin_left = 2.0 - frame.content_margin_top = 2.0 + frame.set_content_margin_all(2.0) viewport_panel.add_theme_stylebox_override("panel", frame) func update_snap_config() -> void: @@ -174,7 +167,7 @@ func _update_input_debug(event: InputEvent) -> void: func show_tabs_panel() -> void: if should_refresh_tabs: - tabs_panel.refresh_tabs() + HandlerGUI.tabs_panel.refresh_tabs() should_refresh_tabs = false - tabs_panel.get_parent().show() - tabs_panel.animate_in() + HandlerGUI.tabs_panel.get_parent().show() + HandlerGUI.tabs_panel.animate_in() diff --git a/src/ui_parts/display.tscn b/src/ui_parts/display.tscn index 98e7f6e..2c4e66f 100644 --- a/src/ui_parts/display.tscn +++ b/src/ui_parts/display.tscn @@ -51,7 +51,7 @@ unique_name_in_owner = true disable_3d = true handle_input_locally = false gui_snap_controls_to_pixels = false -size = Vector2i(716, 1248) +size = Vector2i(720, 1249) size_2d_override_stretch = true render_target_update_mode = 4 script = ExtResource("9_4xrk7") diff --git a/src/ui_parts/editor_scene.gd b/src/ui_parts/editor_scene.gd index b34bae9..77c92a0 100644 --- a/src/ui_parts/editor_scene.gd +++ b/src/ui_parts/editor_scene.gd @@ -7,14 +7,24 @@ const ViewportScene = preload("res://src/ui_parts/display.tscn") @onready var panel_container: PanelContainer = $PanelContainer +var main_splitter: SplitContainer + + func _ready() -> void: Configs.theme_changed.connect(update_theme) Configs.layout_changed.connect(update_layout) + Configs.orientation_changed.connect(update_orientation) update_layout() update_theme() var version = JavaClassWrapper.wrap("android.os.Build$VERSION") if version: Configs.current_sdk = version.SDK_INT +func update_orientation(): + if Configs.current_orientation == Configs.orientation.PORTRAIT: + main_splitter.vertical = true + else: + main_splitter.vertical = false + func update_theme() -> void: var stylebox := StyleBoxFlat.new() stylebox.bg_color = ThemeUtils.overlay_panel_inner_color @@ -26,54 +36,53 @@ func update_layout() -> void: for child in panel_container.get_children(): child.queue_free() - var top_left := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.TOP_LEFT) - var bottom_left := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.BOTTOM_LEFT) + var side_panel_top := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_TOP) + var side_panel_bottom := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_BOTTOM) - # Set up the horizontal splitter. - var main_splitter := VSplitContainer.new() - main_splitter.size_flags_horizontal = Control.SIZE_FILL + # Set up the main splitter. + main_splitter = SplitContainer.new() + main_splitter.vertical = true main_splitter.dragger_visibility = SplitContainer.DRAGGER_HIDDEN_COLLAPSED main_splitter.touch_dragger_enabled = true main_splitter.split_offset = Configs.savedata.main_splitter_offset main_splitter.dragged.connect(_on_main_splitter_dragged) panel_container.add_child(main_splitter) - var top_margin_container := MarginContainer.new() - top_margin_container.custom_minimum_size.x = 350 - top_margin_container.begin_bulk_theme_override() - top_margin_container.add_theme_constant_override("margin_top", 6) - top_margin_container.add_theme_constant_override("margin_bottom", 3) - top_margin_container.add_theme_constant_override("margin_left", 6) - top_margin_container.add_theme_constant_override("margin_right", 6) - top_margin_container.end_bulk_theme_override() - main_splitter.add_child(top_margin_container) + var side_panel_margin_container := MarginContainer.new() + side_panel_margin_container.begin_bulk_theme_override() + side_panel_margin_container.add_theme_constant_override("margin_top", 6) + side_panel_margin_container.add_theme_constant_override("margin_bottom", 3) + side_panel_margin_container.add_theme_constant_override("margin_left", 6) + side_panel_margin_container.add_theme_constant_override("margin_right", 6) + side_panel_margin_container.end_bulk_theme_override() + main_splitter.add_child(side_panel_margin_container) - var bottom_margin_container := MarginContainer.new() - bottom_margin_container.add_theme_constant_override("margin_top", 3) - bottom_margin_container.add_child(create_layout_node(Utils.LayoutPart.VIEWPORT)) - main_splitter.add_child(bottom_margin_container) + var main_view_margin_container := MarginContainer.new() + main_view_margin_container.add_theme_constant_override("margin_top", 3) + main_view_margin_container.add_child(create_layout_node(Utils.LayoutPart.VIEWPORT)) + main_splitter.add_child(main_view_margin_container) - var left_vbox := VBoxContainer.new() - left_vbox.add_theme_constant_override("separation", 6) - top_margin_container.add_child(left_vbox) + var side_panel_vbox := VBoxContainer.new() + side_panel_vbox.add_theme_constant_override("separation", 6) + side_panel_margin_container.add_child(side_panel_vbox) var global_actions := GlobalActionsScene.instantiate() - left_vbox.add_child(global_actions) + side_panel_vbox.add_child(global_actions) - if not top_left.is_empty() and not bottom_left.is_empty(): + if not side_panel_top.is_empty() and not side_panel_bottom.is_empty(): # Layout parts both on top and on the bottom. - var top_vertical_split_container := VSplitContainer.new() - top_vertical_split_container.size_flags_vertical = Control.SIZE_EXPAND_FILL - top_vertical_split_container.dragger_visibility = SplitContainer.DRAGGER_HIDDEN_COLLAPSED - top_vertical_split_container.touch_dragger_enabled = true - top_vertical_split_container.split_offset = Configs.savedata.top_vertical_splitter_offset - top_vertical_split_container.dragged.connect(_on_top_vertical_splitter_dragged) - top_vertical_split_container.add_child(create_layout_node(top_left[0])) - top_vertical_split_container.add_child(create_layout_node(bottom_left[0])) - left_vbox.add_child(top_vertical_split_container) - elif top_left.size() == 2 or bottom_left.size() == 2: + var side_panel_split_container := VSplitContainer.new() + side_panel_split_container.size_flags_vertical = Control.SIZE_EXPAND_FILL + side_panel_split_container.dragger_visibility = SplitContainer.DRAGGER_HIDDEN_COLLAPSED + side_panel_split_container.touch_dragger_enabled = true + side_panel_split_container.split_offset = Configs.savedata.side_panel_splitter_offset + side_panel_split_container.dragged.connect(_on_side_panel_splitter_dragged) + side_panel_split_container.add_child(create_layout_node(side_panel_top[0])) + side_panel_split_container.add_child(create_layout_node(side_panel_bottom[0])) + side_panel_vbox.add_child(side_panel_split_container) + elif side_panel_top.size() == 2 or side_panel_bottom.size() == 2: # Tabs for the different layout parts. - var layout_parts := top_left if bottom_left.is_empty() else bottom_left + var layout_parts := side_panel_top if side_panel_bottom.is_empty() else side_panel_bottom var vbox := VBoxContainer.new() vbox.size_flags_vertical = Control.SIZE_EXPAND_FILL var buttons_hbox := HBoxContainer.new() @@ -114,19 +123,19 @@ func update_layout() -> void: if i == 0: btn.button_pressed = true layout_nodes[part].show() - left_vbox.add_child(vbox) + side_panel_vbox.add_child(vbox) else: # Layout parts disabled. - if not top_left.is_empty(): - left_vbox.add_child(create_layout_node(top_left[0])) - elif not bottom_left.is_empty(): - left_vbox.add_child(create_layout_node(bottom_left[0])) + if not side_panel_top.is_empty(): + side_panel_vbox.add_child(create_layout_node(side_panel_top[0])) + elif not side_panel_bottom.is_empty(): + side_panel_vbox.add_child(create_layout_node(side_panel_bottom[0])) func _on_main_splitter_dragged(offset: int) -> void: Configs.savedata.main_splitter_offset = offset -func _on_top_vertical_splitter_dragged(offset: int) -> void: - Configs.savedata.top_vertical_splitter_offset = offset +func _on_side_panel_splitter_dragged(offset: int) -> void: + Configs.savedata.side_panel_splitter_offset = offset func create_layout_node(layout_part: Utils.LayoutPart) -> Node: diff --git a/src/ui_parts/inspector.tscn b/src/ui_parts/inspector.tscn index c30079f..6cbae85 100644 --- a/src/ui_parts/inspector.tscn +++ b/src/ui_parts/inspector.tscn @@ -33,7 +33,7 @@ theme_override_constants/h_separation = 4 icon = ExtResource("3_vo6hf") [node name="ElementContainer" type="Control" parent="."] -custom_minimum_size = Vector2(0, 150) +custom_minimum_size = Vector2(340, 150) layout_mode = 2 size_flags_vertical = 3 script = ExtResource("3_qeptj") diff --git a/src/ui_parts/layout_popup.gd b/src/ui_parts/layout_popup.gd index a4e3104..9296879 100644 --- a/src/ui_parts/layout_popup.gd +++ b/src/ui_parts/layout_popup.gd @@ -205,7 +205,7 @@ func _drop_data(_at_position: Vector2, data: Variant) -> void: Configs.savedata.set_layout_parts(proposed_drop_location_pivot, parts) DropDirection.BELOW: var bottom_left_parts := Configs.savedata.get_layout_parts( - SaveData.LayoutLocation.BOTTOM_LEFT) + SaveData.LayoutLocation.SIDE_PANEL_BOTTOM) if not bottom_left_parts.is_empty(): # If everything is on the bottom, then move them to the top so the # new dragged layout part can be on the bottom. @@ -213,18 +213,18 @@ func _drop_data(_at_position: Vector2, data: Variant) -> void: # to be valid, then the dragged part should be the only one on the top side. # In either case, the stuff on the bottom should be moved to the top, # and the dragged one should move to the bottom. - Configs.savedata.set_layout_parts(SaveData.LayoutLocation.TOP_LEFT, + Configs.savedata.set_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_TOP, bottom_left_parts, false) - Configs.savedata.set_layout_parts(SaveData.LayoutLocation.BOTTOM_LEFT, + Configs.savedata.set_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_BOTTOM, [dragged_data.layout_part]) DropDirection.ABOVE: # Same logic as above, but with top and bottom flipped. var top_left_parts := Configs.savedata.get_layout_parts( - SaveData.LayoutLocation.TOP_LEFT) + SaveData.LayoutLocation.SIDE_PANEL_TOP) if not top_left_parts.is_empty(): - Configs.savedata.set_layout_parts(SaveData.LayoutLocation.BOTTOM_LEFT, + Configs.savedata.set_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_BOTTOM, top_left_parts, false) - Configs.savedata.set_layout_parts(SaveData.LayoutLocation.TOP_LEFT, + Configs.savedata.set_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_TOP, [dragged_data.layout_part]) clear_proposed_drop() @@ -234,8 +234,8 @@ func _can_drop_data(at_position: Vector2, data: Variant) -> bool: if not data == dragged_data: return false - var top_left_parts := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.TOP_LEFT) - var bottom_left_parts := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.BOTTOM_LEFT) + var top_left_parts := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_TOP) + var bottom_left_parts := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_BOTTOM) var is_dragged_part_the_only_top_left := (top_left_parts == [dragged_data.layout_part]) var is_dragged_part_the_only_bottom_left := (bottom_left_parts == [dragged_data.layout_part]) @@ -248,10 +248,10 @@ func _can_drop_data(at_position: Vector2, data: Variant) -> bool: if at_position.y < lerpf(section_area.position.y, section_area.end.y, 0.25) and\ - ((section == SaveData.LayoutLocation.TOP_LEFT and\ + ((section == SaveData.LayoutLocation.SIDE_PANEL_TOP and\ not is_dragged_part_the_only_top_left and (bottom_left_parts.is_empty() or\ is_dragged_part_the_only_bottom_left)) or\ - (section == SaveData.LayoutLocation.BOTTOM_LEFT and top_left_parts.is_empty() and\ + (section == SaveData.LayoutLocation.SIDE_PANEL_BOTTOM and top_left_parts.is_empty() and\ not is_dragged_part_the_only_top_left)): # Hovering over the top side of the section, when one of the following is true: # Case 1: The section is top left, and there's either nothing on the bottom left, @@ -261,10 +261,10 @@ func _can_drop_data(at_position: Vector2, data: Variant) -> bool: proposed_drop_location_direction = DropDirection.ABOVE proposed_drop_idx = -1 elif at_position.y > lerpf(section_area.position.y, section_area.end.y, 0.75) and\ - ((section == SaveData.LayoutLocation.BOTTOM_LEFT and\ + ((section == SaveData.LayoutLocation.SIDE_PANEL_BOTTOM and\ not is_dragged_part_the_only_bottom_left and (top_left_parts.is_empty() or\ is_dragged_part_the_only_top_left)) or\ - (section == SaveData.LayoutLocation.TOP_LEFT and bottom_left_parts.is_empty() and\ + (section == SaveData.LayoutLocation.SIDE_PANEL_TOP and bottom_left_parts.is_empty() and\ not is_dragged_part_the_only_bottom_left)): # Same logic as the previous big condition, but top and bottom are flipped. proposed_drop_location_direction = DropDirection.BELOW @@ -345,8 +345,8 @@ func update_areas() -> void: for child in get_children(): child.queue_free() - var top_left := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.TOP_LEFT) - var bottom_left := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.BOTTOM_LEFT) + var top_left := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_TOP) + var bottom_left := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.SIDE_PANEL_BOTTOM) var excluded := Configs.savedata.get_layout_parts(SaveData.LayoutLocation.EXCLUDED) var width := size.x - PANEL_MARGIN * 2 @@ -358,21 +358,21 @@ func update_areas() -> void: Rect2(PANEL_MARGIN, size.x * 0.75, 160, PART_UI_SIZE + 8) if not top_left.is_empty() and not bottom_left.is_empty(): - section_areas[SaveData.LayoutLocation.TOP_LEFT] =\ + section_areas[SaveData.LayoutLocation.SIDE_PANEL_TOP] =\ Rect2(included_rect.position, included_rect.size * Vector2(0.5, 0.5)) - section_areas[SaveData.LayoutLocation.BOTTOM_LEFT] =\ + section_areas[SaveData.LayoutLocation.SIDE_PANEL_BOTTOM] =\ Rect2(included_rect.position + included_rect.size * Vector2(0.0, 0.5), included_rect.size * Vector2(0.5, 0.5)) elif bottom_left.is_empty(): - section_areas[SaveData.LayoutLocation.TOP_LEFT] =\ + section_areas[SaveData.LayoutLocation.SIDE_PANEL_TOP] =\ Rect2(included_rect.position, included_rect.size * Vector2(0.5, 1.0)) elif top_left.is_empty(): - section_areas[SaveData.LayoutLocation.BOTTOM_LEFT] =\ + section_areas[SaveData.LayoutLocation.SIDE_PANEL_BOTTOM] =\ Rect2(included_rect.position, included_rect.size * Vector2(0.5, 1.0)) if not top_left.is_empty(): var top_left_count := top_left.size() - var top_left_rect_center := section_areas[SaveData.LayoutLocation.TOP_LEFT].\ + var top_left_rect_center := section_areas[SaveData.LayoutLocation.SIDE_PANEL_TOP].\ get_center() for i in top_left_count: layout_part_areas[top_left[i]] = Rect2(top_left_rect_center.x -\ @@ -381,7 +381,7 @@ func update_areas() -> void: if not bottom_left.is_empty(): var bottom_left_count := bottom_left.size() - var bottom_left_rect_center := section_areas[SaveData.LayoutLocation.BOTTOM_LEFT].\ + var bottom_left_rect_center := section_areas[SaveData.LayoutLocation.SIDE_PANEL_BOTTOM].\ get_center() for i in bottom_left_count: layout_part_areas[bottom_left[i]] = Rect2(bottom_left_rect_center.x -\ diff --git a/src/ui_parts/settings_menu.gd b/src/ui_parts/settings_menu.gd index 091d044..9b710a6 100644 --- a/src/ui_parts/settings_menu.gd +++ b/src/ui_parts/settings_menu.gd @@ -28,6 +28,9 @@ func _ready() -> void: close_button.pressed.connect(queue_free) Configs.language_changed.connect(setup_everything) + change_orientation() + Configs.orientation_changed.connect(change_orientation) + scroll_container.get_v_scroll_bar().visibility_changed.connect(adjust_right_margin) adjust_right_margin() @@ -40,6 +43,14 @@ func _ready() -> void: Configs.savedata.editor_formatter.changed_deferred.connect(show_formatter.bind("editor")) Configs.savedata.export_formatter.changed_deferred.connect(show_formatter.bind("export")) +func change_orientation(): + if Configs.current_orientation == Configs.orientation.PORTRAIT: + $VBoxContainer/BoxContainer.vertical = true + $VBoxContainer/BoxContainer/PanelContainer.size_flags_vertical = SIZE_EXPAND_FILL + else: + $VBoxContainer/BoxContainer.vertical = false + $VBoxContainer/BoxContainer/PanelContainer.size_flags_horizontal = SIZE_EXPAND_FILL + func setup_theming() -> void: var stylebox := get_theme_stylebox("panel").duplicate() stylebox.content_margin_top += 4.0 diff --git a/src/ui_parts/settings_menu.tscn b/src/ui_parts/settings_menu.tscn index 1522c35..b3cf8a0 100644 --- a/src/ui_parts/settings_menu.tscn +++ b/src/ui_parts/settings_menu.tscn @@ -23,35 +23,36 @@ focus_mode = 0 mouse_default_cursor_shape = 2 icon = ExtResource("2_ndyp7") -[node name="VBoxContainer" type="VBoxContainer" parent="VBoxContainer"] +[node name="BoxContainer" type="BoxContainer" parent="VBoxContainer"] layout_mode = 2 size_flags_vertical = 3 theme_override_constants/separation = 0 +vertical = true -[node name="ContentPicker" type="PanelContainer" parent="VBoxContainer/VBoxContainer"] -custom_minimum_size = Vector2(0, 100) +[node name="ContentPicker" type="PanelContainer" parent="VBoxContainer/BoxContainer"] +custom_minimum_size = Vector2(160, 100) layout_mode = 2 theme_type_variation = &"SideTabBar" -[node name="Tabs" type="VBoxContainer" parent="VBoxContainer/VBoxContainer/ContentPicker"] +[node name="Tabs" type="VBoxContainer" parent="VBoxContainer/BoxContainer/ContentPicker"] unique_name_in_owner = true layout_mode = 2 size_flags_horizontal = 3 theme_override_constants/separation = 0 -[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/VBoxContainer"] +[node name="PanelContainer" type="PanelContainer" parent="VBoxContainer/BoxContainer"] layout_mode = 2 size_flags_vertical = 3 mouse_filter = 1 theme_type_variation = &"SideBarContent" -[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/VBoxContainer/PanelContainer"] +[node name="ScrollContainer" type="ScrollContainer" parent="VBoxContainer/BoxContainer/PanelContainer"] unique_name_in_owner = true custom_minimum_size = Vector2(0, 120) layout_mode = 2 horizontal_scroll_mode = 0 -[node name="ContentContainer" type="MarginContainer" parent="VBoxContainer/VBoxContainer/PanelContainer/ScrollContainer"] +[node name="ContentContainer" type="MarginContainer" parent="VBoxContainer/BoxContainer/PanelContainer/ScrollContainer"] layout_mode = 2 size_flags_horizontal = 3 size_flags_vertical = 3