UI: display a short pulse when displaying reports in the status bar
This functionality was lost in [0].
[0]: 694bc4d040
This commit is contained in:
@@ -6406,6 +6406,12 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
|
||||
UI_text_colorid_from_report_type(report->type), SPACE_INFO, report_text_color);
|
||||
report_text_color[3] = 255; /* This theme color is RGB only, so have to set alpha here. */
|
||||
|
||||
if (rti->flash_progress <= 1.0) {
|
||||
/* Flash report briefly according to progress through fade-out duration. */
|
||||
const int brighten_amount = int(32 * (1.0f - rti->flash_progress));
|
||||
add_v3_uchar_clamped(report_icon_color, brighten_amount);
|
||||
}
|
||||
|
||||
UI_fontstyle_set(&style->widgetlabel);
|
||||
int width = BLF_width(style->widgetlabel.uifont_id, report->message, report->len);
|
||||
width = min_ii(int(rti->widthfac * width), width);
|
||||
@@ -6446,7 +6452,6 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
|
||||
0,
|
||||
0,
|
||||
"");
|
||||
|
||||
/* Use icon background at low opacity to highlight, but still contrasting with area TH_TEXT. */
|
||||
copy_v3_v3_uchar(but->col, report_icon_color);
|
||||
but->col[3] = 64;
|
||||
@@ -6465,7 +6470,6 @@ void uiTemplateReportsBanner(uiLayout *layout, bContext *C)
|
||||
UI_UNIT_X,
|
||||
UI_UNIT_Y,
|
||||
TIP_("Click to open the info editor"));
|
||||
|
||||
copy_v4_v4_uchar(but->col, report_text_color);
|
||||
|
||||
/* The report message. */
|
||||
|
||||
@@ -634,6 +634,7 @@ static int update_reports_display_invoke(bContext *C, wmOperator * /*op*/, const
|
||||
/* flash report briefly according to progress through fade-out duration */
|
||||
interp_v4_v4v4(rti->col, rti->col, target_col, flash_progress);
|
||||
}
|
||||
rti->flash_progress = flash_progress;
|
||||
|
||||
/* collapse report at end of timeout */
|
||||
if (progress * timeout > timeout - COLLAPSE_TIMEOUT) {
|
||||
|
||||
@@ -107,6 +107,7 @@ typedef struct ReportList {
|
||||
typedef struct ReportTimerInfo {
|
||||
float col[4];
|
||||
float widthfac;
|
||||
float flash_progress;
|
||||
} ReportTimerInfo;
|
||||
|
||||
//#ifdef WITH_XR_OPENXR
|
||||
|
||||
Reference in New Issue
Block a user