[Bf-committers] [Bf-blender-cvs] SVN commit: /data/svn/bf-blender [37185] trunk/blender: Code holiday commit :

Jason van Gumster jason at handturkeystudios.com
Tue Jun 7 03:06:31 CEST 2011


Not sure if it's necessarily because of this commit, but for me at least, the
splash now autoscrolls non-stop when Blender first loads. Interestingly, this
doesn't happen if you view the splash from Help->Splash Screen. Am I the only
one this is happening to?

Ton Roosendaal <ton at blender.org> wrote:

> Revision: 37185
>           http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=37185
> Author:   ton
> Date:     2011-06-04 17:03:46 +0000 (Sat, 04 Jun 2011)
> Log Message:
> -----------
> Code holiday commit:
> 
> - fix: user pref, window title was reset to 'Blender' on tab usage
> 
> - Undo history menu back:
>   - name "Undo History"
>   - hotkey alt+ctrl+z (alt+apple+z for mac)
>   - works like 2.4x, only for global undo, editmode and particle edit.
> 
> - Menu scroll
>   - for small windows or screens, popup menus now allow to display
>     all items, using internal scrolling
>   - works with a timer, scrolling 10 items per second when mouse 
>     is over the top or bottom arrow
>   - if menu is too big to display, it now draws to top or bottom, 
>     based on largest available space.
>   - also works for hotkey driven pop up menus.
> 
> - User pref "DPI" follows widget/layout size
>   - widgets & headers now become bigger and smaller, to match 
>     'dpi' font sizes. Works well to match UI to monitor size.
>   - note that icons can get fuzzy, we need better mipmaps for it
> 
> Modified Paths:
> --------------
>     trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
>     trunk/blender/source/blender/blenkernel/BKE_blender.h
>     trunk/blender/source/blender/blenkernel/intern/blender.c
>     trunk/blender/source/blender/editors/include/ED_particle.h
>     trunk/blender/source/blender/editors/include/ED_screen.h
>     trunk/blender/source/blender/editors/include/ED_types.h
>     trunk/blender/source/blender/editors/include/ED_util.h
>     trunk/blender/source/blender/editors/include/UI_interface.h
>     trunk/blender/source/blender/editors/interface/interface.c
>     trunk/blender/source/blender/editors/interface/interface_handlers.c
>     trunk/blender/source/blender/editors/interface/interface_icons.c
>     trunk/blender/source/blender/editors/interface/interface_intern.h
>     trunk/blender/source/blender/editors/interface/interface_panel.c
>     trunk/blender/source/blender/editors/interface/interface_regions.c
>     trunk/blender/source/blender/editors/interface/interface_templates.c
>     trunk/blender/source/blender/editors/interface/interface_widgets.c
>     trunk/blender/source/blender/editors/interface/resources.c
>     trunk/blender/source/blender/editors/physics/particle_edit.c
>     trunk/blender/source/blender/editors/screen/area.c
>     trunk/blender/source/blender/editors/screen/screen_edit.c
>     trunk/blender/source/blender/editors/screen/screen_ops.c
>     trunk/blender/source/blender/editors/space_action/space_action.c
>     trunk/blender/source/blender/editors/space_buttons/buttons_header.c
>     trunk/blender/source/blender/editors/space_script/script_header.c
>     trunk/blender/source/blender/editors/space_sound/sound_header.c
>     trunk/blender/source/blender/editors/space_view3d/view3d_header.c
>     trunk/blender/source/blender/editors/util/editmode_undo.c
>     trunk/blender/source/blender/editors/util/undo.c
>     trunk/blender/source/blender/editors/util/util_intern.h
>     trunk/blender/source/blender/makesdna/DNA_screen_types.h
>     trunk/blender/source/blender/makesdna/DNA_userdef_types.h
>     trunk/blender/source/blender/makesrna/intern/rna_userdef.c
>     trunk/blender/source/blender/windowmanager/intern/wm_files.c
>     trunk/blender/source/blender/windowmanager/intern/wm_operators.c
>     trunk/blender/source/blender/windowmanager/intern/wm_window.c
> 
> Modified: trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
> ===================================================================
> --- trunk/blender/release/scripts/startup/bl_ui/space_view3d.py
> 2011-06-04 16:32:04 UTC (rev 37184) +++
> trunk/blender/release/scripts/startup/bl_ui/space_view3d.py	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -685,6 +685,7 @@ 
>          layout.operator("ed.undo")
>          layout.operator("ed.redo")
> +        layout.operator("ed.undo_history")
>  
>          layout.separator()
>  
> @@ -1049,6 +1050,7 @@
>  
>          layout.operator("ed.undo")
>          layout.operator("ed.redo")
> +        layout.operator("ed.undo_history")
>  
>          layout.separator()
>  
> @@ -1129,6 +1131,7 @@
>  
>          layout.operator("ed.undo")
>          layout.operator("ed.redo")
> +        layout.operator("ed.undo_history")
>  
>          layout.separator()
>  
> @@ -1182,6 +1185,7 @@
>  
>          layout.operator("ed.undo")
>          layout.operator("ed.redo")
> +        layout.operator("ed.undo_history")
>  
>          layout.separator()
>  
> @@ -1373,6 +1377,7 @@
>  
>          layout.operator("ed.undo")
>          layout.operator("ed.redo")
> +        layout.operator("ed.undo_history")
>  
>          layout.separator()
>  
> @@ -1844,6 +1849,7 @@
>  
>          layout.operator("ed.undo")
>          layout.operator("ed.redo")
> +        layout.operator("ed.undo_history")
>  
>          layout.separator()
>  
> 
> Modified: trunk/blender/source/blender/blenkernel/BKE_blender.h
> ===================================================================
> --- trunk/blender/source/blender/blenkernel/BKE_blender.h	2011-06-04
> 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/blenkernel/BKE_blender.h	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -89,6 +89,7 @@ extern void BKE_reset_undo(void);
>  extern char *BKE_undo_menu_string(void);
>  extern void BKE_undo_number(struct bContext *C, int nr);
> +extern char *BKE_undo_get_name(int nr, int *active);
>  extern void BKE_undo_save_quit(void);
>  extern struct Main *BKE_undo_get_main(struct Scene **scene);
>  
> 
> Modified: trunk/blender/source/blender/blenkernel/intern/blender.c
> ===================================================================
> --- trunk/blender/source/blender/blenkernel/intern/blender.c
> 2011-06-04 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/blenkernel/intern/blender.c	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -620,7 +620,7 @@ /* based on index nr it does a
> restore */ void BKE_undo_number(bContext *C, int nr)
>  {
> -	curundo= BLI_findlink(&undobase, nr - 1);
> +	curundo= BLI_findlink(&undobase, nr);
>  	BKE_undo_step(C, 0);
>  }
>  
> @@ -646,6 +646,21 @@
>  	return undobase.last != undobase.first;
>  }
>  
> +/* get name of undo item, return null if no item with this index */
> +/* if active pointer, set it to 1 if true */
> +char *BKE_undo_get_name(int nr, int *active)
> +{
> +	UndoElem *uel= BLI_findlink(&undobase, nr);
> +	
> +	if(active) *active= 0;
> +	
> +	if(uel) {
> +		if(active && uel==curundo)
> +			*active= 1;
> +		return uel->name;
> +	}
> +	return NULL;
> +}
>  
>  char *BKE_undo_menu_string(void)
>  {
> 
> Modified: trunk/blender/source/blender/editors/include/ED_particle.h
> ===================================================================
> --- trunk/blender/source/blender/editors/include/ED_particle.h
> 2011-06-04 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/editors/include/ED_particle.h	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -71,8 +71,9 @@ void PE_undo_step(struct Scene
> *scene, int step); void PE_undo(struct Scene *scene);
>  void PE_redo(struct Scene *scene);
> -void PE_undo_menu(struct Scene *scene, struct Object *ob);
>  int PE_undo_valid(struct Scene *scene);
> +void PE_undo_number(struct Scene *scene, int nr);
> +char *PE_undo_get_name(struct Scene *scene, int nr, int *active);
>  
>  #endif /* ED_PARTICLE_H */
>  
> 
> Modified: trunk/blender/source/blender/editors/include/ED_screen.h
> ===================================================================
> --- trunk/blender/source/blender/editors/include/ED_screen.h
> 2011-06-04 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/editors/include/ED_screen.h	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -90,6 +90,7 @@ void
> ED_area_newspace(struct bContext *C, ScrArea *sa, int type); void
> ED_area_prevspace(struct bContext *C, ScrArea *sa); void
> ED_area_swapspace(struct bContext *C, ScrArea *sa1, ScrArea *sa2);
> +int		ED_area_headersize(void); 
>  /* screens */
>  void	ED_screens_initialize(struct wmWindowManager *wm);
> 
> Modified: trunk/blender/source/blender/editors/include/ED_types.h
> ===================================================================
> --- trunk/blender/source/blender/editors/include/ED_types.h	2011-06-04
> 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/editors/include/ED_types.h	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -40,10 +40,6 @@ #define SELECT	 1
>  #define ACTIVE	 2
>  
> -/* buttons */
> -#define XIC 20
> -#define YIC 20
> -
>  /* proposal = put scene pointers on function calls? */
>  // #define BASACT                    (scene->basact)
>  // #define OBACT                     (BASACT? BASACT->object: NULL)
> 
> Modified: trunk/blender/source/blender/editors/include/ED_util.h
> ===================================================================
> --- trunk/blender/source/blender/editors/include/ED_util.h	2011-06-04
> 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/editors/include/ED_util.h	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -59,6 +59,7 @@ void
> ED_OT_undo				(struct wmOperatorType *ot);
> void	ED_OT_undo_push			(struct wmOperatorType
> *ot); void	ED_OT_redo				(struct
> wmOperatorType *ot); +void	ED_OT_undo_history		(struct
> wmOperatorType *ot); int		ED_undo_operator_repeat(struct
> bContext *C, struct wmOperator *op); /* convenience since UI callbacks use
> this mostly*/ @@ -76,11 +77,7 @@
>  						int (*validate_undo)(void *,
> void *)); 
>  						
> -void	*undo_editmode_get_prev		(struct Object *ob);
> -struct uiBlock *editmode_undohistorymenu(struct bContext *C, struct ARegion
> *ar, void *arg_unused); -void
> undo_editmode_menu			(struct bContext *C); void
> undo_editmode_clear			(void); -void
> undo_editmode_step			(struct bContext *C, int step); 
>  /* crazyspace.c */
>  float *crazyspace_get_mapped_editverts(struct Scene *scene, struct Object
> *obedit);
> 
> Modified: trunk/blender/source/blender/editors/include/UI_interface.h
> ===================================================================
> --- trunk/blender/source/blender/editors/include/UI_interface.h
> 2011-06-04 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/editors/include/UI_interface.h	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -35,6 +35,7 @@ #define UI_INTERFACE_H
>  
>  #include "RNA_types.h"
> +#include "DNA_userdef_types.h"
>  
>  /* Struct Declarations */
>  
> @@ -100,8 +101,8 @@
>  #define UI_BLOCK_RET_1			4		/* XXX 2.5
> not implemented */ #define UI_BLOCK_NUMSELECT		8
>  /*#define UI_BLOCK_ENTER_OK		16*/ /*UNUSED*/
> -/*#define UI_BLOCK_NOSHADOW		32*/ /*UNUSED*/
> -/*#define UI_BLOCK_UNUSED			64*/ /*UNUSED*/
> +#define UI_BLOCK_CLIPBOTTOM		32
> +#define UI_BLOCK_CLIPTOP		64
>  #define UI_BLOCK_MOVEMOUSE_QUIT	128
>  #define UI_BLOCK_KEEP_OPEN		256
>  #define UI_BLOCK_POPUP			512
> @@ -622,8 +623,8 @@
>  #define UI_LAYOUT_MENU			2
>  #define UI_LAYOUT_TOOLBAR		3
>   
> -#define UI_UNIT_X				20
> -#define UI_UNIT_Y				20
> +#define UI_UNIT_X				U.widget_unit
> +#define UI_UNIT_Y				U.widget_unit
>  
>  #define UI_LAYOUT_ALIGN_EXPAND	0
>  #define UI_LAYOUT_ALIGN_LEFT	1
> 
> Modified: trunk/blender/source/blender/editors/interface/interface.c
> ===================================================================
> --- trunk/blender/source/blender/editors/interface/interface.c
> 2011-06-04 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/editors/interface/interface.c	2011-06-04
> 17:03:46 UTC (rev 37185) @@ -892,13 +892,14 @@ 
>  	/* widgets */
>  	for(but= block->buttons.first; but; but= but->next) {
> -		ui_but_to_pixelrect(&rect, ar, block, but);
> +		if(!(but->flag & (UI_HIDDEN|UI_SCROLLED))) {
> +			ui_but_to_pixelrect(&rect, ar, block, but);
>  		
> -		if(!(but->flag & UI_HIDDEN) &&
>  			/* XXX: figure out why invalid coordinates happen
> when closing render window */ /* and material preview is redrawn in main
> window (temp fix for bug #23848) */
> -			rect.xmin < rect.xmax && rect.ymin < rect.ymax)
> -			ui_draw_but(C, ar, &style, but, &rect);
> +			if(rect.xmin < rect.xmax && rect.ymin < rect.ymax)
> +				ui_draw_but(C, ar, &style, but, &rect);
> +		}
>  	}
>  	
>  	/* restore matrix */
> 
> Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
> ===================================================================
> ---
> trunk/blender/source/blender/editors/interface/interface_handlers.c
> 2011-06-04 16:32:04 UTC (rev 37184) +++
> trunk/blender/source/blender/editors/interface/interface_handlers.c
> 2011-06-04 17:03:46 UTC (rev 37185) @@ -81,6 +81,7 @@ #define
> BUTTON_TOOLTIP_DELAY		0.500 #define
> BUTTON_FLASH_DELAY			0.020 +#define
> MENU_SCROLL_INTERVAL		0.1 #define
> BUTTON_AUTO_OPEN_THRESH		0.3 #define
> BUTTON_MOUSE_TOWARDS_THRESH	1.0 
> @@ -4743,6 +4744,8 @@
>  				continue;
>  			if(but->flag & UI_HIDDEN)
>  				continue;
> +			if(but->flag & UI_SCROLLED)
> +				continue;
>  			if(ui_but_contains_pt(but, mx, my))
>  				butover= but;
>  		}
> @@ -5572,6 +5575,76 @@
>  	return menu->dotowards;
>  }
>  
> +static char ui_menu_scroll_test(uiBlock *block, int my)
> +{
> +	if(block->flag & (UI_BLOCK_CLIPTOP|UI_BLOCK_CLIPBOTTOM)) {
> +		if(block->flag & UI_BLOCK_CLIPTOP) 
> +			if(my > block->maxy-14)
> +				return 't';
> +		if(block->flag & UI_BLOCK_CLIPBOTTOM)
> +			if(my < block->miny+14)
> +				return 'b';
> +	}
> +	return 0;
> +}
> +
> +static int ui_menu_scroll(ARegion *ar, uiBlock *block, int my)
> +{
> +	char test= ui_menu_scroll_test(block, my);
> +	
> +	if(test) {
> +		uiBut *b1= block->buttons.first;
> +		uiBut *b2= block->buttons.last;
> +		uiBut *bnext;
> +		uiBut *bprev;
> +		int dy= 0;
> +		
> +		/* get first and last visible buttons */
> +		while(b1 && ui_but_next(b1) && (b1->flag & UI_SCROLLED))
> +			b1= ui_but_next(b1);
> +		while(b2 && ui_but_prev(b2) && (b2->flag & UI_SCROLLED))
> +			b2= ui_but_prev(b2);
> +		/* skips separators */
> +		bnext= ui_but_next(b1);
> +		bprev= ui_but_prev(b2);
> +		
> +		if(bnext==NULL || bprev==NULL)
> +			return 0;
> +		
> +		if(test=='t') {
> +			/* bottom button is first button */
> +			if(b1->y1 < b2->y1)
> +				dy= bnext->y1 - b1->y1;
> +			/* bottom button is last button */
> +			else 
> +				dy= bprev->y1 - b2->y1;
> +		}
> +		else if(test=='b') {
> +			/* bottom button is first button */
> +			if(b1->y1 < b2->y1)
> +				dy= b1->y1 - bnext->y1;
> +			/* bottom button is last button */
> +			else 
> +				dy= b2->y1 - bprev->y1;
> +		}
> +		if(dy) {
> +			
> +			for(b1= block->buttons.first; b1; b1= b1->next) {
> +				b1->y1 -= dy;
> +				b1->y2 -= dy;
> 
> @@ Diff output truncated at 10240 characters. @@
> _______________________________________________
> Bf-blender-cvs mailing list
> Bf-blender-cvs at blender.org
> http://lists.blender.org/mailman/listinfo/bf-blender-cvs


More information about the Bf-committers mailing list