UI: Visual style update to panels

Back in Blender 2.30, the GUI project brought panels into Blender among other important visual updates.
For the first time it was possible to move the wall of buttons around. Providing a clear separation
between sections (it even allowed the grouping of panels in tabs!)

During the 2.5 redesign, the separation between panels became a line on top of each panel, and panels received
theme settings for background and header colors. The default theme used the same color for both.

In 2.8 the background color of panels was different from headers in the default theme, so the separator
line was removed. While the separator line wasn't elegant (only on top, non-themeable, hard-coded emboss effect),
it provided a sort of separation between panels.

This patch solves the panels-separation by simply adding a margin space around them (not visible in default theme yet).
Even though the margin reduces the width of the working area slightly, it makes room for the upcoming always-visible scrollbars.

Other adjustments:
* Use arrow icon instead of triangle to collapse/expand
* Use rounded corners to match the rest of the UI (editor corners, nodes, etc).

{F10953929, size=full}

Margin on panels makes use of the `style->panelouter` property that hasn't been
used in a while. Also slight tweaks to `boxspace` and `templatespace` style properties so they
are multiples of 2 and operations on them round better.

There is technically no need to update the themes for them to work, so no theme changes are included in this patch.

{F10953931, size=full}

{F10953933, size=full}

{F10953934, size=full}

{F10954003, size=full}

----

A new theme setting under Style controls the roundness of all panels (added it to Style instead of ThemeSpace because I think controlling the panel roundness per editor is a bit overkill):
{F11091561, size=full, autoplay, loop}

Reviewed By: HooglyBoogly

Differential Revision: https://developer.blender.org/D12814
This commit is contained in:
Pablo Vazquez 2021-10-17 18:22:53 +02:00
parent 19740b25c7
commit 93544b641b
19 changed files with 92 additions and 130 deletions

