[Bf-committers] Output Panel Alignment and Rounded Theme Dropdown Fix

Chris Burt bf-committers@blender.org
Tue, 27 Jul 2004 15:55:32 -0400


This is a multi-part message in MIME format.
--------------020302020601060407000301
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

As you may know we've been doing some tweaking of the interface.  Here 
is my completed work on the output panel. (If there is any objection to 
swapping the location of the DispView and DispWin buttons, just copy and 
paste the lines to swap em back. Seemed to make more sense to have the 
win button near the win icons).  In addition, as a little bonus hehe, 
I've included a fix for the drawing of the drop down menus in the 
Rounded Theme.  They weren't drawn correctly according to the alignment 
of the button in blocks. Enjoy!!

Chris Burt
a.k.a. Desoto

--------------020302020601060407000301
Content-Type: text/plain;
 name="output_panel_align.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="output_panel_align.txt"

Index: source/blender/src/buttons_scene.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/buttons_scene.c,v
retrieving revision 1.53
diff -u -r1.53 buttons_scene.c
--- source/blender/src/buttons_scene.c	27 Jul 2004 11:42:50 -0000	1.53
+++ source/blender/src/buttons_scene.c	27 Jul 2004 19:30:08 -0000
@@ -990,12 +990,13 @@
 	if(uiNewPanel(curarea, block, "Output", "Render", 0, 0, 318, 204)==0) return;
 	
 	uiBlockBeginAlign(block);
