@@ -131,7 +131,6 @@ func _ready() -> void:
131131 get_window ().borderless = false
132132 get_window ().transparent = false
133133 get_window ().grab_focus ()
134- get_window ().gui_embed_subwindows = false
135134
136135 get_window ().close_requested .connect (self .on_close_requested )
137136
@@ -337,6 +336,9 @@ func on_config_changed() -> void:
337336 if c .has_method ("update" ):
338337 c .update ()
339338
339+ if not get_window ().gui_embed_subwindows :
340+ get_window ().gui_embed_subwindows = mm_globals .get_config ("ui_single_window_mode" )
341+
340342func get_panel (panel_name : String ) -> Control :
341343 return layout .get_panel (panel_name )
342344
@@ -996,7 +998,7 @@ func edit_save_selection() -> void:
996998
997999func edit_preferences () -> void :
9981000 var dialog = load ("res://material_maker/windows/preferences/preferences.tscn" ).instantiate ()
999- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
1001+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
10001002 dialog .edit_preferences (mm_globals .config )
10011003
10021004func edit_align_start () -> void :
@@ -1091,7 +1093,7 @@ func add_selection_to_library(index: int, should_ask_item_name: bool = true, upd
10911093 current_item_name = library .get_selected_item_name ()
10921094 if should_ask_item_name :
10931095 var dialog = preload ("res://material_maker/windows/line_dialog/line_dialog.tscn" ).instantiate ()
1094- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
1096+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
10951097 dialog .min_size = Vector2 (250 , 90 ) * dialog .content_scale_factor
10961098 add_child (dialog )
10971099 var status = await dialog .enter_text ("New library element" , "Select a name for the new library element" , current_item_name )
@@ -1118,7 +1120,7 @@ func create_menu_add_brush_to_library(menu : MMMenuManager.MenuBase) -> void:
11181120
11191121func add_brush_to_library (index ) -> void :
11201122 var dialog = preload ("res://material_maker/windows/line_dialog/line_dialog.tscn" ).instantiate ()
1121- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
1123+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
11221124 dialog .min_size = Vector2 (250 , 90 ) * dialog .content_scale_factor
11231125 add_child (dialog )
11241126 var status = await dialog .enter_text ("New library element" , "Select a name for the new library element" , brushes .get_selected_item_name ())
@@ -1330,7 +1332,7 @@ func generate_graph_screenshot():
13301332 graph_edit .zoom = 1
13311333 await get_tree ().process_frame
13321334 var graph_edit_rect = graph_edit .get_global_rect ()
1333- var scale_factor : float = get_window (). content_scale_factor
1335+ var scale_factor : float = mm_globals . ui_scale_factor ()
13341336 graph_edit_rect = Rect2 (graph_edit_rect .position + Vector2 (15 , 80 ), graph_edit_rect .size - Vector2 (25 , 90 ))
13351337 graph_edit_rect = Rect2 (scale_factor * graph_edit_rect .position , scale_factor * graph_edit_rect .size )
13361338 var graph_rect = null
0 commit comments