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:
-rw-r--r--source/blender/editors/include/UI_interface.h3
-rw-r--r--source/blender/editors/interface/interface_region_search.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/editors/include/UI_interface.h b/source/blender/editors/include/UI_interface.h
index c6f631db48f..d0d2b83f7cc 100644
--- a/source/blender/editors/include/UI_interface.h
+++ b/source/blender/editors/include/UI_interface.h
@@ -235,7 +235,8 @@ enum {
UI_BUT_ACTIVE_LEFT = (1 << 21), /* Active left part of number button */
UI_BUT_ACTIVE_RIGHT = (1 << 22), /* Active right part of number button */
- UI_BUT_HAS_SHORTCUT = (1 << 23), /* Button has shortcut text */
+ /* (also used by search buttons to enforce shortcut display for their items). */
+ UI_BUT_HAS_SHORTCUT = (1 << 23), /* Button has shortcut text. */
UI_BUT_ICON_REVERSE = (1 << 24), /* Reverse order of consecutive off/on icons */
};
diff --git a/source/blender/editors/interface/interface_region_search.c b/source/blender/editors/interface/interface_region_search.c
index 471055ed24a..48d59830c2a 100644
--- a/source/blender/editors/interface/interface_region_search.c
+++ b/source/blender/editors/interface/interface_region_search.c
@@ -534,8 +534,9 @@ ARegion *ui_searchbox_create_generic(bContext *C, ARegion *butregion, uiBut *but
}
/* Only show key shortcuts when needed (checking RNA prop pointer is useless here, a lot of buttons are about data
- * without having that pointer defined, let's rather try with optype!). */
- if (but->optype != NULL) {
+ * without having that pointer defined, let's rather try with optype!). One can also enforce that behavior by
+ * setting UI_BUT_HAS_SHORTCUT drawflag of search button. */
+ if (but->optype != NULL || (but->drawflag & UI_BUT_HAS_SHORTCUT) != 0) {
data->use_sep = true;
}
@@ -754,6 +755,7 @@ ARegion *ui_searchbox_create_operator(bContext *C, ARegion *butregion, uiBut *bu
{
ARegion *ar;
+ UI_but_drawflag_enable(but, UI_BUT_HAS_SHORTCUT);
ar = ui_searchbox_create_generic(C, butregion, but);
ar->type->draw = ui_searchbox_region_draw_cb__operator;