Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r--source/blender/editors/space_file/file_draw.c14
-rw-r--r--source/blender/editors/space_file/file_ops.c8
-rw-r--r--source/blender/editors/space_file/filelist.c2
-rw-r--r--source/blender/editors/space_file/space_file.c5
4 files changed, 15 insertions, 14 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 083d41747b3..7039eba7db1 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -267,7 +267,7 @@ static void file_draw_preview(uiBlock *block,
xco = sx + (int)dx;
yco = sy - layout->prv_h + (int)dy;
- GPU_blend(true);
+ GPU_blend(GPU_BLEND_ALPHA);
/* the large image */
@@ -290,8 +290,7 @@ static void file_draw_preview(uiBlock *block,
if (!is_icon && typeflags & FILE_TYPE_BLENDERLIB) {
/* Datablock preview images use premultiplied alpha. */
- GPU_blend_set_func_separate(
- GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA_PREMULT);
}
IMMDrawPixelsTexState state = immDrawPixelsTexSetup(GPU_SHADER_2D_IMAGE_COLOR);
@@ -309,8 +308,7 @@ static void file_draw_preview(uiBlock *block,
1.0f,
col);
- GPU_blend_set_func_separate(
- GPU_SRC_ALPHA, GPU_ONE_MINUS_SRC_ALPHA, GPU_ONE, GPU_ONE_MINUS_SRC_ALPHA);
+ GPU_blend(GPU_BLEND_ALPHA);
if (icon && is_icon) {
/* Small icon in the middle of large image, scaled to fit container and UI scale */
@@ -391,7 +389,7 @@ static void file_draw_preview(uiBlock *block,
UI_but_drag_set_image(but, BLI_strdup(path), icon, imb, scale, true);
}
- GPU_blend(false);
+ GPU_blend(GPU_BLEND_NONE);
}
static void renamebutton_cb(bContext *C, void *UNUSED(arg1), char *oldname)
@@ -443,7 +441,9 @@ static void draw_background(FileLayout *layout, View2D *v2d)
uint pos = GPU_vertformat_attr_add(immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT);
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
- immUniformThemeColorShade(TH_BACK, -7);
+ float col_alternating[4];
+ UI_GetThemeColor4fv(TH_ROW_ALTERNATE, col_alternating);
+ immUniformThemeColorBlend(TH_BACK, TH_ROW_ALTERNATE, col_alternating[3]);
/* alternating flat shade background */
for (i = 2; (i <= layout->rows + 1); i += 2) {
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c
index e9ffd4583d7..8c4b2a1b8a6 100644
--- a/source/blender/editors/space_file/file_ops.c
+++ b/source/blender/editors/space_file/file_ops.c
@@ -1722,7 +1722,11 @@ void FILE_OT_execute(struct wmOperatorType *ot)
/* api callbacks */
ot->invoke = file_exec_invoke;
ot->exec = file_exec;
- ot->poll = file_operator_poll;
+ /* Important since handler is on window level.
+ *
+ * Avoid using #file_operator_poll since this is also used for entering directories
+ * which is used even when the file manager doesn't have an operator. */
+ ot->poll = ED_operator_file_active;
/* properties */
prop = RNA_def_boolean(ot->srna,
@@ -2293,7 +2297,7 @@ static void file_expand_directory(bContext *C)
}
#else
{
- get_default_root(sfile->params->dir);
+ BLI_windows_get_default_root_dir(sfile->params->dir);
}
/* change "C:" --> "C:\", [#28102] */
else if ((isalpha(sfile->params->dir[0]) && (sfile->params->dir[1] == ':')) &&
diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c
index 67ea22a7ef5..0ade50814e0 100644
--- a/source/blender/editors/space_file/filelist.c
+++ b/source/blender/editors/space_file/filelist.c
@@ -1127,7 +1127,7 @@ static void parent_dir_until_exists_or_default_root(char *dir)
{
if (!BLI_path_parent_dir_until_exists(dir)) {
#ifdef WIN32
- get_default_root(dir);
+ BLI_windows_get_default_root_dir(dir);
#else
strcpy(dir, "/");
#endif
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c
index f520f91b89b..61d6d8bf678 100644
--- a/source/blender/editors/space_file/space_file.c
+++ b/source/blender/editors/space_file/space_file.c
@@ -449,7 +449,6 @@ static void file_main_region_draw(const bContext *C, ARegion *region)
FileSelectParams *params = ED_fileselect_get_params(sfile);
View2D *v2d = &region->v2d;
- float col[3];
/* Needed, because filelist is not initialized on loading */
if (!sfile->files || filelist_empty(sfile->files)) {
@@ -457,9 +456,7 @@ static void file_main_region_draw(const bContext *C, ARegion *region)
}
/* clear and setup matrix */
- UI_GetThemeColor3fv(TH_BACK, col);
- GPU_clear_color(col[0], col[1], col[2], 1.0f);
- GPU_clear(GPU_COLOR_BIT);
+ UI_ThemeClearColor(TH_BACK);
/* Allow dynamically sliders to be set, saves notifiers etc. */