-	uiDefIconBut(block, BUT, B_FS_PIC, ICON_FILESEL,	8, 170, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Pics dir/name");
-	uiDefBut(block, TEX,0,"",							30, 170, 268, 19,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save rendered Pics to");
-	uiDefIconBut(block, BUT,B_FS_BACKBUF, ICON_FILESEL, 8, 148, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image");
-	uiDefBut(block, TEX,0,"",							30, 148, 268, 19,G.scene->r.backbuf, 0.0,79.0, 0, 0, "Image to use as background for rendering");
-	uiDefIconBut(block, BUT,B_FS_FTYPE, ICON_FILESEL,	8, 125, 20, 19, 0, 0, 0, 0, 0, "Open Fileselect to get Ftype image");
-	uiDefBut(block, TEX,0,"",							30, 125, 268, 19,G.scene->r.ftype,0.0,79.0, 0, 0, "Image to use with FTYPE Image type");
+	uiDefIconBut(block, BUT, B_FS_PIC, ICON_FILESEL,	10, 190, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Pics dir/name");
+	uiDefBut(block, TEX,0,"",							31, 190, 279, 20,G.scene->r.pic, 0.0,79.0, 0, 0, "Directory/name to save rendered Pics to");
+	uiDefIconBut(block, BUT,B_FS_BACKBUF, ICON_FILESEL, 10, 168, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Backbuf image");
+	uiDefBut(block, TEX,0,"",							31, 168, 279, 20,G.scene->r.backbuf, 0.0,79.0, 0, 0, "Image to use as background for rendering");
+	uiDefIconBut(block, BUT,B_FS_FTYPE, ICON_FILESEL,	10, 146, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get Ftype image");
+	uiDefBut(block, TEX,0,"",							31, 146, 279, 20,G.scene->r.ftype,0.0,79.0, 0, 0, "Image to use with FTYPE Image type");
+	uiBlockEndAlign(block);
 	
 	
 	/* SET BUTTON */
@@ -1003,44 +1004,45 @@
 	id= (ID *)G.scene->set;
 	IDnames_to_pupstring(&strp, NULL, NULL, &(G.main->scene), id, &(G.buts->menunr));
 	if(strp[0])
-		uiDefButS(block, MENU, B_SETBROWSE, strp, 8, 96, 20, 19, &(G.buts->menunr), 0, 0, 0, 0, "Scene to link as a Set");
+		uiDefButS(block, MENU, B_SETBROWSE, strp, 10, 120, 20, 20, &(G.buts->menunr), 0, 0, 0, 0, "Scene to link as a Set");
 	MEM_freeN(strp);
 
 	if(G.scene->set) {
 		uiSetButLock(1, NULL);
-		uiDefIDPoinBut(block, test_scenepoin_but, 0, "",	29, 96, 100, 19, &(G.scene->set), "Name of the Set");
+		uiDefIDPoinBut(block, test_scenepoin_but, 0, "",	31, 120, 100, 20, &(G.scene->set), "Name of the Set");
 		uiClearButLock();
-		uiDefIconBut(block, BUT, B_CLEARSET, ICON_X, 		131, 96, 20, 19, 0, 0, 0, 0, 0, "Remove Set link");
+		uiDefIconBut(block, BUT, B_CLEARSET, ICON_X, 		132, 120, 20, 20, 0, 0, 0, 0, 0, "Remove Set link");
 	}
 	uiBlockEndAlign(block);
 
 	uiBlockSetCol(block, TH_BUT_SETTING1);
-	uiDefButS(block, TOG|BIT|0, 0,"Backbuf",	8, 70, 62, 19, &G.scene->r.bufflag, 0, 0, 0, 0, "Enable/Disable use of Backbuf image");	
+	uiDefButS(block, TOG|BIT|0, 0,"Backbuf",	10, 94, 60, 20, &G.scene->r.bufflag, 0, 0, 0, 0, "Enable/Disable use of Backbuf image");	
 	uiBlockSetCol(block, TH_AUTO);
 		
 	uiBlockBeginAlign(block);
 	for(b=2; b>=0; b--)
 		for(a=0; a<3; a++)
-			uiDefButS(block, TOG|BIT|(3*b+a), 800,"",	(short)(9+18*a),(short)(7+12*b),16,10, &R.winpos, 0, 0, 0, 0, "Render window placement on screen");
+			uiDefButS(block, TOG|BIT|(3*b+a), 800,"",	(short)(10+18*a),(short)(10+14*b),16,12, &R.winpos, 0, 0, 0, 0, "Render window placement on screen");
+	uiBlockEndAlign(block);
 
 	uiBlockBeginAlign(block);
-	uiDefButS(block, ROW, B_REDR, "DispView",	72, 7, 65, 19, &R.displaymode, 0.0, (float)R_DISPLAYVIEW, 0, 0, "Sets render output to display in 3D view");
-	uiDefButS(block, ROW, B_REDR, "DispWin",	139, 7, 62, 19, &R.displaymode, 0.0, (float)R_DISPLAYWIN, 0, 0, "Sets render output to display in a seperate window");
-	uiBlockEndAlign(block);
+	uiDefButS(block, ROW, B_REDR, "DispWin",	72, 10, 60, 20, &R.displaymode, 0.0, (float)R_DISPLAYWIN, 0, 0, "Sets render output to display in a seperate window");
+	uiDefButS(block, ROW, B_REDR, "DispView",	134, 10, 60, 20, &R.displaymode, 0.0, (float)R_DISPLAYVIEW, 0, 0, "Sets render output to display in 3D view");
+	uiBlockEndAlign(block);
 
-	uiDefButS(block, TOG|BIT|4, 0, "Extensions",	228, 8, 67, 18, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Adds extensions to the output when rendering animations");
+	uiDefButS(block, TOG|BIT|4, 0, "Extensions",	250, 10, 60, 20, &G.scene->r.scemode, 0.0, 0.0, 0, 0, "Adds extensions to the output when rendering animations");
 
 	/* Toon shading buttons */
 	uiBlockBeginAlign(block);
-	uiDefButI(block, TOG|BIT|5, 0,"Edge",	154, 70, 47, 19, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon shading");
-	uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings |>> ", 204, 70, 93, 19, "Display edge settings");
+	uiDefButI(block, TOG|BIT|5, 0,"Edge",	155, 94, 44, 20, &G.scene->r.mode, 0, 0, 0, 0, "Enable Toon shading");
+	uiDefBlockBut(block, edge_render_menu, NULL, "Edge Settings |>> ", 200, 94, 110, 20, "Display edge settings");
 	uiBlockEndAlign(block);
 
 	/* unified render buttons */
 	if(G.scene->r.mode & R_UNIFIED) {
-		uiDefBlockBut(block, post_render_menu, NULL, "Post process |>> ", 205, 48, 92, 19, "Only for unified render");
+		uiDefBlockBut(block, post_render_menu, NULL, "Post process |>> ", 200, 68, 110, 20, "Only for unified render");
 		if (G.scene->r.mode & R_GAMMA) {
-			uiDefButF(block, NUMSLI, 0,"Gamma:",		8, 48, 143, 19,
+			uiDefButF(block, NUMSLI, 0,"Gamma:",		10, 68, 142, 20,
 					 &(G.scene->r.gamma), 0.2, 5.0, B_GAMMASLI, 0,
 					 "The gamma value for blending oversampled images (1.0 = no correction).");
 		}
@@ -1113,7 +1115,7 @@
 	uiDefButF(block, NUM,B_DIFF,"",			627,34,60,20,&G.scene->r.gauss,0.5, 1.5, 100, 2, "Sets the Gaussian filter size");
 	
 	uiDefButI(block, TOG|BIT|9,REDRAWVIEWCAM, "Border",	565,13,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Render a small cut-out of the image");
-	uiDefButI(block, TOG|BIT|2,0, "Gamma",	627,13,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Enable gamma correction");
+	uiDefButI(block, TOG|BIT|2,B_REDR, "Gamma",	627,13,60,20, &G.scene->r.mode, 0, 0, 0, 0, "Enable gamma correction");
 	uiBlockEndAlign(block);
 
 }

--------------020302020601060407000301
Content-Type: text/plain;
 name="rounded_theme_dropdowns.txt"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
 filename="rounded_theme_dropdowns.txt"

Index: source/blender/src/interface_draw.c
===================================================================
RCS file: /cvsroot/bf-blender/blender/source/blender/src/interface_draw.c,v
retrieving revision 1.19
diff -u -r1.19 interface_draw.c
--- source/blender/src/interface_draw.c	8 Jul 2004 20:38:26 -0000	1.19
+++ source/blender/src/interface_draw.c	27 Jul 2004 19:38:05 -0000
@@ -1079,6 +1079,7 @@
 static void ui_draw_round(int type, int colorid, float asp, float x1, float y1, float x2, float y2, int flag)
 {
 	int align= (flag & UI_BUT_ALIGN);
+	int roundswitch= 0;
 	
 	/* paper */
 	if(flag & UI_SELECT) {
@@ -1094,14 +1095,17 @@
 		switch(align) {
 		case UI_BUT_ALIGN_TOP:
 			uiSetRoundBox(12);
+			roundswitch= 4;
 			round_button(x1, y1, x2, y2, asp, colorid);
 			break;
 		case UI_BUT_ALIGN_DOWN:
 			uiSetRoundBox(3);
+			roundswitch= 2;
 			round_button(x1, y1, x2, y2, asp, colorid);
 			break;
 		case UI_BUT_ALIGN_LEFT:
 			uiSetRoundBox(6);
+			roundswitch= 6;
 			round_button(x1, y1, x2, y2, asp, colorid);
 			break;
 		case UI_BUT_ALIGN_RIGHT:
@@ -1115,6 +1119,7 @@
 			break;
 		case UI_BUT_ALIGN_DOWN|UI_BUT_ALIGN_LEFT:
 			uiSetRoundBox(2);
+			roundswitch= 2;
 			round_button(x1, y1, x2, y2, asp, colorid);
 			break;
 		case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_RIGHT:
@@ -1123,6 +1128,7 @@
 			break;
 		case UI_BUT_ALIGN_TOP|UI_BUT_ALIGN_LEFT:
 			uiSetRoundBox(4);
+			roundswitch= 4;
 			round_button(x1, y1, x2, y2, asp, colorid);
 			break;
 			
@@ -1133,6 +1139,7 @@
 	} 
 	else {
 		uiSetRoundBox(15);
+		roundswitch= 6;
 		round_button(x1, y1, x2, y2, asp, colorid);
 	}
 	
@@ -1163,7 +1170,7 @@
 		else BIF_ThemeColorShade(colorid, -10);
 		// assuming its not inside alignment...
 		if(x2-x1 > 24) {
-			uiSetRoundBox(6);
+			uiSetRoundBox(roundswitch);
 			glBegin(GL_POLYGON);
 			gl_round_box(x2-16, y1+asp, x2-asp, y2-asp, 7.0);
 			glEnd();

--------------020302020601060407000301--