UI API: don't use a text label when icon_only is set
authorCampbell Barton <ideasman42@gmail.com>
Thu, 30 Jan 2014 04:28:39 +0000 (15:28 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Thu, 30 Jan 2014 04:28:39 +0000 (15:28 +1100)
release/scripts/startup/bl_ui/space_image.py
source/blender/editors/interface/interface_layout.c

index 9b3c2267aba7fa961cdb91cba2e1f2ac4eb82982..c341d855ccc56ea02d84d5df8061f9c5e1909d4d 100644 (file)
@@ -544,7 +544,7 @@ class IMAGE_PT_view_histogram(Panel):
 
         layout.template_histogram(sima.scopes, "histogram")
         row = layout.row(align=True)
-        row.prop(hist, "mode", icon_only=True, expand=True)
+        row.prop(hist, "mode", expand=True)
         row.prop(hist, "show_line", text="")
 
 
index d2099334efbc8e992c28de7acff9a50aae0029c6..e10baa35d0d328a0cf357a33ab088a83057dbe61 100644 (file)
@@ -728,7 +728,7 @@ PointerRNA uiItemFullO_ptr(uiLayout *layout, wmOperatorType *ot, const char *nam
        int w;
 
        if (!name) {
-               if (ot && ot->srna)
+               if (ot && ot->srna && (flag & UI_ITEM_R_ICON_ONLY) == 0)
                        name = RNA_struct_ui_name(ot->srna);
                else
                        name = "";
@@ -1159,8 +1159,15 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
        len = (is_array) ? RNA_property_array_length(ptr, prop) : 0;
 
        /* set name and icon */
-       if (!name)
-               name = RNA_property_ui_name(prop);
+       if (!name) {
+               if ((flag & UI_ITEM_R_ICON_ONLY) == 0) {
+                       name = RNA_property_ui_name(prop);
+               }
+               else {
+                       name = "";
+               }
+       }
+
        if (icon == ICON_NONE)
                icon = RNA_property_ui_icon(prop);