[Bf-blender-cvs] [0178cfa3055] userpref_redesign: Hide Preferences header when opened in temporary window
Julian Eisel
noreply at git.blender.org
Thu Dec 20 02:14:09 CET 2018
Commit: 0178cfa305500d92b4a6f67b9201171a10351338
Author: Julian Eisel
Date: Thu Dec 20 02:11:41 2018 +0100
Branches: userpref_redesign
https://developer.blender.org/rB0178cfa305500d92b4a6f67b9201171a10351338
Hide Preferences header when opened in temporary window
Also, use full width of the area again for the header.
===================================================================
M source/blender/editors/screen/screen_ops.c
M source/blender/editors/space_userpref/space_userpref.c
===================================================================
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 5133f3fba67..f0606d9d296 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4358,6 +4358,10 @@ static int userpref_show_invoke(bContext *C, wmOperator *op, const wmEvent *even
/* changes context! */
if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_USERPREFS) != NULL) {
+ /* The header only contains the editor switcher and looks empty. So hiding in the temp window makes sense. */
+ ScrArea *area = CTX_wm_area(C);
+ ARegion *region = BKE_area_find_region_type(area, RGN_TYPE_HEADER);
+ region->flag |= RGN_FLAG_HIDDEN;
return OPERATOR_FINISHED;
}
else {
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c
index 9a876f9d925..37e098f6b34 100644
--- a/source/blender/editors/space_userpref/space_userpref.c
+++ b/source/blender/editors/space_userpref/space_userpref.c
@@ -61,13 +61,6 @@ static SpaceLink *userpref_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
spref = MEM_callocN(sizeof(SpaceUserPref), "inituserpref");
spref->spacetype = SPACE_USERPREF;
- /* navigation region */
- ar = MEM_callocN(sizeof(ARegion), "navigation region for userpref");
-
- BLI_addtail(&spref->regionbase, ar);
- ar->regiontype = RGN_TYPE_NAV_BAR;
- ar->alignment = RGN_ALIGN_LEFT;
-
/* header */
ar = MEM_callocN(sizeof(ARegion), "header for userpref");
@@ -76,6 +69,13 @@ static SpaceLink *userpref_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
/* Ignore user preference "USER_HEADER_BOTTOM" here (always show bottom for new types). */
ar->alignment = RGN_ALIGN_BOTTOM;
+ /* navigation region */
+ ar = MEM_callocN(sizeof(ARegion), "navigation region for userpref");
+
+ BLI_addtail(&spref->regionbase, ar);
+ ar->regiontype = RGN_TYPE_NAV_BAR;
+ ar->alignment = RGN_ALIGN_LEFT;
+
/* main region */
ar = MEM_callocN(sizeof(ARegion), "main region for userpref");
More information about the Bf-blender-cvs
mailing list