@ -260,6 +260,7 @@ const bTheme U_theme_default = {
.icon_modifier = RGBA(0x84b8ffff), .icon_modifier = RGBA(0x84b8ffff),
.icon_shading = RGBA(0xea7581ff), .icon_shading = RGBA(0xea7581ff),
.icon_folder = RGBA(0xe3c16eff), .icon_folder = RGBA(0xe3c16eff),
.panel_roundness = 0.4f,
}, },
.space_properties = { .space_properties = {
.back = RGBA(0x42424200), .back = RGBA(0x42424200),

@ -9,6 +9,7 @@
widget_emboss="#00000026" widget_emboss="#00000026"
editor_outline="#1f1f1f" editor_outline="#1f1f1f"
widget_text_cursor="#3399e6" widget_text_cursor="#3399e6"
panel_roundness="0.4"
transparent_checker_primary="#333333" transparent_checker_primary="#333333"
transparent_checker_secondary="#262626" transparent_checker_secondary="#262626"
transparent_checker_size="8" transparent_checker_size="8"

@ -70,7 +70,7 @@ class ConstraintButtonsPanel:
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
bl_label = "" bl_label = ""
bl_options = {'INSTANCED', 'HEADER_LAYOUT_EXPAND', 'DRAW_BOX'} bl_options = {'INSTANCED', 'HEADER_LAYOUT_EXPAND'}
@staticmethod @staticmethod
def draw_influence(layout, con): def draw_influence(layout, con):
@ -976,7 +976,6 @@ class ConstraintButtonsSubPanel:
bl_space_type = 'PROPERTIES' bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW' bl_region_type = 'WINDOW'
bl_label = "" bl_label = ""
bl_options = {'DRAW_BOX'}
def get_constraint(self, _context): def get_constraint(self, _context):
con = self.custom_data con = self.custom_data

@ -920,6 +920,7 @@ class USERPREF_PT_theme_interface_styles(ThemePanel, CenterAlignMixIn, Panel):
flow.prop(ui, "editor_outline") flow.prop(ui, "editor_outline")
flow.prop(ui, "widget_text_cursor") flow.prop(ui, "widget_text_cursor")
flow.prop(ui, "widget_emboss") flow.prop(ui, "widget_emboss")
flow.prop(ui, "panel_roundness")
class USERPREF_PT_theme_interface_transparent_checker(ThemePanel, CenterAlignMixIn, Panel): class USERPREF_PT_theme_interface_transparent_checker(ThemePanel, CenterAlignMixIn, Panel):

@ -39,7 +39,7 @@ extern "C" {
/* Blender file format version. */ /* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION #define BLENDER_FILE_VERSION BLENDER_VERSION
#define BLENDER_FILE_SUBVERSION 33 #define BLENDER_FILE_SUBVERSION 34
/* Minimum Blender version that supports reading file written with the current /* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file * version. Older Blender versions will test this and show a warning if the file

@ -301,8 +301,6 @@ enum {
PANEL_TYPE_LAYOUT_VERT_BAR = (1 << 3), PANEL_TYPE_LAYOUT_VERT_BAR = (1 << 3),
/** This panel type represents data external to the UI. */ /** This panel type represents data external to the UI. */
PANEL_TYPE_INSTANCED = (1 << 4), PANEL_TYPE_INSTANCED = (1 << 4),
/** Draw panel like a box widget. */
PANEL_TYPE_DRAW_BOX = (1 << 6),
/** Don't search panels with this type during property search. */ /** Don't search panels with this type during property search. */
PANEL_TYPE_NO_SEARCH = (1 << 7), PANEL_TYPE_NO_SEARCH = (1 << 7),
}; };

@ -306,6 +306,10 @@ static void do_versions_theme(const UserDef *userdef, bTheme *btheme)
btheme->space_node.movie[3] = U_theme_default.space_node.movie[3]; btheme->space_node.movie[3] = U_theme_default.space_node.movie[3];
} }
if (!USER_VERSION_ATLEAST(300, 34)) {
btheme->tui.panel_roundness = 0.4f;
}
/** /**
* Versioning code until next subversion bump goes here. * Versioning code until next subversion bump goes here.
* *

@ -187,7 +187,7 @@ static PanelType *fmodifier_panel_register(ARegionType *region_type,
/* Give the panel the special flag that says it was built here and corresponds to a /* Give the panel the special flag that says it was built here and corresponds to a
* modifier rather than a #PanelType. */ * modifier rather than a #PanelType. */
panel_type->flag = PANEL_TYPE_HEADER_EXPAND | PANEL_TYPE_DRAW_BOX | PANEL_TYPE_INSTANCED; panel_type->flag = PANEL_TYPE_HEADER_EXPAND | PANEL_TYPE_INSTANCED;
panel_type->reorder = fmodifier_reorder; panel_type->reorder = fmodifier_reorder;
panel_type->get_list_data_expand_flag = get_fmodifier_expand_flag; panel_type->get_list_data_expand_flag = get_fmodifier_expand_flag;
panel_type->set_list_data_expand_flag = set_fmodifier_expand_flag; panel_type->set_list_data_expand_flag = set_fmodifier_expand_flag;
@ -221,7 +221,7 @@ static PanelType *fmodifier_subpanel_register(ARegionType *region_type,
panel_type->draw_header = draw_header; panel_type->draw_header = draw_header;
panel_type->draw = draw; panel_type->draw = draw;
panel_type->poll = poll; panel_type->poll = poll;
panel_type->flag = PANEL_TYPE_DEFAULT_CLOSED | PANEL_TYPE_DRAW_BOX; panel_type->flag = PANEL_TYPE_DEFAULT_CLOSED ;
BLI_assert(parent != NULL); BLI_assert(parent != NULL);
BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME); BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME);

