@@ -136,7 +136,6 @@ func _ready() -> void:
136136 get_window ().borderless = false
137137 get_window ().transparent = false
138138 get_window ().grab_focus ()
139- get_window ().gui_embed_subwindows = false
140139
141140 get_window ().close_requested .connect (self .on_close_requested )
142141
@@ -342,6 +341,9 @@ func on_config_changed() -> void:
342341 if c .has_method ("update" ):
343342 c .update ()
344343
344+ if not get_window ().gui_embed_subwindows :
345+ get_window ().gui_embed_subwindows = mm_globals .get_config ("ui_single_window_mode" )
346+
345347func get_panel (panel_name : String ) -> Control :
346348 return layout .get_panel (panel_name )
347349
@@ -1052,7 +1054,7 @@ func edit_save_selection() -> void:
10521054
10531055func edit_preferences () -> void :
10541056 var dialog = load ("res://material_maker/windows/preferences/preferences.tscn" ).instantiate ()
1055- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
1057+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
10561058 dialog .edit_preferences (mm_globals .config )
10571059
10581060func edit_align_start () -> void :
@@ -1150,7 +1152,7 @@ func add_selection_to_library(index: int, should_ask_item_name: bool = true, upd
11501152 current_item_name = library .get_selected_item_name ()
11511153 if should_ask_item_name :
11521154 var dialog = preload ("res://material_maker/windows/line_dialog/line_dialog.tscn" ).instantiate ()
1153- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
1155+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
11541156 dialog .min_size = Vector2 (250 , 90 ) * dialog .content_scale_factor
11551157 add_child (dialog )
11561158 var status = await dialog .enter_text ("New library element" , "Select a name for the new library element" , current_item_name )
@@ -1177,7 +1179,7 @@ func create_menu_add_brush_to_library(menu : MMMenuManager.MenuBase) -> void:
11771179
11781180func add_brush_to_library (index ) -> void :
11791181 var dialog = preload ("res://material_maker/windows/line_dialog/line_dialog.tscn" ).instantiate ()
1180- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
1182+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
11811183 dialog .min_size = Vector2 (250 , 90 ) * dialog .content_scale_factor
11821184 add_child (dialog )
11831185 var status = await dialog .enter_text ("New library element" , "Select a name for the new library element" , brushes .get_selected_item_name ())
@@ -1389,7 +1391,7 @@ func generate_graph_screenshot():
13891391 graph_edit .zoom = 1
13901392 await get_tree ().process_frame
13911393 var graph_edit_rect = graph_edit .get_global_rect ()
1392- var scale_factor : float = get_window (). content_scale_factor
1394+ var scale_factor : float = mm_globals . ui_scale_factor ()
13931395 graph_edit_rect = Rect2 (graph_edit_rect .position + Vector2 (15 , 80 ), graph_edit_rect .size - Vector2 (25 , 90 ))
13941396 graph_edit_rect = Rect2 (scale_factor * graph_edit_rect .position , scale_factor * graph_edit_rect .size )
13951397 var graph_rect = null
0 commit comments