diff options
author | Julian Eisel <julian@blender.org> | 2021-10-27 01:02:29 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2021-10-27 01:07:17 +0300 |
commit | f195a3a30dfe27a5927b0dfa9843c571ae1f1cce (patch) | |
tree | 81e59e97b3edfb58fc1a0985c3af7969eb15695b | |
parent | 2c2d4bc3a33128d4c32a53a6b9e484309abba7bf (diff) |
Asset Browser: Reduce paddings & margins between previews
The paddings and margins were more than needed, this reduces them a bit. That
way space is used more efficiently, the small differences add up so that more
items fit into a row.
The File Browser should not be affected.
Before/after comparisons:
{F11529986} {F11529988}
{F11529987} {F11529989}
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index 4cd05237138..5299b8ba580 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -979,6 +979,8 @@ static void file_attribute_columns_init(const FileSelectParams *params, FileLayo void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *region) { FileSelectParams *params = ED_fileselect_get_active_params(sfile); + /* Request a slightly more compact layout for asset browsing. */ + const bool compact = ED_fileselect_is_asset_browser(sfile); FileLayout *layout = NULL; View2D *v2d = ®ion->v2d; int numfiles; @@ -998,12 +1000,13 @@ void ED_fileselect_init_layout(struct SpaceFile *sfile, ARegion *region) layout->textheight = textheight; if (params->display == FILE_IMGDISPLAY) { + const float pad_fac = compact ? 0.15f : 0.3f; layout->prv_w = ((float)params->thumbnail_size / 20.0f) * UI_UNIT_X; layout->prv_h = ((float)params->thumbnail_size / 20.0f) * UI_UNIT_Y; - layout->tile_border_x = 0.3f * UI_UNIT_X; - layout->tile_border_y = 0.3f * UI_UNIT_X; - layout->prv_border_x = 0.3f * UI_UNIT_X; - layout->prv_border_y = 0.3f * UI_UNIT_Y; + layout->tile_border_x = pad_fac * UI_UNIT_X; + layout->tile_border_y = pad_fac * UI_UNIT_X; + layout->prv_border_x = pad_fac * UI_UNIT_X; + layout->prv_border_y = pad_fac * UI_UNIT_Y; layout->tile_w = layout->prv_w + 2 * layout->prv_border_x; layout->tile_h = layout->prv_h + 2 * layout->prv_border_y + textheight; layout->width = (int)(BLI_rctf_size_x(&v2d->cur) - 2 * layout->tile_border_x); |