diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-03-09 12:15:23 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-03-09 12:15:23 +0300 |
commit | 711d70ec46555cd6ac3699810a807b9f2430fe24 (patch) | |
tree | 8bae7e2cbe98a90c78b8eaf41f7ab31adced0437 /source/blender | |
parent | 99ef543e56e33777a35ec663d02f162a5ab280c2 (diff) |
View2D fixes for File Browser: Scrollbars now draw correct.
Elubie, please check on the values for params->display. They were being set to zero by default...
Also, set the correct panning locks for the various views
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/editors/include/ED_fileselect.h | 9 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_header.c | 6 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 12 |
3 files changed, 20 insertions, 7 deletions
diff --git a/source/blender/editors/include/ED_fileselect.h b/source/blender/editors/include/ED_fileselect.h index bb5ced66428..b598175e22e 100644 --- a/source/blender/editors/include/ED_fileselect.h +++ b/source/blender/editors/include/ED_fileselect.h @@ -30,8 +30,15 @@ struct SpaceFile; +// XXX for Elubie: +// defining FILE_LONGDISPLAY as 0 for now, since that seems to be the default case +// for drawing the files (so that scrollbars will draw correct). +// Dunno if these values are saved in files, so hopefully this is ok. +// Revert this change if there's a more correct way to do this +// Aligorith (09Mar2009) +#define FILE_LONGDISPLAY 0 #define FILE_SHORTDISPLAY 1 -#define FILE_LONGDISPLAY 2 +//#define FILE_LONGDISPLAY 2 #define FILE_IMGDISPLAY 3 typedef struct FileSelectParams { diff --git a/source/blender/editors/space_file/file_header.c b/source/blender/editors/space_file/file_header.c index e278b9cd227..998c8542bbe 100644 --- a/source/blender/editors/space_file/file_header.c +++ b/source/blender/editors/space_file/file_header.c @@ -152,9 +152,9 @@ void file_header_buttons(const bContext *C, ARegion *ar) if (sfile->params->type != FILE_MAIN) { uiBlockBeginAlign(block); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_SHORTDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, 1.0, 0, 0, "Displays short file description"); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_LONGDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, 2.0, 0, 0, "Displays long file description"); - uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_IMGDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, 3.0, 0, 0, "Displays files as thumbnails"); + uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_SHORTDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_SHORTDISPLAY, 0, 0, "Displays short file description"); + uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_LONGDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_LONGDISPLAY, 0, 0, "Displays long file description"); + uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_IMGDISPLAY, xco+=XIC, yco, XIC,YIC, ¶ms->display, 1.0, FILE_IMGDISPLAY, 0, 0, "Displays files as thumbnails"); uiBlockEndAlign(block); xco+=XIC; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 1c7edd24df5..2c42005bed7 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -218,11 +218,17 @@ static void file_main_area_draw(const bContext *C, ARegion *ar) glClear(GL_COLOR_BUFFER_BIT); /* Allow dynamically sliders to be set, saves notifiers etc. */ - if (sfile->params && ( (sfile->params->display == FILE_IMGDISPLAY) || (sfile->params->display == FILE_LONGDISPLAY)) ) + if (sfile->params && ( (sfile->params->display == FILE_IMGDISPLAY) || (sfile->params->display == FILE_LONGDISPLAY)) ) { v2d->scroll = V2D_SCROLL_RIGHT; - else + v2d->keepofs &= ~V2D_LOCKOFS_Y; + v2d->keepofs |= V2D_LOCKOFS_X; + } + else { v2d->scroll = V2D_SCROLL_BOTTOM; - /* v2d has initialized flag, so this call will only set the mask correct */ + v2d->keepofs &= ~V2D_LOCKOFS_X; + v2d->keepofs |= V2D_LOCKOFS_Y; + } + /* v2d has initialized flag, so this call will only set the mask correct */ UI_view2d_region_reinit(v2d, V2D_COMMONVIEW_LIST, ar->winx, ar->winy); /* sets tile/border settings in sfile */ |