示例#1
0
void FindReplaceBar::_notification(int p_what) {

	if (p_what == NOTIFICATION_READY) {

		find_prev->set_icon(get_icon("MoveUp", "EditorIcons"));
		find_next->set_icon(get_icon("MoveDown", "EditorIcons"));
		hide_button->set_normal_texture(get_icon("Close","EditorIcons"));
		hide_button->set_hover_texture(get_icon("CloseHover","EditorIcons"));
		hide_button->set_pressed_texture(get_icon("Close","EditorIcons"));

	} else if (p_what == NOTIFICATION_VISIBILITY_CHANGED) {

		set_process_unhandled_input(is_visible());
	}
}
示例#2
0
void FileDialog::_post_popup() {

	ConfirmationDialog::_post_popup();
	if (invalidated) {
		update_file_list();
		invalidated=false;
	}
	if (mode==MODE_SAVE_FILE)
		file->grab_focus();
	else
		tree->grab_focus();

	set_process_unhandled_input(true);

}
void EditorFileDialog::_post_popup() {

	ConfirmationDialog::_post_popup();
	if (invalidated) {
		update_file_list();
		invalidated=false;
	}
	if (mode==MODE_SAVE_FILE)
		file->grab_focus();
	else
		item_list->grab_focus();

	if (is_visible() && get_current_file()!="")
		_request_single_thumbnail(get_current_dir().plus_file(get_current_file()));

	if (is_visible()) {
		Ref<Texture> folder = get_icon("folder","FileDialog");
		recent->clear();


		bool res = access==ACCESS_RESOURCES;
		Vector<String> recentd = EditorSettings::get_singleton()->get_recent_dirs();
		for(int i=0;i<recentd.size();i++) {
			bool cres = recentd[i].begins_with("res://");
			if (cres!=res)
				continue;
			String name = recentd[i];
			if (res && name=="res://") {
				name="/";
			} else {
				name=name.get_file()+"/";
			}

			//print_line("file: "+name);
			recent->add_item(name,folder);
			recent->set_item_metadata( recent->get_item_count()-1,recentd[i]);
		}

		local_history.clear();
		local_history_pos=-1;
		_push_history();

		_update_favorites();
	}

	set_process_unhandled_input(true);

}
void EditorFileDialog::_notification(int p_what) {

	if (p_what==NOTIFICATION_ENTER_TREE) {

		mode_thumbnails->set_icon(get_icon("FileThumbnail","EditorIcons"));
		mode_list->set_icon(get_icon("FileList","EditorIcons"));
		dir_prev->set_icon(get_icon("ArrowLeft","EditorIcons"));
		dir_next->set_icon(get_icon("ArrowRight","EditorIcons"));
		dir_up->set_icon(get_icon("ArrowUp","EditorIcons"));
		refresh->set_icon(get_icon("Reload","EditorIcons"));
		favorite->set_icon(get_icon("Favorites","EditorIcons"));

		fav_up->set_icon(get_icon("MoveUp","EditorIcons"));
		fav_down->set_icon(get_icon("MoveDown","EditorIcons"));
		fav_rm->set_icon(get_icon("RemoveSmall","EditorIcons"));

	} else if (p_what==NOTIFICATION_PROCESS) {

		if (preview_waiting) {
			preview_wheel_timeout-=get_process_delta_time();
			if (preview_wheel_timeout<=0) {
				preview_wheel_index++;
				if (preview_wheel_index>=8)
					preview_wheel_index=0;
				Ref<Texture> frame = get_icon("WaitPreview"+itos(preview_wheel_index+1),"EditorIcons");
				preview->set_texture(frame);
				preview_wheel_timeout=0.1;
			}
		}
	} else if (p_what==NOTIFICATION_DRAW) {

		//RID ci = get_canvas_item();
		//get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
	} else if (p_what==NOTIFICATION_POPUP_HIDE) {

		set_process_unhandled_input(false);

	} else if (p_what==EditorSettings::NOTIFICATION_EDITOR_SETTINGS_CHANGED) {

		bool show_hidden=EditorSettings::get_singleton()->get("file_dialog/show_hidden_files");
		if (show_hidden_files!=show_hidden)
			set_show_hidden_files(show_hidden);
		set_display_mode((DisplayMode)EditorSettings::get_singleton()->get("file_dialog/display_mode").operator int());
	}
}
示例#5
0
void FileDialog::_post_popup() {

	ConfirmationDialog::_post_popup();
	if (invalidated) {
		update_file_list();
		invalidated = false;
	}
	if (mode == MODE_SAVE_FILE)
		file->grab_focus();
	else
		tree->grab_focus();

	set_process_unhandled_input(true);

	// For open dir mode, deselect all items on file dialog open.
	if (mode == MODE_OPEN_DIR)
		deselect_items();
}
示例#6
0
void FileDialog::_notification(int p_what) {

	if (p_what==NOTIFICATION_ENTER_TREE) {

		refresh->set_icon(get_icon("reload"));
	}

	if (p_what==NOTIFICATION_DRAW) {

		//RID ci = get_canvas_item();
		//get_stylebox("panel","PopupMenu")->draw(ci,Rect2(Point2(),get_size()));
	}

	if (p_what==NOTIFICATION_POPUP_HIDE) {

		set_process_unhandled_input(false);
	}
}
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;
	}
}