@ -252,7 +252,8 @@ enum {
#define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f) #define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f)
#define UI_PANEL_BOX_STYLE_MARGIN (U.widget_unit * 0.2f) #define UI_PANEL_MARGIN_X (U.widget_unit * 0.4f)
#define UI_PANEL_MARGIN_Y (U.widget_unit * 0.2f)
/* but->drawflag - these flags should only affect how the button is drawn. */ /* but->drawflag - these flags should only affect how the button is drawn. */
/* NOTE: currently, these flags *are not passed* to the widget's state() or draw() functions /* NOTE: currently, these flags *are not passed* to the widget's state() or draw() functions

@ -116,7 +116,7 @@ extern const char ui_radial_dir_to_numpad[8];
extern const short ui_radial_dir_to_angle[8]; extern const short ui_radial_dir_to_angle[8];
/* internal panel drawing defines */ /* internal panel drawing defines */
#define PNL_HEADER (UI_UNIT_Y * 1.2) /* 24 default */ #define PNL_HEADER (UI_UNIT_Y * 1.25) /* 24 default */
/* bit button defines */ /* bit button defines */
/* Bit operations */ /* Bit operations */

@ -1112,23 +1112,14 @@ static void panel_draw_highlight_border(const Panel *panel,
const rcti *rect, const rcti *rect,
const rcti *header_rect) const rcti *header_rect)
{ {
const bool draw_box_style = panel->type->flag & PANEL_TYPE_DRAW_BOX;
const bool is_subpanel = panel->type->parent != NULL; const bool is_subpanel = panel->type->parent != NULL;
if (is_subpanel) { if (is_subpanel) {
return; return;
} }
float radius; const bTheme *btheme = UI_GetTheme();
if (draw_box_style) { const float radius = btheme->tui.panel_roundness * U.widget_unit * 0.5f;
/* Use the theme for box widgets. */
const uiWidgetColors *box_wcol = &UI_GetTheme()->tui.wcol_box;
UI_draw_roundbox_corner_set(UI_CNR_ALL); UI_draw_roundbox_corner_set(UI_CNR_ALL);
radius = box_wcol->roundness * U.widget_unit;
}
else {
UI_draw_roundbox_corner_set(UI_CNR_NONE);
radius = 0.0f;
}
float color[4]; float color[4];
UI_GetThemeColor4fv(TH_SELECT_ACTIVE, color); UI_GetThemeColor4fv(TH_SELECT_ACTIVE, color);
@ -1172,18 +1163,17 @@ static void panel_draw_aligned_widgets(const uiStyle *style,
/* Draw collapse icon. */ /* Draw collapse icon. */
{ {
rctf collapse_rect = { const float size_y = BLI_rcti_size_y(&widget_rect);
.xmin = widget_rect.xmin, GPU_blend(GPU_BLEND_ALPHA);
.xmax = widget_rect.xmin + header_height, UI_icon_draw_ex(widget_rect.xmin + size_y * 0.2f,
.ymin = widget_rect.ymin, widget_rect.ymin + size_y * 0.2f,
.ymax = widget_rect.ymax, UI_panel_is_closed(panel) ? ICON_RIGHTARROW : ICON_DOWNARROW_HLT,
}; aspect * U.inv_dpi_fac,
BLI_rctf_scale(&collapse_rect, 0.25f); 0.7f,
0.0f,
float triangle_color[4]; title_color,
rgba_uchar_to_float(triangle_color, title_color); false);
GPU_blend(GPU_BLEND_NONE);
ui_draw_anti_tria_rect(&collapse_rect, UI_panel_is_closed(panel) ? 'h' : 'v', triangle_color);
} }
/* Draw text label. */ /* Draw text label. */
@ -1243,7 +1233,6 @@ static void panel_draw_aligned_backdrop(const Panel *panel,
const rcti *rect, const rcti *rect,
const rcti *header_rect) const rcti *header_rect)
{ {
const bool draw_box_style = panel->type->flag & PANEL_TYPE_DRAW_BOX;
const bool is_subpanel = panel->type->parent != NULL; const bool is_subpanel = panel->type->parent != NULL;
const bool is_open = !UI_panel_is_closed(panel); const bool is_open = !UI_panel_is_closed(panel);
@ -1251,91 +1240,53 @@ static void panel_draw_aligned_backdrop(const Panel *panel,
return; return;
} }
const uint pos = GPU_vertformat_attr_add( const bTheme *btheme = UI_GetTheme();
immVertexFormat(), "pos", GPU_COMP_F32, 2, GPU_FETCH_FLOAT); const float radius = btheme->tui.panel_roundness * U.widget_unit * 0.5f;
/* Draw with an opaque box backdrop for box style panels. */
if (draw_box_style) {
/* Use the theme for box widgets. */
const uiWidgetColors *box_wcol = &UI_GetTheme()->tui.wcol_box;
if (is_subpanel) {
/* Use rounded bottom corners for the last subpanel. */
if (panel->next == NULL) {
UI_draw_roundbox_corner_set(UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT);
float color[4];
UI_GetThemeColor4fv(TH_PANEL_SUB_BACK, color);
/* Change the width a little bit to line up with sides. */
UI_draw_roundbox_aa(
&(const rctf){
.xmin = rect->xmin + U.pixelsize,
.xmax = rect->xmax - U.pixelsize,
.ymin = rect->ymin + U.pixelsize,
.ymax = rect->ymax,
},
true,
box_wcol->roundness * U.widget_unit,
color);
}
else {
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
immUniformThemeColor(TH_PANEL_SUB_BACK);
immRectf(pos, rect->xmin + U.pixelsize, rect->ymin, rect->xmax - U.pixelsize, rect->ymax);
immUnbindProgram();
}
}
else {
/* Expand the top a tiny bit to give header buttons equal size above and below. */
rcti box_rect = {
.xmin = rect->xmin,
.xmax = rect->xmax,
.ymin = is_open ? rect->ymin : header_rect->ymin,
.ymax = header_rect->ymax + U.pixelsize,
};
ui_draw_box_opaque(&box_rect, UI_CNR_ALL);
/* Mimic the border between aligned box widgets for the bottom of the header. */
if (is_open) {
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
GPU_blend(GPU_BLEND_ALPHA);
/* Top line. */
immUniformColor4ubv(box_wcol->outline);
immRectf(pos, rect->xmin, header_rect->ymin - U.pixelsize, rect->xmax, header_rect->ymin);
/* Bottom "shadow" line. */
immUniformThemeColor(TH_WIDGET_EMBOSS);
immRectf(pos,
rect->xmin,
header_rect->ymin - U.pixelsize,
rect->xmax,
header_rect->ymin - U.pixelsize - 1);
GPU_blend(GPU_BLEND_NONE);
immUnbindProgram();
}
}
}
else {
immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR); immBindBuiltinProgram(GPU_SHADER_2D_UNIFORM_COLOR);
GPU_blend(GPU_BLEND_ALPHA); GPU_blend(GPU_BLEND_ALPHA);
/* Panel backdrop. */ /* Panel backdrop. */
if (is_open || panel->type->flag & PANEL_TYPE_NO_HEADER) { if (is_open || panel->type->flag & PANEL_TYPE_NO_HEADER) {
immUniformThemeColor(is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK); float panel_backcolor[4];
immRectf(pos, rect->xmin, rect->ymin, rect->xmax, rect->ymax); UI_draw_roundbox_corner_set(is_open ? UI_CNR_BOTTOM_RIGHT | UI_CNR_BOTTOM_LEFT : UI_CNR_ALL);
UI_GetThemeColor4fv((is_subpanel ? TH_PANEL_SUB_BACK : TH_PANEL_BACK), panel_backcolor);
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect->xmin,
.xmax = rect->xmax,
.ymin = rect->ymin,
.ymax = rect->ymax,
},
true,
radius,
panel_backcolor);
} }
/* Panel header backdrops for non sub-panels. */ /* Panel header backdrops for non sub-panels. */
if (!is_subpanel) { if (!is_subpanel) {
immUniformThemeColor(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_HEADER); float panel_headercolor[4];
immRectf(pos, rect->xmin, header_rect->ymin, rect->xmax, header_rect->ymax); UI_GetThemeColor4fv(UI_panel_matches_search_filter(panel) ? TH_MATCH : TH_PANEL_HEADER,
panel_headercolor);
UI_draw_roundbox_corner_set(is_open ? UI_CNR_TOP_RIGHT | UI_CNR_TOP_LEFT : UI_CNR_ALL);
/* Change the width a little bit to line up with the sides. */
UI_draw_roundbox_4fv(
&(const rctf){
.xmin = rect->xmin,
.xmax = rect->xmax,
.ymin = header_rect->ymin,
.ymax = header_rect->ymax,
},
true,
radius,
panel_headercolor);
} }
GPU_blend(GPU_BLEND_NONE); GPU_blend(GPU_BLEND_NONE);
immUnbindProgram(); immUnbindProgram();
} }
}
/** /**
* Draw a panel integrated in buttons-window, tool/property lists etc. * Draw a panel integrated in buttons-window, tool/property lists etc.
@ -1789,9 +1740,9 @@ static bool uiAlignPanelStep(ARegion *region, const float factor, const bool dra
const int region_offset_x = panel_region_offset_x_get(region); const int region_offset_x = panel_region_offset_x_get(region);
for (int i = 0; i < active_panels_len; i++) { for (int i = 0; i < active_panels_len; i++) {
PanelSort *ps = &panel_sort[i]; PanelSort *ps = &panel_sort[i];
const bool use_box = ps->panel->type->flag & PANEL_TYPE_DRAW_BOX; const bool no_header = ps->panel->type->flag & PANEL_TYPE_NO_HEADER;
ps->panel->runtime.region_ofsx = region_offset_x; ps->panel->runtime.region_ofsx = region_offset_x;
ps->new_offset_x = region_offset_x + ((use_box) ? UI_PANEL_BOX_STYLE_MARGIN : 0); ps->new_offset_x = region_offset_x + (no_header ? 0 : UI_PANEL_MARGIN_X);
} }
/* Y offset. */ /* Y offset. */
@ -1799,10 +1750,7 @@ static bool uiAlignPanelStep(ARegion *region, const float factor, const bool dra
PanelSort *ps = &panel_sort[i]; PanelSort *ps = &panel_sort[i];
y -= get_panel_real_size_y(ps->panel); y -= get_panel_real_size_y(ps->panel);
const bool use_box = ps->panel->type->flag & PANEL_TYPE_DRAW_BOX; y -= UI_PANEL_MARGIN_Y;
if (use_box) {
y -= UI_PANEL_BOX_STYLE_MARGIN;
}
ps->new_offset_y = y; ps->new_offset_y = y;
/* The header still draws offset by the size of closed panels, so apply the offset here. */ /* The header still draws offset by the size of closed panels, so apply the offset here. */
if (UI_panel_is_closed(ps->panel)) { if (UI_panel_is_closed(ps->panel)) {

@ -2977,12 +2977,11 @@ void ED_region_panels_layout_ex(const bContext *C,
margin_x = category_tabs_width; margin_x = category_tabs_width;
} }
const int w = BLI_rctf_size_x(&v2d->cur) - margin_x; const int width_no_header = BLI_rctf_size_x(&v2d->cur) - margin_x;
const int width = width_no_header - UI_PANEL_MARGIN_X * 2.0f;
/* Works out to 10 * UI_UNIT_X or 20 * UI_UNIT_X. */ /* Works out to 10 * UI_UNIT_X or 20 * UI_UNIT_X. */
const int em = (region->type->prefsizex) ? 10 : 20; const int em = (region->type->prefsizex) ? 10 : 20;
const int w_box_panel = w - UI_PANEL_BOX_STYLE_MARGIN * 2.0f;
/* create panels */ /* create panels */
UI_panels_begin(C, region); UI_panels_begin(C, region);
@ -3018,7 +3017,7 @@ void ED_region_panels_layout_ex(const bContext *C,
&region->panels, &region->panels,
pt, pt,
panel, panel,
(pt->flag & PANEL_TYPE_DRAW_BOX) ? w_box_panel : w, (pt->flag & PANEL_TYPE_NO_HEADER) ? width_no_header : width,
em, em,
NULL, NULL,
search_filter); search_filter);
@ -3052,7 +3051,7 @@ void ED_region_panels_layout_ex(const bContext *C,
&region->panels, &region->panels,
panel->type, panel->type,
panel, panel,
(panel->type->flag & PANEL_TYPE_DRAW_BOX) ? w_box_panel : w, (panel->type->flag & PANEL_TYPE_NO_HEADER) ? width_no_header : width,
em, em,
unique_panel_str, unique_panel_str,
search_filter); search_filter);

