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:
parent
b247588dc0
commit
cdfe2e1c3f
|
@ -2234,6 +2234,7 @@ def km_file_browser(params):
|
|||
{"properties": [("increment", -10)]}),
|
||||
("file.filenum", {"type": 'NUMPAD_MINUS', "value": 'PRESS', "ctrl": True, "repeat": True},
|
||||
{"properties": [("increment", -100)]}),
|
||||
op_menu_pie("FILEBROWSER_MT_view_pie", {"type": 'ACCENT_GRAVE', "value": 'PRESS'}),
|
||||
|
||||
# Select file under cursor before spawning the context menu.
|
||||
("file.select", {"type": 'RIGHTMOUSE', "value": 'PRESS'},
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue