[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [55553] trunk/blender/source/blender/ editors/interface: UI small fixes:

Ton Roosendaal ton at blender.org
Sun Mar 24 19:59:15 CET 2013


Revision: 55553
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=55553
Author:   ton
Date:     2013-03-24 18:59:15 +0000 (Sun, 24 Mar 2013)
Log Message:
-----------
UI small fixes:

- Theme color for the brush popup was not correctly coded. Now it follows menu item
  style correctly, which also allows all the themes we have to give readable text.

- RMB cancel also added for slider buttons and the color picker.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/interface/interface_handlers.c
    trunk/blender/source/blender/editors/interface/interface_widgets.c

Modified: trunk/blender/source/blender/editors/interface/interface_handlers.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_handlers.c	2013-03-24 18:14:38 UTC (rev 55552)
+++ trunk/blender/source/blender/editors/interface/interface_handlers.c	2013-03-24 18:59:15 UTC (rev 55553)
@@ -3261,7 +3261,7 @@
 		}
 	}
 	else if (data->state == BUTTON_STATE_NUM_EDITING) {
-		if (event->type == ESCKEY) {
+		if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
 			data->cancel = TRUE;
 			data->escapecancel = TRUE;
 			button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -3839,7 +3839,7 @@
 		}
 	}
 	else if (data->state == BUTTON_STATE_NUM_EDITING) {
-		if (event->type == ESCKEY) {
+		if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
 			data->cancel = TRUE;
 			data->escapecancel = TRUE;
 			button_activate_state(C, but, BUTTON_STATE_EXIT);
@@ -4036,7 +4036,7 @@
 		}
 	}
 	else if (data->state == BUTTON_STATE_NUM_EDITING) {
-		if (event->type == ESCKEY) {
+		if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
 			data->cancel = TRUE;
 			data->escapecancel = TRUE;
 			button_activate_state(C, but, BUTTON_STATE_EXIT);

Modified: trunk/blender/source/blender/editors/interface/interface_widgets.c
===================================================================
--- trunk/blender/source/blender/editors/interface/interface_widgets.c	2013-03-24 18:14:38 UTC (rev 55552)
+++ trunk/blender/source/blender/editors/interface/interface_widgets.c	2013-03-24 18:59:15 UTC (rev 55553)
@@ -3527,7 +3527,6 @@
 	rcti trect = *rect, bg_rect;
 	float font_dims[2] = {0.0f, 0.0f};
 	uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM);
-	unsigned char bg_col[3];
 	
 	wt->state(wt, state);
 	wt->draw(&wt->wcol, rect, 0, 0);
@@ -3553,16 +3552,12 @@
 	if (bg_rect.xmax > rect->xmax - PREVIEW_PAD)
 		bg_rect.xmax = rect->xmax - PREVIEW_PAD;
 
-	UI_GetThemeColor3ubv(TH_BUTBACK, bg_col);
-	glColor4ubv((unsigned char *)wt->wcol.item);
+	glColor4ubv((unsigned char *)wt->wcol_theme->inner_sel);
 	glEnable(GL_BLEND);
 	glRecti(bg_rect.xmin, bg_rect.ymin, bg_rect.xmax, bg_rect.ymax);
 	glDisable(GL_BLEND);
 	
-	if (state == UI_ACTIVE)
-		glColor4ubv((unsigned char *)wt->wcol.text);
-	else
-		glColor4ubv((unsigned char *)wt->wcol.text_sel);
+	glColor3ubv((unsigned char *)wt->wcol.text);
 
 	uiStyleFontDraw(fstyle, &trect, name);
 }




More information about the Bf-blender-cvs mailing list