[Bf-blender-cvs] [6b2907926e2] userpref_redesign: Address most minor points from review

Severin noreply at git.blender.org
Mon Mar 19 01:53:39 CET 2018


Commit: 6b2907926e20e6b9170e6ada0c169ce195f3dd80
Author: Severin
Date:   Mon Mar 19 00:44:57 2018 +0100
Branches: userpref_redesign
https://developer.blender.org/rB6b2907926e20e6b9170e6ada0c169ce195f3dd80

Address most minor points from review

* Increase size of settings window again (some sections are too squeezed).
* Use '...' suffix to indicate that menu entry opens new window.
* Stick to current naming convention for area/region variables.
* Simplify tooltip.
* Remove hyphen ("keymap", not "key-map")

===================================================================

M	release/scripts/startup/bl_ui/space_info.py
M	source/blender/blenkernel/BKE_screen.h
M	source/blender/blenkernel/intern/screen.c
M	source/blender/editors/include/UI_interface.h
M	source/blender/editors/screen/screen_ops.c
M	source/blender/editors/space_userpref/space_userpref.c
M	source/blender/makesrna/intern/rna_userdef.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 49fe4ddcd0e..46741399202 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -135,7 +135,7 @@ class INFO_MT_file(Menu):
 
         layout.separator()
 
-        layout.operator("screen.settings_show", text="Settings", icon='PREFERENCES')
+        layout.operator("screen.settings_show", text="Settings...", icon='PREFERENCES')
 
         layout.operator_context = 'INVOKE_AREA'
         layout.operator("wm.save_homefile", icon='SAVE_PREFS')
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 902b7e42332..4782d87d67d 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -296,7 +296,7 @@ void BKE_spacedata_copylist(ListBase *lb1, ListBase *lb2);
 void BKE_spacedata_draw_locks(int set);
 
 struct ARegion *BKE_spacedata_find_region_type(
-        const struct SpaceLink *slink, const struct ScrArea *area,
+        const struct SpaceLink *slink, const struct ScrArea *sa,
         int region_type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
 
 void BKE_spacedata_callback_id_remap_set(void (*func)(struct ScrArea *, struct SpaceLink *, struct ID *, struct ID *));
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 259da8c35e0..780e2cb95b4 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -279,26 +279,26 @@ void BKE_spacedata_draw_locks(int set)
 }
 
 /**
- * Version of #BKE_area_find_region_type that also works if \a slink is not the active space of \a area.
+ * Version of #BKE_area_find_region_type that also works if \a slink is not the active space of \a sa.
  */
