diff options
-rw-r--r-- | release/scripts/startup/bl_ui/space_view3d.py | 6 | ||||
-rw-r--r-- | source/blender/editors/include/UI_interface.h | 4 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_templates.c | 14 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ui_api.c | 3 |
4 files changed, 18 insertions, 9 deletions
diff --git a/release/scripts/startup/bl_ui/space_view3d.py b/release/scripts/startup/bl_ui/space_view3d.py index 9c2f25b4fb1..3fe3612e9fd 100644 --- a/release/scripts/startup/bl_ui/space_view3d.py +++ b/release/scripts/startup/bl_ui/space_view3d.py @@ -4426,7 +4426,7 @@ class VIEW3D_PT_shading_lighting(Panel): if not system.edit_studio_light: sub.scale_y = 0.6 # smaller studiolight preview - sub.template_icon_view(shading, "studio_light", scale=3) + sub.template_icon_view(shading, "studio_light", scale_popup=3.0) else: sub.prop(system, "edit_studio_light", text="Disable Studio Light Edit", icon='NONE', toggle=True) @@ -4446,7 +4446,7 @@ class VIEW3D_PT_shading_lighting(Panel): elif shading.light == 'MATCAP': sub.scale_y = 0.6 # smaller matcap preview - sub.template_icon_view(shading, "studio_light", scale=3) + sub.template_icon_view(shading, "studio_light", scale_popup=3.0) col = split.column() col.operator("wm.studiolight_userpref_show", emboss=False, text="", icon='PREFERENCES') @@ -4463,7 +4463,7 @@ class VIEW3D_PT_shading_lighting(Panel): col = split.column() sub = col.row() sub.scale_y = 0.6 - sub.template_icon_view(shading, "studio_light", scale=3) + sub.template_icon_view(shading, "studio_light", scale_popup=3) col = split.column() col.operator("wm.studiolight_userpref_show", emboss=False, text="", icon='PREFERENCES') diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h index 31956877d1b..b1dc5821d7a 100644 --- a/source/blender/editors/include/UI_interface.h +++ b/source/blender/editors/include/UI_interface.h @@ -1087,7 +1087,9 @@ void uiTemplatePreview( struct MTex *slot, const char *preview_id); void uiTemplateColorRamp(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool expand); void uiTemplateIcon(uiLayout *layout, int icon_value, float icon_scale); -void uiTemplateIconView(uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool show_labels, float icon_scale); +void uiTemplateIconView( + uiLayout *layout, struct PointerRNA *ptr, const char *propname, bool show_labels, + float icon_scale, float icon_scale_popup); void uiTemplateHistogram(uiLayout *layout, struct PointerRNA *ptr, const char *propname); void uiTemplateWaveform(uiLayout *layout, struct PointerRNA *ptr, const char *propname); void uiTemplateVectorscope(uiLayout *layout, struct PointerRNA *ptr, const char *propname); diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c index 0d3aa43cd56..ec055ddb05b 100644 --- a/source/blender/editors/interface/interface_templates.c +++ b/source/blender/editors/interface/interface_templates.c @@ -2650,7 +2650,9 @@ static uiBlock *ui_icon_view_menu_cb(bContext *C, ARegion *ar, void *arg_litem) /** * \param icon_scale: Scale of the icon, 1x == button height. */ -void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname, bool show_labels, float icon_scale) +void uiTemplateIconView( + uiLayout *layout, PointerRNA *ptr, const char *propname, bool show_labels, + float icon_scale, float icon_scale_popup) { PropertyRNA *prop = RNA_struct_find_property(ptr, propname); IconViewMenuArgs *cb_args; @@ -2677,12 +2679,16 @@ void uiTemplateIconView(uiLayout *layout, PointerRNA *ptr, const char *propname, cb_args->ptr = *ptr; cb_args->prop = prop; cb_args->show_labels = show_labels; - cb_args->icon_scale = icon_scale; + cb_args->icon_scale = icon_scale_popup; - but = uiDefBlockButN(block, ui_icon_view_menu_cb, cb_args, "", 0, 0, UI_UNIT_X * 6, UI_UNIT_Y * 6, ""); + but = uiDefBlockButN( + block, ui_icon_view_menu_cb, cb_args, "", + 0, 0, UI_UNIT_X * icon_scale, UI_UNIT_Y * icon_scale, ""); } else { - but = uiDefIconBut(block, UI_BTYPE_LABEL, 0, ICON_X, 0, 0, UI_UNIT_X * 6, UI_UNIT_Y * 6, NULL, 0.0, 0.0, 0.0, 0.0, ""); + but = uiDefIconBut( + block, UI_BTYPE_LABEL, 0, ICON_X, + 0, 0, UI_UNIT_X * icon_scale, UI_UNIT_Y * icon_scale, NULL, 0.0, 0.0, 0.0, 0.0, ""); } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index fdf2b5f311b..0db0408d09f 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -941,7 +941,8 @@ void RNA_api_ui_layout(StructRNA *srna) RNA_def_function_ui_description(func, "Enum. Large widget showing Icon previews"); api_ui_item_rna_common(func); RNA_def_boolean(func, "show_labels", false, "", "Show enum label in preview buttons"); - RNA_def_float(func, "scale", 5.0f, 1.0f, 100.0f, "Scale", "Scale the icon size (by the button size)", 1.0f, 100.0f); + RNA_def_float(func, "scale", 6.0f, 1.0f, 100.0f, "UI Units", "Scale the button icon size (by the button size)", 1.0f, 100.0f); + RNA_def_float(func, "scale_popup", 5.0f, 1.0f, 100.0f, "Scale", "Scale the popup icon size (by the button size)", 1.0f, 100.0f); func = RNA_def_function(srna, "template_histogram", "uiTemplateHistogram"); RNA_def_function_ui_description(func, "Item. A histogramm widget to analyze imaga data"); |