Fix #124674: Missing UI update exiting palette color picking
Color picker supports palette color picking by clicking during the modal operator, but it will set initial color on the color property when exiting from palette color picking, but it didn't send out a notifier which means interface would kept showing last hovering color. This fix also included a more obvious visual notification on the bottom bar so the mode change gets more attention and would be harder to miss. ------- This PR makes it so that if you clicked while holding `Shift + X`, this info would prompt on the bottom bar, this may need interface to look & decide whether that's needed because previously the string change wasn't eye-catchy enough: <img width="194" alt="图片" src="attachments/5185f05a-54c2-45b9-acf9-3a0da8d686bb"> Pull Request: https://projects.blender.org/blender/blender/pulls/128842
This commit is contained in:
@@ -44,6 +44,7 @@
|
||||
#include "BKE_node_runtime.hh"
|
||||
#include "BKE_object.hh"
|
||||
#include "BKE_paint.hh"
|
||||
#include "BKE_report.hh"
|
||||
#include "BKE_scene.hh"
|
||||
|
||||
#include "NOD_texture.h"
|
||||
@@ -740,6 +741,7 @@ static wmOperatorStatus sample_color_modal(bContext *C, wmOperator *op, const wm
|
||||
if (data->sample_palette) {
|
||||
BKE_brush_color_set(scene, paint, brush, data->initcolor);
|
||||
RNA_boolean_set(op->ptr, "palette", true);
|
||||
WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush);
|
||||
}
|
||||
WM_cursor_modal_restore(CTX_wm_window(C));
|
||||
MEM_delete(data);
|
||||
@@ -769,6 +771,7 @@ static wmOperatorStatus sample_color_modal(bContext *C, wmOperator *op, const wm
|
||||
if (!data->sample_palette) {
|
||||
data->sample_palette = true;
|
||||
sample_color_update_header(data, C);
|
||||
BKE_report(op->reports, RPT_INFO, "Sampling color for pallette");
|
||||
}
|
||||
WM_event_add_notifier(C, NC_BRUSH | NA_EDITED, brush);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user