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>2020-06-10 16:08:23 +0300
committerJulian Eisel <julian@blender.org>2020-06-10 16:52:10 +0300
commitd62bbf40793234a3cfc3762720f0964f85206169 (patch)
tree1aa1f7828ec6fcb4df01c484ab45ac78b9a5c624 /source/blender/editors/interface
parent93c8955a722ba3f2022b92a2f8befaadc467756a (diff)
UI: Show library names grayed out and right-aligned in menus
Should separate the data-block name better from the library name and improve readability.
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r--source/blender/editors/interface/interface_region_search.c5
-rw-r--r--source/blender/editors/interface/interface_templates.c4
-rw-r--r--source/blender/editors/interface/interface_utils.c4
3 files changed, 7 insertions, 6 deletions
diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index 34bbb644ef7..68be08ef4f8 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -555,6 +555,7 @@ static void ui_searchbox_region_draw_cb(const bContext *C, ARegion *region)
char *name = data->items.names[a];
int icon = data->items.icons[a];
char *name_sep_test = NULL;
+ const bool use_sep_char = data->use_sep || (state & UI_BUT_HAS_SEP_CHAR);
ui_searchbox_butrect(&rect, data, a);
@@ -563,7 +564,7 @@ static void ui_searchbox_region_draw_cb(const bContext *C, ARegion *region)
!(name_sep_test = strstr(data->items.names[a], data->sep_string))) {
/* Simple menu item. */
- ui_draw_menu_item(&data->fstyle, &rect, name, icon, state, data->use_sep, NULL);
+ ui_draw_menu_item(&data->fstyle, &rect, name, icon, state, use_sep_char, NULL);
}
else {
/* Split menu item, faded text before the separator. */
@@ -590,7 +591,7 @@ static void ui_searchbox_region_draw_cb(const bContext *C, ARegion *region)
/* The previous menu item draws the active selection. */
ui_draw_menu_item(
- &data->fstyle, &rect, name_sep, icon, state & ~UI_ACTIVE, data->use_sep, NULL);
+ &data->fstyle, &rect, name_sep, icon, state & ~UI_ACTIVE, use_sep_char, NULL);
}
}
/* indicate more */
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 6295f51f01e..7d856a51720 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -361,11 +361,11 @@ static bool id_search_add(const bContext *C,
* followed by ID_NAME-2 characters from id->name
*/
char name_ui[MAX_ID_FULL_NAME_UI];
- BKE_id_full_name_ui_prefix_get(name_ui, id);
+ BKE_id_full_name_ui_prefix_get(name_ui, id, UI_SEP_CHAR);
int iconid = ui_id_icon_get(C, id, template_ui->preview);
- if (!UI_search_item_add(items, name_ui, id, iconid, 0)) {
+ if (!UI_search_item_add(items, name_ui, id, iconid, UI_BUT_HAS_SEP_CHAR)) {
return false;
}
}
diff --git a/source/blender/editors/interface/interface_utils.c b/source/blender/editors/interface/interface_utils.c
index 4013e962ce5..15db947bff6 100644
--- a/source/blender/editors/interface/interface_utils.c
+++ b/source/blender/editors/interface/interface_utils.c
@@ -441,7 +441,7 @@ void ui_rna_collection_search_update_fn(const struct bContext *C,
name = RNA_struct_name_get_alloc(&itemptr, name_buf, sizeof(name_buf), NULL);
}
else {
- BKE_id_full_name_ui_prefix_get(name_buf, itemptr.data);
+ BKE_id_full_name_ui_prefix_get(name_buf, itemptr.data, UI_SEP_CHAR);
BLI_STATIC_ASSERT(sizeof(name_buf) >= MAX_ID_FULL_NAME_UI,
"Name string buffer should be big enough to hold full UI ID name");
name = name_buf;
@@ -473,7 +473,7 @@ void ui_rna_collection_search_update_fn(const struct bContext *C,
/* add search items from temporary list */
for (cis = items_list->first; cis; cis = cis->next) {
- if (!UI_search_item_add(items, cis->name, cis->data, cis->iconid, 0)) {
+ if (!UI_search_item_add(items, cis->name, cis->data, cis->iconid, UI_BUT_HAS_SEP_CHAR)) {
break;
}
}