コード例 #1
0
void EditorSettingsDialog::popup_edit_settings() {

	if (!EditorSettings::get_singleton())
		return;

	EditorSettings::get_singleton()->list_text_editor_themes(); // make sure we have an up to date list of themes

	inspector->edit(EditorSettings::get_singleton());
	inspector->get_inspector()->update_tree();

	search_box->select_all();
	search_box->grab_focus();

	_update_shortcuts();
	set_process_unhandled_input(true);

	// Restore valid window bounds or pop up at default size.
	if (EditorSettings::get_singleton()->has_setting("interface/dialogs/editor_settings_bounds")) {
		popup(EditorSettings::get_singleton()->get("interface/dialogs/editor_settings_bounds"));
	} else {

		Size2 popup_size = Size2(900, 700) * editor_get_scale();
		Size2 window_size = get_viewport_rect().size;

		popup_size.x = MIN(window_size.x * 0.8, popup_size.x);
		popup_size.y = MIN(window_size.y * 0.8, popup_size.y);

		popup_centered(popup_size);
	}

	_focus_current_search_box();
}
コード例 #2
0
void EditorSettingsDialog::popup_edit_settings() {

	if (!EditorSettings::get_singleton())
		return;

	EditorSettings::get_singleton()->list_text_editor_themes(); // make sure we have an up to date list of themes

	property_editor->edit(EditorSettings::get_singleton());
	property_editor->get_property_editor()->update_tree();

	search_box->select_all();
	search_box->grab_focus();

	_update_shortcuts();
	popup_centered_ratio(0.7);
}
コード例 #3
0
void EditorSettingsDialog::popup_edit_settings() {

	if (!EditorSettings::get_singleton())
		return;

	EditorSettings::get_singleton()->list_text_editor_themes(); // make sure we have an up to date list of themes

	property_editor->edit(EditorSettings::get_singleton());
	property_editor->get_property_editor()->update_tree();

	search_box->select_all();
	search_box->grab_focus();

	_update_shortcuts();

	// Restore valid window bounds or pop up at default size.
	if (EditorSettings::get_singleton()->has("interface/dialogs/editor_settings_bounds")) {
		popup(EditorSettings::get_singleton()->get("interface/dialogs/editor_settings_bounds"));
	} else {
		popup_centered_ratio(0.7);
	}
}
コード例 #4
0
void EditorSettingsDialog::_notification(int p_what) {

	switch (p_what) {
		case NOTIFICATION_READY: {
			ScriptEditorDebugger *sed = ScriptEditor::get_singleton()->get_debugger();
			undo_redo->set_method_notify_callback(sed->_method_changeds, sed);
			undo_redo->set_property_notify_callback(sed->_property_changeds, sed);
			undo_redo->set_commit_notify_callback(_undo_redo_callback, this);
		} break;
		case NOTIFICATION_ENTER_TREE: {
			_update_icons();
		} break;
		case NOTIFICATION_POPUP_HIDE: {
			EditorSettings::get_singleton()->set("interface/dialogs/editor_settings_bounds", get_rect());
			set_process_unhandled_input(false);
		} break;
		case EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED: {
			_update_icons();
			// Update theme colors.
			inspector->update_category_list();
			_update_shortcuts();
		} break;
	}
}
コード例 #5
0
void EditorSettingsDialog::_filter_shortcuts(const String &p_filter) {
	shortcut_filter = p_filter;
	_update_shortcuts();
}