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 <julian@blender.org>2021-10-27 13:06:31 +0300
committerJulian Eisel <julian@blender.org>2021-10-27 13:14:47 +0300
commitd161b5d204a585b910a47ca432544570ea10911e (patch)
treecfc49206b2a1520f65dcabd407667f746beb923c /source/blender/editors/space_file/asset_catalog_tree_view.cc
parente16bc136f92bd166219ef6e21bcd1a303b335aa0 (diff)
UI: Add padding to the left of tree-rows labels without icon
The label was placed right at the left border of the row highlight, which looked weird. So add some padding to tree-row labels without icon or collapse chevron, which makes it look more polished. As additional benefit, it alignes the labels better with icons of other rows on the same tree level. And the padding makes it more clear that a child is indeed a child, not just a sibling without icon.
Diffstat (limited to 'source/blender/editors/space_file/asset_catalog_tree_view.cc')
-rw-r--r--source/blender/editors/space_file/asset_catalog_tree_view.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/source/blender/editors/space_file/asset_catalog_tree_view.cc b/source/blender/editors/space_file/asset_catalog_tree_view.cc
index 354ee742598..53981ca244d 100644
--- a/source/blender/editors/space_file/asset_catalog_tree_view.cc
+++ b/source/blender/editors/space_file/asset_catalog_tree_view.cc
@@ -233,12 +233,8 @@ void AssetCatalogTreeViewItem::on_activate()
void AssetCatalogTreeViewItem::build_row(uiLayout &row)
{
- if (catalog_item_.has_unsaved_changes()) {
- uiItemL(&row, (label_ + "*").c_str(), icon);
- }
- else {
- uiItemL(&row, label_.c_str(), icon);
- }
+ const std::string label_override = catalog_item_.has_unsaved_changes() ? (label_ + "*") : label_;
+ add_label(row, label_override);
if (!is_hovered()) {
return;