@ -336,7 +336,7 @@ void register_row_filter_panels(ARegionType &region_type)
strcpy(panel_type->label, ""); strcpy(panel_type->label, "");
strcpy(panel_type->category, "Filters"); strcpy(panel_type->category, "Filters");
strcpy(panel_type->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA); strcpy(panel_type->translation_context, BLT_I18NCONTEXT_DEFAULT_BPYRNA);
panel_type->flag = PANEL_TYPE_INSTANCED | PANEL_TYPE_DRAW_BOX | PANEL_TYPE_HEADER_EXPAND; panel_type->flag = PANEL_TYPE_INSTANCED | PANEL_TYPE_HEADER_EXPAND;
panel_type->draw_header = spreadsheet_filter_panel_draw_header; panel_type->draw_header = spreadsheet_filter_panel_draw_header;
panel_type->draw = spreadsheet_filter_panel_draw; panel_type->draw = spreadsheet_filter_panel_draw;
panel_type->get_list_data_expand_flag = get_filter_expand_flag; panel_type->get_list_data_expand_flag = get_filter_expand_flag;

@ -380,7 +380,7 @@ PanelType *gpencil_modifier_panel_register(ARegionType *region_type,
/* Give the panel the special flag that says it was built here and corresponds to a /* Give the panel the special flag that says it was built here and corresponds to a
* modifier rather than a #PanelType. */ * modifier rather than a #PanelType. */
panel_type->flag = PANEL_TYPE_HEADER_EXPAND | PANEL_TYPE_DRAW_BOX | PANEL_TYPE_INSTANCED; panel_type->flag = PANEL_TYPE_HEADER_EXPAND | PANEL_TYPE_INSTANCED;
panel_type->reorder = gpencil_modifier_reorder; panel_type->reorder = gpencil_modifier_reorder;
panel_type->get_list_data_expand_flag = get_gpencil_modifier_expand_flag; panel_type->get_list_data_expand_flag = get_gpencil_modifier_expand_flag;
panel_type->set_list_data_expand_flag = set_gpencil_modifier_expand_flag; panel_type->set_list_data_expand_flag = set_gpencil_modifier_expand_flag;
@ -413,7 +413,7 @@ PanelType *gpencil_modifier_subpanel_register(ARegionType *region_type,
panel_type->draw_header = draw_header; panel_type->draw_header = draw_header;
panel_type->draw = draw; panel_type->draw = draw;
panel_type->poll = gpencil_modifier_ui_poll; panel_type->poll = gpencil_modifier_ui_poll;
panel_type->flag = (PANEL_TYPE_DEFAULT_CLOSED | PANEL_TYPE_DRAW_BOX); panel_type->flag = PANEL_TYPE_DEFAULT_CLOSED ;
BLI_assert(parent != NULL); BLI_assert(parent != NULL);
BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME); BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME);

