Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2018-11-25 18:21:35 +0300
committerJulian Eisel <eiseljulian@gmail.com>2018-11-25 19:08:58 +0300
commitb00963afc14978b2de7f2859525bf89612aa4aee (patch)
treef83ec02a96b84019735037528e31e827dcc0dbd6 /source/blender/blenkernel
parent3135ed376bba357f3a41f7025db3fb79fd6c0f61 (diff)
UI: Initial User-Preferences redesign
Implements the first changes for T54115: * Rename "User Preferences" window to "Settings" in the UI. We'll likely put workspace settings in there, separate from the global user settings. System settings should become separate from user settings in future to allow settings for specific hardware. * Add sidebar region for navigation (scrolls independently). Addresses space problems, so we can add more categories as needed now. * Increase size of Settings window to compensate new navigation bar. * Group sections into User Preferences and System. Icons for section groups by Andrzej Ambroz. Thanks! * Bumps subversion for file compatibility. Screenshot: https://developer.blender.org/F5715337 I also added categories for future work, but commented them out. We may also want to redesign contents of each section now. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D3088 Design Task: https://developer.blender.org/T54115
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_blender_version.h2
-rw-r--r--source/blender/blenkernel/BKE_screen.h6
-rw-r--r--source/blender/blenkernel/intern/screen.c40
3 files changed, 40 insertions, 8 deletions
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 32b9508a679..b34dc55ba44 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -28,7 +28,7 @@
* and keep comment above the defines.
* Use STRINGIFY() rather than defining with quotes */
#define BLENDER_VERSION 280
-#define BLENDER_SUBVERSION 33
+#define BLENDER_SUBVERSION 34
/* Several breakages with 280, e.g. collections vs layers */
#define BLENDER_MINVERSION 280
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 0d766e83299..75d2ed0d0bc 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -319,6 +319,10 @@ void BKE_spacedata_freelist(ListBase *lb);
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 *sa,
+ int region_type) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
+
void BKE_spacedata_callback_id_remap_set(
void (*func)(struct ScrArea *sa, struct SpaceLink *sl, struct ID *old_id, struct ID *new_id));
void BKE_spacedata_id_unref(struct ScrArea *sa, struct SpaceLink *sl, struct ID *id);
@@ -332,7 +336,7 @@ void BKE_screen_area_free(struct ScrArea *sa);
void BKE_region_callback_free_gizmomap_set(void (*callback)(struct wmGizmoMap *));
void BKE_region_callback_refresh_tag_gizmomap_set(void (*callback)(struct wmGizmoMap *));
-struct ARegion *BKE_area_find_region_type(struct ScrArea *sa, int type);
+struct ARegion *BKE_area_find_region_type(const struct ScrArea *sa, int type);
struct ARegion *BKE_area_find_region_active_win(struct ScrArea *sa);
struct ARegion *BKE_area_find_region_xy(struct ScrArea *sa, const int regiontype, int x, int y);
struct ScrArea *BKE_screen_find_area_from_space(struct bScreen *sc, struct SpaceLink *sl) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1, 2);
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 0c93281bf84..e23291d42d4 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -309,6 +309,30 @@ 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 sa.
+ */
+ARegion *BKE_spacedata_find_region_type(const SpaceLink *slink, const ScrArea *sa, int region_type)
+{
+ const bool is_slink_active = slink == sa->spacedata.first;
+ const ListBase *regionbase = (is_slink_active) ?
+ &sa->regionbase : &slink->regionbase;
+ ARegion *ar = NULL;
+
+ 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 || ar == BKE_area_find_region_type(sa, region_type));
+
+ return ar;
+}
+
+
static void (*spacedata_id_remap_cb)(struct ScrArea *sa, struct SpaceLink *sl, ID *old_id, ID *new_id) = NULL;
void BKE_spacedata_callback_id_remap_set(void (*func)(ScrArea *sa, SpaceLink *sl, ID *, ID *))
@@ -644,17 +668,21 @@ void BKE_screen_remove_unused_scrverts(bScreen *sc)
/* ***************** Utilities ********************** */
-/* Find a region of the specified type from the given area */
-ARegion *BKE_area_find_region_type(ScrArea *sa, int type)
+/**
+ * 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 *sa, int region_type)
{
if (sa) {
- ARegion *ar;
-
- for (ar = sa->regionbase.first; ar; ar = ar->next) {
- if (ar->regiontype == type)
+ for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == region_type)
return ar;
}
}
+
return NULL;
}