UI: Add View pie to File Browser

Adds a pie menu to the File Browser for convenient switching between vertical list, horizontal list and thumbnail view.

Uses the same shortcut as other View pie menus (`ACCENT_GRAVE`).

{F12811673}

Reviewed By: #user_interface, pablovazquez, Severin

Differential Revision: https://developer.blender.org/D13874
This commit is contained in:
Fynn Grotehans
2022-08-16 18:07:03 +02:00
committed by Pablo Vazquez
parent b247588dc0
commit cdfe2e1c3f
2 changed files with 17 additions and 0 deletions

View File

@@ -566,6 +566,21 @@ class FILEBROWSER_MT_context_menu(FileBrowserMenu, Menu):
layout.prop_menu_enum(params, "sort_method")
class FILEBROWSER_MT_view_pie(Menu):
bl_label = "View"
bl_idname = "FILEBROWSER_MT_view_pie"
def draw(self, context):
layout = self.layout
pie = layout.menu_pie()
view = context.space_data
pie.prop_enum(view.params, "display_type", value='LIST_VERTICAL')
pie.prop_enum(view.params, "display_type", value='LIST_HORIZONTAL')
pie.prop_enum(view.params, "display_type", value='THUMBNAIL')
class ASSETBROWSER_PT_display(asset_utils.AssetBrowserPanel, Panel):
bl_region_type = 'HEADER'
bl_label = "Display Settings" # Shows as tooltip in popover
@@ -823,6 +838,7 @@ classes = (
FILEBROWSER_MT_view,
FILEBROWSER_MT_select,
FILEBROWSER_MT_context_menu,
FILEBROWSER_MT_view_pie,
ASSETBROWSER_PT_display,
ASSETBROWSER_PT_filter,
ASSETBROWSER_MT_editor_menus,