UI: remove recently added PIE progress display type
PIE was too similar to RING, as there is no need for two similar display styles - make only one available. Removal based on replies to !109882.
This commit is contained in:
@@ -1453,7 +1453,6 @@ enum {
|
||||
enum eButProgressType {
|
||||
UI_BUT_PROGRESS_TYPE_BAR = 0,
|
||||
UI_BUT_PROGRESS_TYPE_RING = 1,
|
||||
UI_BUT_PROGRESS_TYPE_PIE = 2,
|
||||
};
|
||||
|
||||
/***************************** ID Utilities *******************************/
|
||||
|
||||
@@ -3510,7 +3510,7 @@ void uiItemProgressIndicator(uiLayout *layout,
|
||||
0,
|
||||
"");
|
||||
|
||||
if (has_text && ELEM(progress_type, UI_BUT_PROGRESS_TYPE_RING, UI_BUT_PROGRESS_TYPE_PIE)) {
|
||||
if (has_text && (progress_type == UI_BUT_PROGRESS_TYPE_RING)) {
|
||||
/* For progress bar, centered is okay, left aligned for ring/pie. */
|
||||
but->drawflag |= UI_BUT_TEXT_LEFT;
|
||||
}
|
||||
|
||||
@@ -3640,11 +3640,11 @@ static void widget_progress_type_bar(uiButProgress *but_progress,
|
||||
/**
|
||||
* Used for both ring & pie types.
|
||||
*/
|
||||
static void widget_progress_type_circle(uiButProgress *but_progress,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect,
|
||||
const float ring_width)
|
||||
static void widget_progress_type_ring(uiButProgress *but_progress,
|
||||
uiWidgetColors *wcol,
|
||||
rcti *rect)
|
||||
{
|
||||
const float ring_width = 0.6; /* 0.0 would be a pie. */
|
||||
const float outer_rad = (rect->ymax - rect->ymin) / 2.0f;
|
||||
const float inner_rad = outer_rad * ring_width;
|
||||
const float x = rect->xmin + outer_rad;
|
||||
@@ -3687,12 +3687,8 @@ static void widget_progress_indicator(uiBut *but,
|
||||
widget_progress_type_bar(but_progress, wcol, rect, roundboxalign, zoom);
|
||||
break;
|
||||
}
|
||||
case UI_BUT_PROGRESS_TYPE_PIE: {
|
||||
widget_progress_type_circle(but_progress, wcol, rect, 0.6f);
|
||||
break;
|
||||
}
|
||||
case UI_BUT_PROGRESS_TYPE_RING: {
|
||||
widget_progress_type_circle(but_progress, wcol, rect, 0.0f);
|
||||
widget_progress_type_ring(but_progress, wcol, rect);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -959,7 +959,6 @@ void RNA_api_ui_layout(StructRNA *srna)
|
||||
static const EnumPropertyItem progress_type_items[] = {
|
||||
{UI_BUT_PROGRESS_TYPE_BAR, "BAR", 0, "Bar", ""},
|
||||
{UI_BUT_PROGRESS_TYPE_RING, "RING", 0, "Ring", ""},
|
||||
{UI_BUT_PROGRESS_TYPE_PIE, "PIE", 0, "Pie", ""},
|
||||
{0, nullptr, 0, nullptr, nullptr},
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user