@@ -130,7 +130,6 @@ func _ready() -> void:
130130 get_window ().borderless = false
131131 get_window ().transparent = false
132132 get_window ().grab_focus ()
133- get_window ().gui_embed_subwindows = false
134133
135134 get_window ().close_requested .connect (self .on_close_requested )
136135
@@ -328,6 +327,9 @@ func on_config_changed() -> void:
328327 WinTabletDriver .DISABLED :
329328 DisplayServer .tablet_set_current_driver ("dummy" )
330329
330+ if not get_window ().gui_embed_subwindows :
331+ get_window ().gui_embed_subwindows = mm_globals .get_config ("ui_single_window_mode" )
332+
331333func get_panel (panel_name : String ) -> Control :
332334 return layout .get_panel (panel_name )
333335
@@ -987,7 +989,7 @@ func edit_save_selection() -> void:
987989
988990func edit_preferences () -> void :
989991 var dialog = load ("res://material_maker/windows/preferences/preferences.tscn" ).instantiate ()
990- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
992+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
991993 dialog .edit_preferences (mm_globals .config )
992994
993995func edit_align_start () -> void :
@@ -1082,7 +1084,7 @@ func add_selection_to_library(index: int, should_ask_item_name: bool = true, upd
10821084 current_item_name = library .get_selected_item_name ()
10831085 if should_ask_item_name :
10841086 var dialog = preload ("res://material_maker/windows/line_dialog/line_dialog.tscn" ).instantiate ()
1085- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
1087+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
10861088 dialog .min_size = Vector2 (250 , 90 ) * dialog .content_scale_factor
10871089 add_child (dialog )
10881090 var status = await dialog .enter_text ("New library element" , "Select a name for the new library element" , current_item_name )
@@ -1109,7 +1111,7 @@ func create_menu_add_brush_to_library(menu : MMMenuManager.MenuBase) -> void:
11091111
11101112func add_brush_to_library (index ) -> void :
11111113 var dialog = preload ("res://material_maker/windows/line_dialog/line_dialog.tscn" ).instantiate ()
1112- dialog .content_scale_factor = mm_globals .main_window . get_window (). content_scale_factor
1114+ dialog .content_scale_factor = mm_globals .ui_scale_factor ()
11131115 dialog .min_size = Vector2 (250 , 90 ) * dialog .content_scale_factor
11141116 add_child (dialog )
11151117 var status = await dialog .enter_text ("New library element" , "Select a name for the new library element" , brushes .get_selected_item_name ())
@@ -1318,7 +1320,7 @@ func generate_graph_screenshot():
13181320 graph_edit .zoom = 1
13191321 await get_tree ().process_frame
13201322 var graph_edit_rect = graph_edit .get_global_rect ()
1321- var scale_factor : float = get_window (). content_scale_factor
1323+ var scale_factor : float = mm_globals . ui_scale_factor ()
13221324 graph_edit_rect = Rect2 (graph_edit_rect .position + Vector2 (15 , 80 ), graph_edit_rect .size - Vector2 (25 , 90 ))
13231325 graph_edit_rect = Rect2 (scale_factor * graph_edit_rect .position , scale_factor * graph_edit_rect .size )
13241326 var graph_rect = null
0 commit comments