diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-10-29 23:34:14 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-10-29 23:44:01 +0300 |
commit | ab6c7ff2ab1531f70b0f47f30f195fd2b1c14851 (patch) | |
tree | 96ffd73c52f97ee6a8e4772480236359862c5170 /release/scripts/startup/bl_ui/space_properties.py | |
parent | ce148716c8163162ba7275980792d432c0b3f5ed (diff) |
UI: Vertical Properties Editor Tabs
Moves the Properties editor context switching to a vertical tabs region.
Design Task: T54951
Differential Revison: D3840
The tabs are regular widgets, unlike the 'old' toolshelf tabs. This means they
give mouse hover feedback, have tooltips, support the right-click menu, etc.
Also, when vertical screen space gets tight, the tabs can be scrolled, they
don't shrink like the toolshelf ones.
The tab region is slightly larger than the header. The tabs are scaled up
accordingly. This makes them nicely readable.
The header is quite empty now. As shown in T54951, we wanted to have a search
button there. This should be added next.
Implementation Notes:
* Added a new region type, RGN_TYPE_NAVIGATION.
* Having the tabs in a separate region allows scrolling of the tab-bar, unlike
the toolshelf tabs. We might want to remove the scrollbars though.
* Added a new region flag RGN_FLAG_PREFSIZE_OR_HIDDEN, to ensure the tab region
is either hidden or has a fixed size.
* Added some additional flags to support fine-tuning the layout in panel and
layout code.
* Bumps subversion.
Diffstat (limited to 'release/scripts/startup/bl_ui/space_properties.py')
-rw-r--r-- | release/scripts/startup/bl_ui/space_properties.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/release/scripts/startup/bl_ui/space_properties.py b/release/scripts/startup/bl_ui/space_properties.py index 2d1725b2087..b60e1e7d6fb 100644 --- a/release/scripts/startup/bl_ui/space_properties.py +++ b/release/scripts/startup/bl_ui/space_properties.py @@ -18,7 +18,7 @@ # <pep8 compliant> import bpy -from bpy.types import Header +from bpy.types import Header, Panel class PROPERTIES_HT_header(Header): @@ -27,16 +27,29 @@ class PROPERTIES_HT_header(Header): def draw(self, context): layout = self.layout - view = context.space_data - row = layout.row() row.template_header() - row.prop(view, "context", expand=True, icon_only=True) + +class PROPERTIES_PT_navigation_bar(Panel): + bl_space_type = 'PROPERTIES' + bl_region_type = 'NAVIGATION_BAR' + bl_label = "Navigation Bar" + bl_options = {'HIDE_HEADER'} + + def draw(self, context): + layout = self.layout + + view = context.space_data + + layout.scale_x = 1.4 + layout.scale_y = 1.4 + layout.prop_tabs_enum(view, "context", icon_only=True) classes = ( PROPERTIES_HT_header, + PROPERTIES_PT_navigation_bar, ) if __name__ == "__main__": # only for live edit. |