diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-17 16:31:18 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2019-01-17 17:04:38 +0300 |
commit | 1a3abc7f79aa8f4550addfb5925fc8c3786b4753 (patch) | |
tree | 9caacfa6f6becd5b3a225f056779f4a41e78b0e3 /source/blender/editors/space_userpref | |
parent | be079e742dcdc54f1e84ac2c23dda0490b8eea17 (diff) |
Preferences: fit a little better when opened in place of properties editor.
Diffstat (limited to 'source/blender/editors/space_userpref')
-rw-r--r-- | source/blender/editors/space_userpref/space_userpref.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c index b7f6b045d4b..efaafb6cdb7 100644 --- a/source/blender/editors/space_userpref/space_userpref.c +++ b/source/blender/editors/space_userpref/space_userpref.c @@ -53,7 +53,7 @@ /* ******************** default callbacks for userpref space ***************** */ -static SpaceLink *userpref_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scene)) +static SpaceLink *userpref_new(const ScrArea *area, const Scene *UNUSED(scene)) { ARegion *ar; SpaceUserPref *spref; @@ -76,6 +76,11 @@ static SpaceLink *userpref_new(const ScrArea *UNUSED(area), const Scene *UNUSED( ar->regiontype = RGN_TYPE_NAV_BAR; ar->alignment = RGN_ALIGN_LEFT; + /* Use smaller size when opened in area like properties editor. */ + if (area->winx && area->winx < 3.0f * UI_NAVIGATION_REGION_WIDTH * UI_DPI_FAC) { + ar->sizex = UI_NARROW_NAVIGATION_REGION_WIDTH; + } + /* execution region */ ar = MEM_callocN(sizeof(ARegion), "execution region for userpref"); |