UI: Region polling support #105088

Merged
Julian Eisel merged 39 commits from JulianEisel/blender:temp-region-poll into main 2023-04-05 15:30:46 +02:00
3 changed files with 8 additions and 4 deletions
Showing only changes of commit 3f1e4f6f56 - Show all commits

View File

@ -908,7 +908,6 @@ void file_draw_list(const bContext *C, ARegion *region)
View2D *v2d = &region->v2d;
struct FileList *files = sfile->files;
struct FileDirEntry *file;
const char *root = filelist_dir(files);
ImBuf *imb;
uiBlock *block = UI_block_begin(C, region, __func__, UI_EMBOSS);
int numfiles;
@ -989,7 +988,6 @@ void file_draw_list(const bContext *C, ARegion *region)
for (i = offset; (i < numfiles) && (i < offset + numfiles_layout); i++) {
uint file_selflag;
char path[FILE_MAX_LIBEXTRA];
const int padx = 0.1f * UI_UNIT_X;
int icon_ofs = 0;
@ -998,7 +996,8 @@ void file_draw_list(const bContext *C, ARegion *region)
file = filelist_file(files, i);
file_selflag = filelist_entry_select_get(sfile->files, file, CHECK_ALL);
BLI_path_join(path, sizeof(path), root, file->relpath);
char path[FILE_MAX_LIBEXTRA];
filelist_file_get_full_path(files, file, path);
if (!(file_selflag & FILE_SEL_EDITING)) {
if ((params->highlight_file == i) || (file_selflag & FILE_SEL_HIGHLIGHTED) ||

View File

@ -94,6 +94,10 @@ void filelist_clear_ex(struct FileList *filelist,
void filelist_clear_from_reset_tag(struct FileList *filelist);
void filelist_free(struct FileList *filelist);
/**
* Get the root path of the file list. To get the full path for a file, use
* #filelist_file_get_full_path().
*/
const char *filelist_dir(const struct FileList *filelist);
bool filelist_is_dir(struct FileList *filelist, const char *path);
/**

View File

@ -1126,7 +1126,8 @@ typedef struct FileDirEntry {
/** ID type, in case typeflag has FILE_TYPE_BLENDERLIB set. */
int blentype;
/* Path to item that is relative to current folder root. */
/* Path to item that is relative to current folder root. To get the full path, use
* #filelist_file_get_full_path() */
char *relpath;
/** Optional argument for shortcuts, aliases etc. */
char *redirection_path;