@ -206,6 +206,10 @@ typedef struct ThemeUI {
/** Intensity of the border icons. >0 will render an border around themed /** Intensity of the border icons. >0 will render an border around themed
* icons. */ * icons. */
float icon_border_intensity; float icon_border_intensity;
float panel_roundness;
char _pad2[4];
} ThemeUI; } ThemeUI;
/* try to put them all in one, if needed a special struct can be created as well /* try to put them all in one, if needed a special struct can be created as well

@ -1373,7 +1373,6 @@ static void rna_def_panel(BlenderRNA *brna)
0, 0,
"Expand Header Layout", "Expand Header Layout",
"Allow buttons in the header to stretch and shrink to fill the entire layout width"}, "Allow buttons in the header to stretch and shrink to fill the entire layout width"},
{PANEL_TYPE_DRAW_BOX, "DRAW_BOX", 0, "Box Style", "Display panel with the box widget theme"},
{0, NULL, 0, NULL, NULL}, {0, NULL, 0, NULL, NULL},
}; };

@ -1560,6 +1560,13 @@ static void rna_def_userdef_theme_ui(BlenderRNA *brna)
prop, "Text Cursor", "Color of the interface widgets text insertion cursor (caret)"); prop, "Text Cursor", "Color of the interface widgets text insertion cursor (caret)");
RNA_def_property_update(prop, 0, "rna_userdef_theme_update"); RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
prop = RNA_def_property(srna, "panel_roundness", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_ui_text(
prop, "Panel Roundness", "Roundness of the corners of panels and sub-panels");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_float_default(prop, 0.4f);
RNA_def_property_update(prop, 0, "rna_userdef_theme_update");
/* Transparent Grid */ /* Transparent Grid */
prop = RNA_def_property(srna, "transparent_checker_primary", PROP_FLOAT, PROP_COLOR_GAMMA); prop = RNA_def_property(srna, "transparent_checker_primary", PROP_FLOAT, PROP_COLOR_GAMMA);
RNA_def_property_float_sdna(prop, NULL, "transparent_checker_primary"); RNA_def_property_float_sdna(prop, NULL, "transparent_checker_primary");

