diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-09-30 19:54:11 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-09-30 20:27:02 +0300 |
commit | ddb157999eed6907e3fd8753d61e65491f2f3a6d (patch) | |
tree | 4235cd3bc8f647a8ff71fe5ca17efe1ddbcf2c2f /source/blender/makesdna/DNA_userdef_types.h | |
parent | 5940f6b3d9cfa99a1b893b6149d36ee0a8c51584 (diff) |
UI: Remember File Browser Display Options in Preferences
This makes it so that some display related properties of the file
browser state are remembered in the Preferences. Otherwise, users often
end up doing the same set up work over and over again, so this is a
nice way to save users some work.
It's typical for other file browsers to remember their state too, so
another benefit is having a more conventional behavior, meeting user
expectations better.
Some points:
* We currently store: Window size, display type, thumbnail size,
enabled details-columns, sort options, "Show Hidden" option. More can
be added easily.
* No changes are stored to the Preferences if "Auto-save Preferences"
is disabled. This is how Quick Favorites behave too and it's a
reasonable way to make this behavior optional.
* The Preferences are only saved to permanent memory upon closing
Blender, following existing convention of Preferences and Quick
Favorites.
* If settings weren't actually changed, Preference saving is skipped.
* Only temporary file browsers save their state (invoked through
actions like open or save), not regular file browser editors. These
are usually used for different purposes and workflows.
* Removes "Show Thumbnails" Preferences option. It would need some
special handling, possibly introducing bugs. For users, this
simplifies behavior and should make things more predictable.
Left in DNA data in case we decide to bring it back.
Reviewers: brecht, #user_interface, billreynish, campbellbarton
Reviewed By: #user_interface, William Reynish, Campbell Barton, Brecht
van Lommel (quick first pass review in person)
Maniphest Tasks: T69460
Differential Revision: https://developer.blender.org/D5893
Diffstat (limited to 'source/blender/makesdna/DNA_userdef_types.h')
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 4006cbc977e..126b4638ca1 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -577,6 +577,24 @@ typedef struct UserDef_SpaceData { char _pad0[6]; } UserDef_SpaceData; +/** + * Storage for UI data that to keep it even after the window was closed. (Similar to + * #UserDef_SpaceData.) + */ +typedef struct UserDef_FileSpaceData { + int display_type; /* FileSelectParams.display */ + int thumbnail_size; /* FileSelectParams.thumbnail_size */ + int sort_type; /* FileSelectParams.sort */ + int details_flags; /* FileSelectParams.details_flags */ + int flag; /* FileSelectParams.flag */ + + char _pad[4]; + + /** Info used when creating the file browser in a temporary window. */ + int temp_win_sizex; + int temp_win_sizey; +} UserDef_FileSpaceData; + typedef struct UserDef { /** UserDef has separate do-version handling, and can be read from other files. */ int versionfile, subversionfile; @@ -823,6 +841,7 @@ typedef struct UserDef { /** The UI for the user preferences. */ UserDef_SpaceData space_data; + UserDef_FileSpaceData file_space_data; /** Runtime data (keep last). */ UserDef_Runtime runtime; @@ -972,7 +991,11 @@ typedef enum eUserpref_UI_Flag { USER_ZOOM_HORIZ = (1 << 26), /* for CONTINUE and DOLLY zoom */ USER_SPLASH_DISABLE = (1 << 27), USER_HIDE_RECENT = (1 << 28), - USER_SHOW_THUMBNAILS = (1 << 29), +#ifdef DNA_DEPRECATED + USER_SHOW_THUMBNAILS = + (1 << 29), /* deprecated - We're just trying if there's much desire for this feature, or if + we can make it go for good. Should be cleared if so - Julian, Oct. 2019 */ +#endif USER_SAVE_PROMPT = (1 << 30), USER_HIDE_SYSTEM_BOOKMARKS = (1u << 31), } eUserpref_UI_Flag; |