Fix [#20655] wrong button shading

Also restored copy/paste for color swatches
This commit is contained in:
Matt Ebb
2010-01-13 02:01:34 +00:00
parent 8e076e0341
commit 0edecb73cf
3 changed files with 4 additions and 6 deletions
+1 -1
View File
@@ -812,7 +812,7 @@ static void ui_is_but_sel(uiBut *but)
if(value == but->hardmax) push= 1;
break;
case COL:
push= 1;
push= 2;
break;
default:
push= 2;
@@ -948,7 +948,7 @@ static void ui_but_copy_paste(bContext *C, uiBut *but, uiHandleButtonData *data,
else {
if (sscanf(buf, "[%f, %f, %f]", &rgb[0], &rgb[1], &rgb[2]) == 3) {
button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
VECCOPY(data->vec, rgb);
ui_set_but_vectorf(but, rgb);
button_activate_state(C, but, BUTTON_STATE_EXIT);
}
}
@@ -1330,10 +1330,8 @@ static void widget_state(uiWidgetType *wt, int state)
VECCOPY(wt->wcol.text, wt->wcol.text_sel);
/* only flip shade if it's not "pushed in" already */
if(wt->wcol.shaded && wt->wcol.shadetop>wt->wcol.shadedown) {
SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
}
/* swap for selection - show depressed */
SWAP(short, wt->wcol.shadetop, wt->wcol.shadedown);
}
else {
if(state & UI_BUT_ANIMATED_KEY)