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/interface/interface_region_menu_popup.c8
-rw-r--r--source/blender/editors/interface/interface_widgets.c2
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/editors/interface/interface_region_menu_popup.c b/source/blender/editors/interface/interface_region_menu_popup.c
index a161a449ba0..31ef7261eb3 100644
--- a/source/blender/editors/interface/interface_region_menu_popup.c
+++ b/source/blender/editors/interface/interface_region_menu_popup.c
@@ -88,11 +88,11 @@ int ui_but_menu_step(uiBut *but, int direction)
return 0;
}
-static uint ui_popup_string_hash(const char *str)
+static uint ui_popup_string_hash(const char *str, const bool use_sep)
{
/* sometimes button contains hotkey, sometimes not, strip for proper compare */
int hash;
- const char *delimit = strrchr(str, UI_SEP_CHAR);
+ const char *delimit = use_sep ? strrchr(str, UI_SEP_CHAR) : NULL;
if (delimit) {
hash = BLI_ghashutil_strhash_n(str, delimit - str);
@@ -126,13 +126,13 @@ static uiBut *ui_popup_menu_memory__internal(uiBlock *block, uiBut *but)
if (but) {
/* set */
- mem[hash_mod] = ui_popup_string_hash(but->str);
+ mem[hash_mod] = ui_popup_string_hash(but->str, but->flag & UI_BUT_HAS_SEP_CHAR);
return NULL;
}
else {
/* get */
for (but = block->buttons.first; but; but = but->next) {
- if (ui_popup_string_hash(but->str) == mem[hash_mod]) {
+ if (mem[hash_mod] == ui_popup_string_hash(but->str, but->flag & UI_BUT_HAS_SEP_CHAR)) {
return but;
}
}
diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c
index 361e5e76acc..ae40b01c77d 100644
--- a/source/blender/editors/interface/interface_widgets.c
+++ b/source/blender/editors/interface/interface_widgets.c
@@ -5279,7 +5279,7 @@ void ui_draw_menu_item(const uiFontStyle *fstyle,
/* cut string in 2 parts? */
if (use_sep) {
- cpoin = strchr(name, UI_SEP_CHAR);
+ cpoin = strrchr(name, UI_SEP_CHAR);
if (cpoin) {
*cpoin = 0;