@ -448,7 +448,7 @@ PanelType *modifier_panel_register(ARegionType *region_type, ModifierType type,
/* Give the panel the special flag that says it was built here and corresponds to a /* Give the panel the special flag that says it was built here and corresponds to a
* modifier rather than a #PanelType. */ * modifier rather than a #PanelType. */
panel_type->flag = PANEL_TYPE_HEADER_EXPAND | PANEL_TYPE_DRAW_BOX | PANEL_TYPE_INSTANCED; panel_type->flag = PANEL_TYPE_HEADER_EXPAND | PANEL_TYPE_INSTANCED;
panel_type->reorder = modifier_reorder; panel_type->reorder = modifier_reorder;
panel_type->get_list_data_expand_flag = get_modifier_expand_flag; panel_type->get_list_data_expand_flag = get_modifier_expand_flag;
panel_type->set_list_data_expand_flag = set_modifier_expand_flag; panel_type->set_list_data_expand_flag = set_modifier_expand_flag;
@ -482,7 +482,7 @@ PanelType *modifier_subpanel_register(ARegionType *region_type,
panel_type->draw_header = draw_header; panel_type->draw_header = draw_header;
panel_type->draw = draw; panel_type->draw = draw;
panel_type->poll = modifier_ui_poll; panel_type->poll = modifier_ui_poll;
panel_type->flag = (PANEL_TYPE_DEFAULT_CLOSED | PANEL_TYPE_DRAW_BOX); panel_type->flag = PANEL_TYPE_DEFAULT_CLOSED;
BLI_assert(parent != NULL); BLI_assert(parent != NULL);
BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME); BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME);

