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:
authorAndrea Weikert <elubie@gmx.net>2011-03-20 14:16:59 +0300
committerAndrea Weikert <elubie@gmx.net>2011-03-20 14:16:59 +0300
commite73a2020dd1450a709d8da53af9132e08c811226 (patch)
tree7930fd4934a75472cc10db8e312f25d20c641fa0 /source/blender/editors/space_file/file_draw.c
parent5325f3b2e989a3b94e2d9450c574e4610d2005d8 (diff)
== filebrowser == Code cleanup
* Separate out selection flags from file type flags, was bothering me since forever ;) * Also renamed ACTIVEFILE to SELECTED_FILE to better reflect actual usage in code. * Fix crash introduced with last commit, better check for valid selection
Diffstat (limited to 'source/blender/editors/space_file/file_draw.c')
-rw-r--r--source/blender/editors/space_file/file_draw.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c
index 68651674bd5..c8f4dc26e90 100644
--- a/source/blender/editors/space_file/file_draw.c
+++ b/source/blender/editors/space_file/file_draw.c
@@ -514,10 +514,10 @@ void file_draw_list(const bContext *C, ARegion *ar)
UI_ThemeColor4(TH_TEXT);
- if (!(file->flags & EDITING)) {
- if ((params->active_file == i) || (file->flags & HILITED_FILE) || (file->flags & ACTIVEFILE) ) {
- int colorid = (file->flags & ACTIVEFILE) ? TH_HILITE : TH_BACK;
- int shade = (params->active_file == i) || (file->flags & HILITED_FILE) ? 20 : 0;
+ if (!(file->selflag & EDITING_FILE)) {
+ if ((params->active_file == i) || (file->selflag & HILITED_FILE) || (file->selflag & SELECTED_FILE) ) {
+ int colorid = (file->selflag & SELECTED_FILE) ? TH_HILITE : TH_BACK;
+ int shade = (params->active_file == i) || (file->selflag & HILITED_FILE) ? 20 : 0;
draw_tile(sx, sy-1, layout->tile_w+4, sfile->layout->tile_h+layout->tile_border_y, colorid, shade);
}
}
@@ -539,17 +539,17 @@ void file_draw_list(const bContext *C, ARegion *ar)
UI_ThemeColor4(TH_TEXT);
- if (file->flags & EDITING) {
+ if (file->selflag & EDITING_FILE) {
uiBut *but = uiDefBut(block, TEX, 1, "", sx , sy-layout->tile_h-3,
textwidth, textheight, sfile->params->renameedit, 1.0f, (float)sizeof(sfile->params->renameedit),0,0,"");
uiButSetRenameFunc(but, renamebutton_cb, file);
uiButSetFlag(but, UI_BUT_NO_UTF8); /* allow non utf8 names */
if ( 0 == uiButActiveOnly(C, block, but)) {
- file->flags &= ~EDITING;
+ file->selflag &= ~EDITING_FILE;
}
}
- if (!(file->flags & EDITING)) {
+ if (!(file->selflag & EDITING_FILE)) {
int tpos = (FILE_IMGDISPLAY == params->display) ? sy - layout->tile_h + layout->textheight : sy;
file_draw_string(sx+1, tpos, file->relname, textwidth, textheight, align);
}