4
$\begingroup$

I want the UIList to not show the filter options (inkl. the plus button).

I've use following flag:

self.use_filter_show = False

The flag disables the filters but not the plus button. I thought it's a bug and created following issue, but it's not.

https://developer.blender.org/T43455

So my question is how it's done correctly? To hide the filter with the button in a UIList.

Here my list code:

class SCENE_UL_ds_effect_collection(bpy.types.UIList):

    def draw_item(self, context, layout, data, item, icon, active_data, active_propname):
        self.use_filter_show = False
        ob = data
        if self.layout_type in {'DEFAULT', 'COMPACT'}:
            if item:
                layout.prop(item, "name", text="", emboss=False)
            else:
                layout.label(text="", translate=False)
        elif self.layout_type in {'GRID'}:
            layout.alignment = 'CENTER'
            layout.label(text="", icon_value=icon)
$\endgroup$
  • $\begingroup$ Why do you want to remove it? The widget is built-in, there's no way to remove the + button AFAIK. $\endgroup$ – CoDEmanX Feb 2 '15 at 14:51
  • $\begingroup$ The reason: I don't need and not want the filter options in the list. It changes the display of the list, but not the underlying list. My addon uses the order of the list. I don't want the user to be able to reverse and filter the list. The user would see a different list than I use in the addon. $\endgroup$ – PHEDev Feb 2 '15 at 16:40
  • $\begingroup$ With the use_filter_show flag it's possible to hide the filters but not the + button. This is strange in my opinion. If I can hide the filters I should also be able to hide the button that enables the filters. Now nothing happens when the user clicks on the + button and that is strange. $\endgroup$ – PHEDev Feb 2 '15 at 16:47
  • 1
    $\begingroup$ Do you need any other features of the list widget? Like Ctrl+Click rename? The scrollbar? If no, you could draw all the items yourself with plain labels and without buttons to change order. Note that the user can always shuffle the items via Python console. $\endgroup$ – CoDEmanX Feb 2 '15 at 17:13
  • 1
    $\begingroup$ Not possible right now. See following issue, because it's an usability issue: developer.blender.org/T43455 $\endgroup$ – PHEDev Feb 2 '15 at 17:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.