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
This commit is contained in:
2009-03-09 09:15:23 +00:00
parent 99ef543e56
commit 711d70ec46
3 changed files with 20 additions and 7 deletions

View File

@@ -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 {

View File

@@ -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, &params->display, 1.0, 1.0, 0, 0, "Displays short file description");
uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_LONGDISPLAY, xco+=XIC, yco, XIC,YIC, &params->display, 1.0, 2.0, 0, 0, "Displays long file description");
uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_IMGDISPLAY, xco+=XIC, yco, XIC,YIC, &params->display, 1.0, 3.0, 0, 0, "Displays files as thumbnails");
uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_SHORTDISPLAY, xco+=XIC, yco, XIC,YIC, &params->display, 1.0, FILE_SHORTDISPLAY, 0, 0, "Displays short file description");
uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_LONGDISPLAY, xco+=XIC, yco, XIC,YIC, &params->display, 1.0, FILE_LONGDISPLAY, 0, 0, "Displays long file description");
uiDefIconButS(block, ROW, B_RELOADIMASELDIR, ICON_IMGDISPLAY, xco+=XIC, yco, XIC,YIC, &params->display, 1.0, FILE_IMGDISPLAY, 0, 0, "Displays files as thumbnails");
uiBlockEndAlign(block);
xco+=XIC;

View File

@@ -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 */