-ARegion *BKE_spacedata_find_region_type(const SpaceLink *slink, const ScrArea *area, int region_type)
+ARegion *BKE_spacedata_find_region_type(const SpaceLink *slink, const ScrArea *sa, int region_type)
 {
-	const bool is_slink_active = slink == area->spacedata.first;
+	const bool is_slink_active = slink == sa->spacedata.first;
 	const ListBase *regionbase = (is_slink_active) ?
-	                           &area->regionbase : &slink->regionbase;
-	ARegion *region = NULL;
+	                           &sa->regionbase : &slink->regionbase;
+	ARegion *ar = NULL;
 
-	BLI_assert(BLI_findindex(&area->spacedata, slink) != -1);
-	for (region = regionbase->first; region; region = region->next) {
-		if (region->regiontype == region_type) {
+	BLI_assert(BLI_findindex(&sa->spacedata, slink) != -1);
+	for (ar = regionbase->first; ar; ar = ar->next) {
+		if (ar->regiontype == region_type) {
 			break;
 		}
 	}
 
 	/* Should really unit test this instead. */
-	BLI_assert(!is_slink_active || region == BKE_area_find_region_type(area, region_type));
+	BLI_assert(!is_slink_active || ar == BKE_area_find_region_type(sa, region_type));
 
-	return region;
+	return ar;
 }
 
 
@@ -480,17 +480,17 @@ unsigned int BKE_screen_visible_layers(bScreen *screen, Scene *scene)
 /* ***************** Utilities ********************** */
 
 /**
- * Find a region of type \a region_type in the currently active space of \a area.
+ * Find a region of type \a region_type in the currently active space of \a sa.
  *
  * \note This does __not__ work if the region to look up is not in the active
  *       space. Use #BKE_spacedata_find_region_type if that may be the case.
  */
-ARegion *BKE_area_find_region_type(const ScrArea *area, int region_type)
+ARegion *BKE_area_find_region_type(const ScrArea *sa, int region_type)
 {
-	if (area) {
-		for (ARegion *region = area->regionbase.first; region; region = region->next) {
-			if (region->regiontype == region_type)
-				return region;
+	if (sa) {
+		for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) {
+			if (ar->regiontype == region_type)
+				return ar;
 		}
 	}
 
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index 320477f541e..3d2f692a202 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -191,6 +191,7 @@ enum {
 
 #define UI_PANEL_WIDTH          340
 #define UI_COMPACT_PANEL_WIDTH  160
+#define UI_NAVIGATION_REGION_WIDTH UI_COMPACT_PANEL_WIDTH
 
 #define UI_PANEL_CATEGORY_MARGIN_WIDTH (U.widget_unit * 1.0f)
 
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index ba769cfac25..a745b19233f 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -4021,8 +4021,8 @@ static void SCREEN_OT_back_to_previous(struct wmOperatorType *ot)
 
 static int settings_show_invoke(bContext *C, wmOperator *op, const wmEvent *event)
 {
-	const int sizex = 800 * UI_DPI_FAC;
-	const int sizey = 480 * UI_DPI_FAC;
+	const int sizex = (800 + UI_NAVIGATION_REGION_WIDTH) * UI_DPI_FAC;
+	const int sizey = 500 * UI_DPI_FAC;
 
 	/* changes context! */
 	if (WM_window_open_temp(C, event->x, event->y, sizex, sizey, WM_WINDOW_SETTINGS) != NULL) {
@@ -4039,10 +4039,9 @@ static void SCREEN_OT_settings_show(struct wmOperatorType *ot)
 {
 	/* identifiers */
 	ot->name = "Show Blender Settings";
-	ot->description = "Show window for global Blender settings (user preferences, "
-	                  "workspace configurations, system settings)";
+	ot->description = "Edit user preferences, workspaces and system settings";
 	ot->idname = "SCREEN_OT_settings_show";
-	
+
 	/* api callbacks */
 	ot->invoke = settings_show_invoke;
 	ot->poll = ED_operator_screenactive;
diff --git a/source/blender/editors/space_userpref/space_userpref.c b/source/blender/editors/space_userpref/space_userpref.c
index 58b934b7f59..430c37d4aa7 100644
--- a/source/blender/editors/space_userpref/space_userpref.c
+++ b/source/blender/editors/space_userpref/space_userpref.c
@@ -225,7 +225,7 @@ void ED_spacetype_userpref(void)
 	/* regions: navigation window */
 	art = MEM_callocN(sizeof(ARegionType), "spacetype userpref region");
 	art->regionid = RGN_TYPE_UI;
-	art->prefsizex = UI_COMPACT_PANEL_WIDTH;
+	art->prefsizex = UI_NAVIGATION_REGION_WIDTH;
 	art->init = userpref_navigation_region_init;
 	art->draw = userpref_navigation_region_draw;
 	art->listener = userpref_navigation_region_listener;
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 923e32319b5..4c3047aee2c 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -4707,7 +4707,7 @@ void RNA_def_userdef(BlenderRNA *brna)
 		{0, "", 0, "Workspaces", ""},
 		{USER_SECTION_WORKSPACE_CONFIG, "WORKSPACE_CONFIG", 0, "Configuration File", ""},
 		{USER_SECTION_WORKSPACE_ADDONS, "WORKSPACE_ADDONS", 0, "Add-on Overrides", ""},
-		{USER_SECTION_WORKSPACE_KEYMAPS, "WORKSPACE_KEYMAPS", 0, "Key-map Overrides", ""},
+		{USER_SECTION_WORKSPACE_KEYMAPS, "WORKSPACE_KEYMAPS", 0, "Keymap Overrides", ""},
 		{0, "", 0, "System", ""},
 		{USER_SECTION_SYSTEM_GENERAL, "SYSTEM_GENERAL", 0, "General", ""},
 		{USER_SECTION_SYSTEM_DRAWING, "SYSTEM_DRAWING", 0, "Drawing", ""},



More information about the Bf-blender-cvs mailing list