diff --git a/src/Main.gd b/src/Main.gd index 521bbde1f..0d1094a41 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -250,16 +250,10 @@ func _handle_layout_files() -> void: func _setup_application_window_size() -> void: if DisplayServer.get_name() == "headless": return - var root := get_tree().root - root.content_scale_aspect = Window.CONTENT_SCALE_ASPECT_IGNORE - root.content_scale_mode = Window.CONTENT_SCALE_MODE_DISABLED - # Set a minimum window size to prevent UI elements from collapsing on each other. - root.min_size = Vector2(1024, 576) - root.content_scale_factor = Global.shrink + set_display_scale() if Global.font_size != theme.default_font_size: theme.default_font_size = Global.font_size theme.set_font_size("font_size", "HeaderSmall", Global.font_size + 2) - set_custom_cursor() if OS.get_name() == "Web": return @@ -280,6 +274,16 @@ func _setup_application_window_size() -> void: get_window().size = Global.config_cache.get_value("window", "size") +func set_display_scale() -> void: + var root := get_window() + root.content_scale_aspect = Window.CONTENT_SCALE_ASPECT_IGNORE + root.content_scale_mode = Window.CONTENT_SCALE_MODE_DISABLED + # Set a minimum window size to prevent UI elements from collapsing on each other. + root.min_size = Vector2(1024, 576) + root.content_scale_factor = Global.shrink + set_custom_cursor() + + func set_custom_cursor() -> void: if Global.native_cursors: return diff --git a/src/Preferences/PreferencesDialog.gd b/src/Preferences/PreferencesDialog.gd index 3d6bcf42f..5ba2f37d6 100644 --- a/src/Preferences/PreferencesDialog.gd +++ b/src/Preferences/PreferencesDialog.gd @@ -413,12 +413,7 @@ func _on_List_item_selected(index: int) -> void: func _on_shrink_apply_button_pressed() -> void: - var root := get_tree().root - root.content_scale_aspect = Window.CONTENT_SCALE_ASPECT_IGNORE - root.content_scale_mode = Window.CONTENT_SCALE_MODE_DISABLED - root.min_size = Vector2(1024, 576) - root.content_scale_factor = Global.shrink - Global.control.set_custom_cursor() + Global.control.set_display_scale() hide() popup_centered(Vector2(600, 400)) Global.dialog_open(true) diff --git a/src/UI/TopMenuContainer/TopMenuContainer.gd b/src/UI/TopMenuContainer/TopMenuContainer.gd index c9c121d30..b95524f00 100644 --- a/src/UI/TopMenuContainer/TopMenuContainer.gd +++ b/src/UI/TopMenuContainer/TopMenuContainer.gd @@ -99,6 +99,7 @@ func _ready() -> void: func _input(event: InputEvent) -> void: + # Workaround for https://github.com/Orama-Interactive/Pixelorama/issues/1070 if event is InputEventMouseButton and event.pressed: file_menu.activate_item_by_event(event) edit_menu.activate_item_by_event(event)