UI Code Quality: Use derived struct for progessbar buttons
For the main rationale behind this design, see 03b122e2a18df. Further, this removes users of `uiBut.a1`, which is a very ugly design choice (hard to reason about). Part of T74432.
This commit is contained in:
@@ -3609,6 +3609,7 @@ static void widget_scroll(
|
||||
static void widget_progressbar(
|
||||
uiBut *but, uiWidgetColors *wcol, rcti *rect, int UNUSED(state), int roundboxalign)
|
||||
{
|
||||
uiButProgressbar *but_progressbar = (uiButProgressbar *)but;
|
||||
uiWidgetBase wtb, wtb_bar;
|
||||
rcti rect_prog = *rect, rect_bar = *rect;
|
||||
|
||||
@@ -3616,7 +3617,7 @@ static void widget_progressbar(
|
||||
widget_init(&wtb_bar);
|
||||
|
||||
/* round corners */
|
||||
float value = but->a1;
|
||||
float value = but_progressbar->progress;
|
||||
float offs = wcol->roundness * BLI_rcti_size_y(&rect_prog);
|
||||
float w = value * BLI_rcti_size_x(&rect_prog);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user