@ -254,7 +254,7 @@ PanelType *shaderfx_panel_register(ARegionType *region_type, ShaderFxType type,
/* Give the panel the special flag that says it was built here and corresponds to a /* Give the panel the special flag that says it was built here and corresponds to a
* shader effect rather than a PanelType. */ * shader effect rather than a PanelType. */
panel_type->flag = PANEL_TYPE_HEADER_EXPAND | PANEL_TYPE_DRAW_BOX | PANEL_TYPE_INSTANCED; panel_type->flag = PANEL_TYPE_HEADER_EXPAND | PANEL_TYPE_INSTANCED;
panel_type->reorder = shaderfx_reorder; panel_type->reorder = shaderfx_reorder;
panel_type->get_list_data_expand_flag = get_shaderfx_expand_flag; panel_type->get_list_data_expand_flag = get_shaderfx_expand_flag;
panel_type->set_list_data_expand_flag = set_shaderfx_expand_flag; panel_type->set_list_data_expand_flag = set_shaderfx_expand_flag;
@ -287,7 +287,7 @@ PanelType *shaderfx_subpanel_register(ARegionType *region_type,
panel_type->draw_header = draw_header; panel_type->draw_header = draw_header;
panel_type->draw = draw; panel_type->draw = draw;
panel_type->poll = shaderfx_ui_poll; panel_type->poll = shaderfx_ui_poll;
panel_type->flag = (PANEL_TYPE_DEFAULT_CLOSED | PANEL_TYPE_DRAW_BOX); panel_type->flag = PANEL_TYPE_DEFAULT_CLOSED;
BLI_assert(parent != NULL); BLI_assert(parent != NULL);
BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME); BLI_strncpy(panel_type->parent_id, parent->idname, BKE_ST_MAXNAME);