[Bf-blender-cvs] [5f07a20] UI-experiments: Merge branch 'UI-graphical-redesign' into UI-experiments

Julian Eisel noreply at git.blender.org
Tue Jun 2 18:21:41 CEST 2015


Commit: 5f07a2006213a2c4de08d9b9b37ee963f02dc4bf
Author: Julian Eisel
Date:   Tue Jun 2 18:19:42 2015 +0200
Branches: UI-experiments
https://developer.blender.org/rB5f07a2006213a2c4de08d9b9b37ee963f02dc4bf

Merge branch 'UI-graphical-redesign' into UI-experiments

Conflicts:
	source/blender/editors/screen/area.c

===================================================================



===================================================================

diff --cc source/blender/editors/screen/area.c
index 3d5b612,8d0bf36..6f54796
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@@ -69,20 -69,16 +69,22 @@@
  #include "UI_resources.h"
  #include "UI_view2d.h"
  
 +#include "interface_intern.h"
 +
  #include "screen_intern.h"
  
+ extern void ui_draw_anti_tria(float x1, float y1, float x2, float y2, float x3, float y3); /* xxx temp */
+ 
  /* general area and region code */
  
 -static void region_draw_emboss(ARegion *ar, rcti *scirct)
 +static void region_draw_emboss(ScrArea *sa, const ARegion *ar, const rcti *scirct)
  {
 +	uiBut *but;
 +	rctf trct;
  	rcti rect;
 -	
 +	float xofs = 0.0f; /* scrolling offset */
 +	bool breakl = false;
 +
  	/* translate scissor rect to region space */
  	rect.xmin = scirct->xmin - ar->winrct.xmin;
  	rect.ymin = scirct->ymin - ar->winrct.ymin;
@@@ -1765,8 -1725,7 +1767,8 @@@ void ED_region_panels(const bContext *C
  	Panel *panel;
  	View2D *v2d = &ar->v2d;
  	View2DScrollers *scrollers;
- 	int x, y, xco, yco, w, em, triangle;
+ 	int x, y, xco, yco, w, em;
 +	int theme_col_bg = TH_BACK;
  	bool is_context_new = 0;
  	int redo;
  	int scroll;
@@@ -1878,27 -1838,30 +1880,30 @@@
  			block = UI_block_begin(C, ar, pt->idname, UI_EMBOSS);
  			panel = UI_panel_begin(sa, ar, block, pt, panel, &open);
  
- 			/* bad fixed values */
- 			triangle = (int)(UI_UNIT_Y * 1.1f);
- 
  			if (pt->draw_header && !(pt->flag & PNL_NO_HEADER) && (open || vertical)) {
+ 				const int ar_x = (int)BLI_rctf_size_x(&ar->v2d.cur);
+ 				const int ofs_x = iroundf(MIN2(UI_UNIT_X * 0.6f, ar_x * 0.1f));
+ 				/* using panel->sizex causes too much jittering */
+ 				const int panel_sizex = ar_x - (int)(UI_PANEL_MARGIN * 2.0f);
+ 
  				/* for enabled buttons */
- 				panel->layout = UI_block_layout(
- 				        block, UI_LAYOUT_HORIZONTAL, UI_LAYOUT_HEADER,
- 				        triangle, (UI_UNIT_Y * 1.1f) + style->panelspace, UI_UNIT_Y, 1, 0, style);
+ 				uiLayout *row;
+ 				uiLayout *layout = UI_block_layout(
+ 				        block, UI_LAYOUT_VERTICAL, UI_LAYOUT_PANEL,
+ 				        -ofs_x, (UI_UNIT_Y * 1.1f) + style->panelspace,
+ 				        panel_sizex, 1, 0, style);
+ 
 -
+ 				row = uiLayoutRow(layout, 1);
+ 				uiLayoutSetAlignment(row, UI_LAYOUT_ALIGN_RIGHT);
+ 				panel->layout = row;
  
  				pt->draw_header(C, panel);
  
- 				UI_block_layout_resolve(block, &xco, &yco);
- 				panel->labelofs = xco - triangle;
  				panel->layout = NULL;
  			}
- 			else {
- 				panel->labelofs = 0;
- 			}
  
  			if (open) {
 +				short layout = UI_LAYOUT_VERTICAL;
  				short panelContext;
  
  				/* panel context can either be toolbar region or normal panels region */




More information about the Bf-blender-cvs mailing list