[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [19237] branches/blender2.5/blender/source /blender/editors: View2D fixes for File Browser: Scrollbars now draw correct.
Joshua Leung
aligorith at gmail.com
Mon Mar 9 10:15:24 CET 2009
Revision: 19237
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=19237
Author: aligorith
Date: 2009-03-09 10:15:23 +0100 (Mon, 09 Mar 2009)
Log Message:
-----------
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
Modified Paths:
--------------
branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h
branches/blender2.5/blender/source/blender/editors/space_file/file_header.c
branches/blender2.5/blender/source/blender/editors/space_file/space_file.c
Modified: branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h
===================================================================
--- branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h 2009-03-09 08:56:36 UTC (rev 19236)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_fileselect.h 2009-03-09 09:15:23 UTC (rev 19237)
@@ -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 {
Modified: branches/blender2.5/blender/source/blender/editors/space_file/file_header.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_file/file_header.c 2009-03-09 08:56:36 UTC (rev 19236)
+++ branches/blender2.5/blender/source/blender/editors/space_file/file_header.c 2009-03-09 09:15:23 UTC (rev 19237)
@@ -152,9 +152,9 @@
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;
Modified: branches/blender2.5/blender/source/blender/editors/space_file/space_file.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_file/space_file.c 2009-03-09 08:56:36 UTC (rev 19236)
+++ branches/blender2.5/blender/source/blender/editors/space_file/space_file.c 2009-03-09 09:15:23 UTC (rev 19237)
@@ -218,11 +218,17 @@
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 */
More information about the Bf-blender-cvs
mailing list